Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
lk_usermodehelper [2019/02/14 15:16] – [drivers/macintosh/windfarm_core.c] rpjdaylk_usermodehelper [2019/02/14 15:18] (current) – [init/do_mounts_initrd.c] rpjday
Line 341: Line 341:
                  
         ...         ...
 +</code>
 +
 +==== kernel/reboot.c ====
 +
 +<code>
 +char poweroff_cmd[POWEROFF_CMD_PATH_LEN] = "/sbin/poweroff";
 +static const char reboot_cmd[] = "/sbin/reboot";
 +
 +static int run_cmd(const char *cmd)
 +{
 +        char **argv;
 +        static char *envp[] = {
 +                "HOME=/",
 +                "PATH=/sbin:/bin:/usr/sbin:/usr/bin",
 +                NULL
 +        };
 +        int ret;
 +        argv = argv_split(GFP_KERNEL, cmd, NULL);
 +        if (argv) {
 +                ret = call_usermodehelper(argv[0], argv, envp, UMH_WAIT_EXEC);
 +                argv_free(argv);
 +        } else {
 +                ret = -ENOMEM;
 +        }
 +
 +        return ret;
 +}
 </code> </code>
  • lk_usermodehelper.1550157376.txt.gz
  • Last modified: 2019/02/14 15:16
  • by rpjday