From 138b1f8492dc2e51f5ab4325afceceaaccec1e49 Mon Sep 17 00:00:00 2001 From: Fabio Erculiani Date: Sat, 27 Jul 2013 23:42:38 +0200 Subject: [PATCH] linuxrc: move the devmgr initialization code to devmgr_init() --- defaults/initrd.scripts | 20 ++++++++++++++++++++ defaults/linuxrc | 21 +-------------------- 2 files changed, 21 insertions(+), 20 deletions(-) diff --git a/defaults/initrd.scripts b/defaults/initrd.scripts index 386ddf1..d8343cc 100644 --- a/defaults/initrd.scripts +++ b/defaults/initrd.scripts @@ -524,6 +524,26 @@ is_mdev() { return 1 } +devmgr_init() { + if is_udev; then + good_msg 'Activating udev' + echo "${UDEVD}" > /proc/sys/kernel/hotplug + echo "" > /sys/kernel/uevent_helper + "${UDEVD}" --daemon --resolve-names=never && \ + udevadm trigger --action=add && \ + udevadm settle || bad_msg "udevd failed to run" + elif is_mdev; then + good_msg 'Activating mdev' + # Serialize hotplug events + touch /dev/mdev.seq + echo "${MDEVD}" > /proc/sys/kernel/hotplug + # Ensure that device nodes are properly configured + "${MDEVD}" -s || bad_msg "mdev -s failed" + else + bad_msg "Cannot find either udev or mdev" + fi +} + 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 30b0b92..f2b44cb 100644 --- a/defaults/linuxrc +++ b/defaults/linuxrc @@ -254,26 +254,7 @@ mount_devfs mount_sysfs -# Setup hotplugging for firmware loading -if is_udev -then - good_msg 'Activating udev' - echo "${UDEVD}" > /proc/sys/kernel/hotplug - echo "" > /sys/kernel/uevent_helper - "${UDEVD}" --daemon --resolve-names=never && \ - udevadm trigger --action=add && \ - udevadm settle || bad_msg "udevd failed to run" -elif is_mdev -then - good_msg 'Activating mdev' - # Serialize hotplug events - touch /dev/mdev.seq - echo "${MDEVD}" > /proc/sys/kernel/hotplug - # Ensure that device nodes are properly configured - "${MDEVD}" -s || bad_msg "mdev -s failed" -else - bad_msg "Cannot find either udev or mdev" -fi +devmgr_init splash_init