mount-setup: remove mount_setup_late()
Turns out we can just do kmod_setup() earlier, before we do mount_setup(), so there's no need for mount_setup_late() anymore. Instead, put kdbusfs in mount_table[].
This commit is contained in:
parent
56c8b52d4d
commit
2e75e2a8f5
|
@ -1389,6 +1389,11 @@ int main(int argc, char *argv[]) {
|
||||||
/* Mount /proc, /sys and friends, so that /proc/cmdline and
|
/* Mount /proc, /sys and friends, so that /proc/cmdline and
|
||||||
* /proc/$PID/fd is available. */
|
* /proc/$PID/fd is available. */
|
||||||
if (getpid() == 1) {
|
if (getpid() == 1) {
|
||||||
|
#ifdef HAVE_KMOD
|
||||||
|
if (!skip_setup)
|
||||||
|
kmod_setup();
|
||||||
|
#endif
|
||||||
|
|
||||||
r = mount_setup(loaded_policy);
|
r = mount_setup(loaded_policy);
|
||||||
if (r < 0)
|
if (r < 0)
|
||||||
goto finish;
|
goto finish;
|
||||||
|
@ -1553,10 +1558,6 @@ int main(int argc, char *argv[]) {
|
||||||
if (arg_show_status > 0 || plymouth_running())
|
if (arg_show_status > 0 || plymouth_running())
|
||||||
status_welcome();
|
status_welcome();
|
||||||
|
|
||||||
#ifdef HAVE_KMOD
|
|
||||||
kmod_setup();
|
|
||||||
#endif
|
|
||||||
mount_setup_late();
|
|
||||||
hostname_setup();
|
hostname_setup();
|
||||||
machine_id_setup(NULL);
|
machine_id_setup(NULL);
|
||||||
loopback_setup();
|
loopback_setup();
|
||||||
|
|
|
@ -108,9 +108,6 @@ static const MountPoint mount_table[] = {
|
||||||
{ "efivarfs", "/sys/firmware/efi/efivars", "efivarfs", NULL, MS_NOSUID|MS_NOEXEC|MS_NODEV,
|
{ "efivarfs", "/sys/firmware/efi/efivars", "efivarfs", NULL, MS_NOSUID|MS_NOEXEC|MS_NODEV,
|
||||||
is_efi_boot, MNT_NONE },
|
is_efi_boot, MNT_NONE },
|
||||||
#endif
|
#endif
|
||||||
};
|
|
||||||
|
|
||||||
static const MountPoint mount_table_late[] = {
|
|
||||||
#ifdef ENABLE_KDBUS
|
#ifdef ENABLE_KDBUS
|
||||||
{ "kdbusfs", "/sys/fs/kdbus", "kdbusfs", NULL, MS_NOSUID|MS_NOEXEC|MS_NODEV,
|
{ "kdbusfs", "/sys/fs/kdbus", "kdbusfs", NULL, MS_NOSUID|MS_NOEXEC|MS_NODEV,
|
||||||
NULL, MNT_IN_CONTAINER },
|
NULL, MNT_IN_CONTAINER },
|
||||||
|
@ -228,21 +225,6 @@ int mount_setup_early(void) {
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
|
||||||
int mount_setup_late(void) {
|
|
||||||
unsigned i;
|
|
||||||
int r = 0;
|
|
||||||
|
|
||||||
for (i = 0; i < ELEMENTSOF(mount_table_late); i ++) {
|
|
||||||
int j;
|
|
||||||
|
|
||||||
j = mount_one(mount_table_late + i, false);
|
|
||||||
if (r == 0)
|
|
||||||
r = j;
|
|
||||||
}
|
|
||||||
|
|
||||||
return r;
|
|
||||||
}
|
|
||||||
|
|
||||||
int mount_cgroup_controllers(char ***join_controllers) {
|
int mount_cgroup_controllers(char ***join_controllers) {
|
||||||
_cleanup_set_free_free_ Set *controllers = NULL;
|
_cleanup_set_free_free_ Set *controllers = NULL;
|
||||||
_cleanup_fclose_ FILE *f;
|
_cleanup_fclose_ FILE *f;
|
||||||
|
|
|
@ -24,8 +24,6 @@
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
|
|
||||||
int mount_setup_early(void);
|
int mount_setup_early(void);
|
||||||
int mount_setup_late(void);
|
|
||||||
|
|
||||||
int mount_setup(bool loaded_policy);
|
int mount_setup(bool loaded_policy);
|
||||||
|
|
||||||
int mount_cgroup_controllers(char ***join_controllers);
|
int mount_cgroup_controllers(char ***join_controllers);
|
||||||
|
|
Loading…
Reference in a new issue