#!/bin/sh # udev # Udev cold-plugging script # Source functions library source /etc/rc.d/init.d/functions log_script_name "$0 $*" 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 > /proc/sys/kernel/hotplug && # Copy static device nodes to /dev cp -a /lib/udev/devices/* /dev && # Start the udev daemon to continually watch for, and act on, # uevents /sbin/udevd --daemon && # Now traverse /sys in order to "coldplug" devices that have # already been discovered /sbin/udevtrigger && # Now wait for udevd to process the uevents we triggered /sbin/udevsettle } # See how we were called case "$1" in start) if ! grep -q '[[:space:]]sysfs' /proc/mounts; then 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'). mount -n -t tmpfs tmpfs /dev -o mode=755 if [ ${?} != 0 ]; then boot_failure "FAILURE: Cannot mount a tmpfs onto /dev." fi cmd_run_log_box_warn "Udevd start" udev_start ;; *) echo "Usage: $0 {start}" exit ${EXIT_CODE_FAILURE} ;; esac exit $?