X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Fcore%2Fmain.c;h=64acdf76e1dbecf63237b4fb5c23c7ce6b6b87c0;hb=609c3029076da1ba423673161e5d0fc82ccca6b6;hp=a0a6ae1f0ab3e23950def6a5a61ce70322ecbb14;hpb=fa1b91632c5220e6589007af4cd573ca909f915a;p=elogind.git diff --git a/src/core/main.c b/src/core/main.c index a0a6ae1f0..64acdf76e 100644 --- a/src/core/main.c +++ b/src/core/main.c @@ -75,9 +75,7 @@ #include "selinux-setup.h" #include "ima-setup.h" #include "smack-setup.h" -#ifdef HAVE_KMOD #include "kmod-setup.h" -#endif static enum { ACTION_RUN, @@ -1293,11 +1291,11 @@ int main(int argc, char *argv[]) { if (!skip_setup) { mount_setup_early(); dual_timestamp_get(&security_start_timestamp); - if (selinux_setup(&loaded_policy) < 0) + if (mac_selinux_setup(&loaded_policy) < 0) goto finish; if (ima_setup() < 0) goto finish; - if (smack_setup(&loaded_policy) < 0) + if (mac_smack_setup(&loaded_policy) < 0) goto finish; dual_timestamp_get(&security_finish_timestamp); } @@ -1389,6 +1387,11 @@ int main(int argc, char *argv[]) { /* Mount /proc, /sys and friends, so that /proc/cmdline and * /proc/$PID/fd is available. */ if (getpid() == 1) { + + /* Load the kernel modules early, so that we kdbus.ko is loaded before kdbusfs shall be mounted */ + if (!skip_setup) + kmod_setup(); + r = mount_setup(loaded_policy); if (r < 0) goto finish; @@ -1402,9 +1405,11 @@ int main(int argc, char *argv[]) { if (parse_config_file() < 0) goto finish; - if (arg_running_as == SYSTEMD_SYSTEM) - if (parse_proc_cmdline(parse_proc_cmdline_item) < 0) - goto finish; + if (arg_running_as == SYSTEMD_SYSTEM) { + r = parse_proc_cmdline(parse_proc_cmdline_item); + if (r < 0) + log_warning("Failed to parse kernel command line, ignoring: %s", strerror(-r)); + } /* Note that this also parses bits from the kernel command * line, including "debug". */ @@ -1551,9 +1556,6 @@ int main(int argc, char *argv[]) { if (arg_show_status > 0 || plymouth_running()) status_welcome(); -#ifdef HAVE_KMOD - kmod_setup(); -#endif hostname_setup(); machine_id_setup(NULL); loopback_setup();