From 68892f5c655c9d57d0669b02fa8eca4607216605 Mon Sep 17 00:00:00 2001 From: Fabio Erculiani Date: Sun, 11 Aug 2013 11:01:32 +0200 Subject: [PATCH] linuxrc: move devmgr termination code to devmgr_terminate --- defaults/initrd.scripts | 9 +++++++++ defaults/linuxrc | 11 +++-------- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/defaults/initrd.scripts b/defaults/initrd.scripts index c068655..df95728 100644 --- a/defaults/initrd.scripts +++ b/defaults/initrd.scripts @@ -553,6 +553,15 @@ devmgr_init() { fi } +# Terminate the device manager, this happens right before pivot_root +devmgr_terminate() { + if is_udev; then + udevadm settle + udevadm control --exit || bad_msg "Unable to terminate udevd" + fi + # mdev doesn't require anything, it seems +} + mount_devfs () { # Use devtmpfs if enabled in kernel, # else tmpfs. Always run mdev just in case diff --git a/defaults/linuxrc b/defaults/linuxrc index 282af64..61eaec1 100644 --- a/defaults/linuxrc +++ b/defaults/linuxrc @@ -318,17 +318,12 @@ fi verbose_kmsg +devmgr_terminate + good_msg "Booting (initramfs)" cd "${CHROOT}" -mkdir "${CHROOT}/proc" "${CHROOT}/sys" "${CHROOT}/run" 2>/dev/null - -is_udev && udevadm settle - -if is_udev -then - udevadm control --exit || bad_msg "Unable to terminate udevd" -fi +mkdir -p "${CHROOT}/proc" "${CHROOT}/sys" "${CHROOT}/run" # If devtmpfs is mounted, try move it to the new root # If that fails, try to unmount all possible mounts of devtmpfs as stuff breaks otherwise