X-Git-Url: http://gitweb.hugovil.com/?a=blobdiff_plain;f=stage1%2Fbootscripts%2Fudev;h=18baaa110b1ca74662cd7b007f51ecf89e4b665a;hb=6007645124befc70ffe2fae5500022b215d59ce6;hp=705b1603daa6acc98b30277a4fbf69e977325dee;hpb=97b938a7a341fe0d45ba4f93ce9e785b2bdc182a;p=hvlinux.git diff --git a/stage1/bootscripts/udev b/stage1/bootscripts/udev index 705b160..18baaa1 100644 --- a/stage1/bootscripts/udev +++ b/stage1/bootscripts/udev @@ -3,6 +3,10 @@ # udev # Udev cold-plugging script +DAEMON=/tools/sbin/udevd +DAEMON_DESC=UDEV +DAEMON_OPTS="--daemon" + # Source functions library source /etc/rc.d/init.d/functions @@ -11,21 +15,24 @@ log_script_name "$0 $*" udev_coldplug() { # Unlikely, but we may be faster than the first event - mkdir -p /dev/.udev/queue && + mkdir -p /dev/udev/queue && # Configure all devices - /sbin/udevadm trigger && + /tools/sbin/udevadm trigger --action=add --type=subsystems && + /tools/sbin/udevadm trigger --action=add --type=devices && # Now wait for udevd to process the uevents we triggered - /sbin/udevadm settle + /tools/sbin/udevadm settle } udev_start() { + # Udev handles uevents itself, so we don't need to have + # the kernel call out to any binary in response to them echo "" > /sys/kernel/uevent_helper && # Start the udev daemon to continually watch for, and act on uevents - /sbin/udevd --daemon + ${DAEMON} ${DAEMON_OPTS} } # See how we were called @@ -35,21 +42,14 @@ case "$1" in boot_failure "FAILURE: Unable to create devices without a SysFS filesystem." fi - # Mount a temporary file system over /dev, so that any devices - # made or removed during this boot don't affect the next one. - # The reason we don't write to mtab is because we don't ever - # want /dev to be unavailable (such as by `umount -a'). - cmd_run_log_box "Mounting /dev in tmpfs" mount -n -t tmpfs -o mode=0755 udev /dev - - cmd_run_log_box "Copying static /dev entries" cp --preserve=all --recursive --remove-destination /lib/udev/devices/* /dev - + cmd_run_log_box "Copying static /dev entries" cp --preserve=all --recursive --remove-destination /tools/lib/udev/devices/* /dev cmd_run_log_box "Setting permissons on /dev/shm" chmod 1777 /dev/shm - cmd_run_log_box_warn "Starting udevd" udev_start + cmd_run_log_box_warn "${DAEMON_DESC} start" udev_start cmd_run_log_box "Performing Coldplugging" udev_coldplug ;; - + *) echo "Usage: $0 {start}" exit ${EXIT_CODE_FAILURE}