chiark / gitweb /
[PATCH] use udevstart for udev.init.* files.
[elogind.git] / etc / init.d / udev.init.lfs
1 #!/bin/sh
2 #
3 # LinuxFromScratch udev init script
4 #  derived from original RedHat udev init script
5 #  2003, 2004 by Michael Buesch <mbuesch@freenet.de>
6 #
7
8 . /etc/sysconfig/rc
9 . $rc_functions
10 . /etc/udev/udev.conf
11
12 sysfs_dir="/sys"
13
14 case "$1" in
15         start)
16                 echo "Creating initial udev device nodes ..."
17                 if [ ! -d $sysfs_dir ]; then
18                         echo "sysfs_dir $sysfs_dir does not exist!"
19                         print_status failure
20                         exit 1
21                 fi
22                 if [ ! -d $udev_root ]; then
23                         mkdir $udev_root
24                         if [ $? -ne 0 ]; then
25                                 print_status failure
26                                 exit 1
27                         fi
28                 fi
29
30                 # propogate /udev from /sys - we only need this while we do not
31                 # have initramfs and an early user-space with which to do early
32                 # device bring up
33                 udevstart
34                 evaluate_retval
35                 ;;
36         stop)
37                 echo "Stopping udev ..."
38                 evaluate_retval
39                 ;;
40         reload)
41                 # nothing to do here
42                 ;;
43         restart)
44                 $0 stop
45                 sleep 1
46                 $0 start
47                 ;;
48         status)
49                 if [ -d $udev_dir ]; then
50                         echo "the udev device node directory exists"
51                 else
52                         echo "the udev device node directory does not exist"
53                 fi
54                 ;;
55         *)
56                 echo "Usage: $0 {start|stop|restart|status}"
57                 exit 1
58                 ;;
59 esac
60 exit 0