init:enable usermodehelper as soon as we have a root filesystem
PATCH 1/1 init:enable usermodehelper as soon as we have a root filesystem
before we have a root filesystem , it is useless to enable usermodehelper, and it may cause bug if we enable usermodehelper too early.This patch enable usermodehelper as soon as we have a root filesystem.
--- init/do_mounts.c | 3 +++ init/initramfs.c | 2 ++ init/main.c | 1 - 3 files changed, 5 insertions(+), 1 deletions(-)
init/do_mounts.c +3 -0
@@ -490,4 +490,7 @@ out:devtmpfs_mount ("dev" );sys_mount ("." ,"/" ,NULL ,MS_MOVE ,NULL );sys_chroot ((const char __user __force *)"." ); +#ifndef CONFIG_BLK_DEV_INITRD +usermodehelper_enable (); +#endif }
init/initramfs.c +2 -0
@@ -581,6 +581,7 @@ static int __init populate_rootfs(void) err =unpack_to_rootfs ((char *)initrd_start, initrd_end - initrd_start);if (!err) { +usermodehelper_enable ();free_initrd ();return 0 ; }else {
@@ -603,6 +604,7 @@ static int __init populate_rootfs(void) initrd_end - initrd_start);if (err)printk (KERN_EMERG "Initramfs unpacking failed: %s\n" , err); +usermodehelper_enable ();free_initrd ();#endif }
init/main.c +0 -1
@@ -730,7 +730,6 @@ static void __init do_basic_setup(void)driver_init ();init_irq_proc ();do_ctors (); -usermodehelper_enable ();do_initcalls (); }
Signature · 1 line
1.7.3.4