+prog=udev
+ret=0
+
+# mount the devtmpfs on $udev_root, if not already done
+awk "\$2 == \"$udev_root\" && \$3 == \"devtmpfs\" { exit 1 }" /proc/mounts && {
+ submounts=$(get_dev_mounts)
+
+ if [ "$submounts" ]; then
+ # mount to temporary location to be able to move submounts
+ # this needs writable TMPDIR:-/tmp, so it won't work in early boot
+ # but fix is simple: use initramfs instead of romfs
+ devdir=$(mktemp -d ${TMPDIR:-/tmp}/tmpXXXXXX)
+ else
+ devdir=$udev_root
+ fi
+ mount -n -o mode=0755 -t devtmpfs devtmpfs "$devdir"
+ ret=$(( $ret + $? ))
+
+ # relocate submounts
+ for dir in $submounts; do
+ mount -n --move $udev_root/$dir $devdir/$dir
+ ret=$(( $ret + $? ))
+ done
+
+ if [ "$submounts" ]; then
+ mount -n --move $devdir $udev_root
+ rmdir $devdir
+ fi
+}
+
+kill_udevd > "$udev_root/null" 2>&1
+
+# Create required static device nodes for the current kernel
+create_static_nodes
+
+# Start udevd daemon
+$udevd --daemon; rc=$?
+test $rc -eq 0 && ok || fail
+ret=$(( $ret + $rc ))
+
+# Making extra nodes
+show "Setup extra nodes"; busy
+make_extra_nodes; rc=$?
+test $rc -eq 0 && ok || fail
+ret=$(( $ret + $rc ))
+
+if [ -f /sys/class/tty/console/uevent ]; then
+ # Setting default hotplug handler
+ set_hotplug_handler
+ ret=$(( $ret + $? ))
+
+ # retrigger all events
+ show "Retrigger subsystems events"; busy
+ /sbin/udevadm trigger --type=subsystems --action=add; rc=$?
+ test $rc -eq 0 && ok || fail
+ ret=$(( $ret + $rc ))
+
+ show "Retrigger devices events"; busy
+ /sbin/udevadm trigger --type=devices --action=add; rc=$?
+ test $rc -eq 0 && ok || fail
+ ret=$(( $ret + $rc ))
+
+ # wait for the events to finish
+ show "udevadm settle"; busy
+ /sbin/udevadm settle; rc=$?
+ test $rc -eq 0 && ok || fail
+ ret=$(( $ret + $rc ))
+else
+ echo "Kernel too old for this udev version"
+fi
+
+exit $ret