Magellan Linux

Diff of /tags/udev-185-r1/udev.rc

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1087 by niro, Wed Aug 18 00:57:31 2010 UTC revision 1725 by niro, Mon Apr 2 13:08:49 2012 UTC
# Line 30  populate_udev() Line 30  populate_udev()
30   echo CONSOLE=${CONSOLE} > /dev/.udev_populate   echo CONSOLE=${CONSOLE} > /dev/.udev_populate
31    
32   # populate /dev with devices already found by the kernel   # populate /dev with devices already found by the kernel
33   echo -e ${COLOREDSTAR}"  Populating /dev with existing devices through uevents ..."   rc_print "  Populating /dev with existing devices through uevents ..."
34   if [[ ${RC_COLDPLUG} = yes ]]   if [[ ${RC_COLDPLUG} = yes ]]
35   then   then
36   /sbin/udevadm trigger   /sbin/udevadm trigger
# Line 47  populate_udev() Line 47  populate_udev()
47   evaluate_retval   evaluate_retval
48    
49   # loop until everything is finished   # loop until everything is finished
50   echo -e ${COLOREDSTAR}"  Letting udev process events ..."   rc_print "  Letting udev process events ..."
51   /sbin/udevadm settle --timeout=60   /sbin/udevadm settle --timeout=60
52   evaluate_retval   evaluate_retval
53    
# Line 61  populate_udev() Line 61  populate_udev()
61  seed_dev()  seed_dev()
62  {  {
63   # seed /dev with some things that we know we need   # seed /dev with some things that we know we need
64   echo -e ${COLOREDSTAR}"  Seeding /dev with needed nodes ..."   rc_print "  Seeding /dev with needed nodes ..."
65   (   (
66   [ ! -c /dev/console ] && mknod /dev/console c 5 1   [ ! -c /dev/console ] && mknod /dev/console c 5 1
67   [ ! -c /dev/tty1 ] && mknod /dev/tty1 c 4 1   [ ! -c /dev/tty1 ] && mknod /dev/tty1 c 4 1
# Line 96  start_devicemanager() Line 96  start_devicemanager()
96   [ -c /dev/console ] ; need_redirect=$?   [ -c /dev/console ] ; need_redirect=$?
97    
98   # create a ramdisk for populating udev   # create a ramdisk for populating udev
99   echo -e ${COLOREDSTAR}"Mounting udev at /dev ..."   if [[ -z $(grep '[[:space:]]/dev[[:space:]]' /proc/mounts | cut -d ' ' -f2) ]]
100   # many video drivers needed exec access   then
101   fstype=ramfs   rc_print "Mounting udev at /dev ..."
102   # tmpfs was suggested by Greg Kroah-Hartman   # many video drivers needed exec access
103   kernel_supports_fs tmpfs && fstype=tmpfs   fstype=ramfs
104   # mount devtmpfs if supported   # tmpfs was suggested by Greg Kroah-Hartman
105   kernel_supports_fs devtmpfs && fstype=devtmpfs   kernel_supports_fs tmpfs && fstype=tmpfs
106   mount -n -t ${fstype} udev /dev -o exec,nosuid,mode=0755,size=10M   # mount devtmpfs if supported
107   evaluate_retval   kernel_supports_fs devtmpfs && fstype=devtmpfs
108     mount -n -t ${fstype} dev /dev -o exec,nosuid,mode=0755,size=10M
109     evaluate_retval
110     fi
111    
112   # if a device tarball exists load it and if it is activated   # if a device tarball exists load it and if it is activated
113   echo -e ${COLOREDSTAR}"Configurating system to use udev ..."   rc_print "Configurating system to use udev ..."
114   if [[ ${RC_DEVICE_TARBALL} = yes ]]   if [[ ${RC_DEVICE_TARBALL} = yes ]]
115   then   then
116   echo -e ${COLOREDSTAR}"  Populating /dev with saved device nodes ..."   rc_print "  Populating /dev with saved device nodes ..."
117   tar -jxpf /lib/udev/state/devices.tar.bz2 -C /dev   tar -jxpf /lib/udev/state/devices.tar.bz2 -C /dev
118   evaluate_retval   evaluate_retval
119   fi   fi
120    
121   # other eeded device nodes with udev   # other needed device nodes with udev
122   seed_dev   seed_dev
123    
124   if [ -e /proc/sys/kernel/hotplug ]   if [ -e /proc/sys/kernel/hotplug ]
125   then   then
126   echo -e ${COLOREDSTAR}"  Using netlink for hotplug events ..."   rc_print "  Using netlink for hotplug events ..."
127   echo "" > /proc/sys/kernel/hotplug   echo "" > /proc/sys/kernel/hotplug
128   evaluate_retval   evaluate_retval
129   else   else
130   echo -e ${COLOREDSTAR}${COLYELLOW}"  Kernel was not compiled with hotplug support !"   rc_print ${COLYELLOW}"  Kernel was not compiled with hotplug support !"
131   print_status failure   print_status failure
132   fi   fi
133    
# Line 134  start_devicemanager() Line 137  start_devicemanager()
137   modprobe -q unix 2>/dev/null   modprobe -q unix 2>/dev/null
138   fi   fi
139    
140   echo -e ${COLOREDSTAR}"  Starting udevd daemon ..."   rc_print "  Starting udevd daemon ..."
141   if [ ${need_redirect} -eq 1 ]   if [ ${need_redirect} -eq 1 ]
142   then   then
143   # we need to open fds 0 1 2   # we need to open fds 0 1 2
# Line 150  start_devicemanager() Line 153  start_devicemanager()
153   populate_udev   populate_udev
154    
155   # create nodes that udev can't   # create nodes that udev can't
156   echo -e ${COLOREDSTAR}"  Finializing udev configuration ..."   rc_print "  Finializing udev configuration ..."
157   [[ -x /sbin/dmsetup ]] && /sbin/dmsetup mknodes &>/dev/null   [[ -x /sbin/dmsetup ]] && /sbin/dmsetup mknodes &>/dev/null
158   [[ -x /sbin/lvm ]] && /sbin/lvm vgscan -P --mknodes --ignorelockingfailure &>/dev/null   [[ -x /sbin/lvm ]] && /sbin/lvm vgscan -P --mknodes --ignorelockingfailure &>/dev/null
159   [[ -x /sbin/evms_activate ]] && /sbin/evms_activate -q &>/dev/null   [[ -x /sbin/evms_activate ]] && /sbin/evms_activate -q &>/dev/null
# Line 162  start_devicemanager() Line 165  start_devicemanager()
165    
166  stop_devicemanager()  stop_devicemanager()
167  {  {
168   echo -e ${COLOREDSTAR}"Stopping udevd daemon ..."   rc_print "Stopping udevd daemon ..."
169   start-stop-daemon --stop --exec /sbin/udevd   start-stop-daemon --stop --exec /sbin/udevd
170   evaluate_retval   evaluate_retval
171  }  }

Legend:
Removed from v.1087  
changed lines
  Added in v.1725