mirror of
https://github.com/systemd/systemd.git
synced 2026-07-17 13:00:35 +00:00
61 lines
1.1 KiB
Bash
61 lines
1.1 KiB
Bash
#!/bin/sh
|
|
#
|
|
# LinuxFromScratch udev init script
|
|
# derived from original RedHat udev init script
|
|
# 2003, 2004 by Michael Buesch <mbuesch@freenet.de>
|
|
#
|
|
|
|
. /etc/sysconfig/rc
|
|
. $rc_functions
|
|
. /etc/udev/udev.conf
|
|
|
|
sysfs_dir="/sys"
|
|
|
|
case "$1" in
|
|
start)
|
|
echo "Creating initial udev device nodes ..."
|
|
if [ ! -d $sysfs_dir ]; then
|
|
echo "sysfs_dir $sysfs_dir does not exist!"
|
|
print_status failure
|
|
exit 1
|
|
fi
|
|
if [ ! -d $udev_root ]; then
|
|
mkdir $udev_root
|
|
if [ $? -ne 0 ]; then
|
|
print_status failure
|
|
exit 1
|
|
fi
|
|
fi
|
|
|
|
# propogate /udev from /sys - we only need this while we do not
|
|
# have initramfs and an early user-space with which to do early
|
|
# device bring up
|
|
udevstart
|
|
evaluate_retval
|
|
;;
|
|
stop)
|
|
echo "Stopping udev ..."
|
|
evaluate_retval
|
|
;;
|
|
reload)
|
|
# nothing to do here
|
|
;;
|
|
restart)
|
|
$0 stop
|
|
sleep 1
|
|
$0 start
|
|
;;
|
|
status)
|
|
if [ -d $udev_dir ]; then
|
|
echo "the udev device node directory exists"
|
|
else
|
|
echo "the udev device node directory does not exist"
|
|
fi
|
|
;;
|
|
*)
|
|
echo "Usage: $0 {start|stop|restart|status}"
|
|
exit 1
|
|
;;
|
|
esac
|
|
exit 0
|