]> git.pld-linux.org Git - packages/systemd.git/commitdiff
- started work on 082
authorfreetz <freetz@pld-linux.org>
Thu, 26 Jan 2006 16:49:20 +0000 (16:49 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    start_udev -> 1.30

start_udev

index ddb9828caf6d924e40054b139d397bdbdd8ac8c7..587acbb6c59c9d43eb72accbaaac6b8d71c95667 100644 (file)
@@ -36,7 +36,6 @@ udevd_timeout=8
 prog=udev
 bin=/sbin/udev
 udevd=/sbin/udevd
-MAKEDEV="/sbin/MAKEDEV"
 
 make_extra_nodes () {
        grep '^[^#]' /etc/udev/links.conf | \
@@ -45,7 +44,6 @@ make_extra_nodes () {
            case "$type" in
                L) ln -s $arg1 $udev_root/$name ;;
                D) mkdir -p $udev_root/$name ;;
-               M) mknod --mode=600 $udev_root/$name $arg1 ;;
                *) echo "links.conf: unparseable line ($type $name $arg1)" ;;
            esac
        done
@@ -59,100 +57,17 @@ kill_udevd() {
        fi
 }
 
-# we cannot use /usr/bin/find here
-find_d () {
-       where=$1
-       what=$2
-       found=""
-       for f in $where/*; do
-               if [ -d "$f" -a ! -L "$f" ]; then
-                       if [ "$f" != "${f%%$what}" ];then 
-                               # make sure we are at the path end
-                               # we have no dirname and basename
-                               rest="${f#*$what}"
-                               [ "${rest##*/}" = "$rest" ] && found="$found $f"
-                       fi
-                       found="$found $(find_d $f $what)"
-               fi
-       done
-       echo "$found"
-}
-
-# we cannot use /usr/bin/find here
-find_f () {
-       where=$1
-       what=$2
-       found=""
-       for f in $where/*; do
-               if [ -d "$f" -a ! -L "$f" ]; then
-                       found="$found $(find_f $f $what)"
-               elif [ -e "$f" ]; then 
-                       [ "$where/" = "${f%$what}" ] && found="$found $f"
-               fi
-       done
-       [ -n "$found" ] && echo "$found"
-}
-
-# call hotplug with the scsi devices
-scsi_replay () {
-       HOTPLUG="/sbin/udevsend"
-
-       scsi_hosts=$(find_d /sys/devices host\*)
-       SEQNUM=1
-
-       for host in $scsi_hosts; do
-               [ -d $host ] || continue
-               devs=$(find_f $host type)
-               for dev in $devs;do
-                       [ -f $dev ] || continue
-                       DEVPATH=${dev%/type}
-                       DEVPATH=${DEVPATH#/sys}
-                       /bin/env -i DEVPATH="$DEVPATH" SUBSYSTEM=scsi_device ACTION=add $HOTPLUG scsi_device
-                       /bin/env -i DEVPATH="$DEVPATH" ACTION=add SUBSYSTEM=scsi $HOTPLUG scsi
-               done
-       done
-       return 0
-}
-
-ide_scan() {
-       if [ ! -d /proc/ide ]; then
-               return 1
-       fi
-       for i in /proc/ide/*/media; do
-               read media < "$i"
-               case "$media" in
-                       disk)
-                               module=ide-disk
-                       ;;
-                       cdrom)
-                               module=ide-cd
-                       ;;
-                       tape)
-                               module=ide-tape
-                       ;;
-                       floppy)
-                               module=ide-floppy
-                       ;;
-                       *)
-                               module=ide-generic
-                       ;;
-               esac
-               /sbin/modprobe $module
-       done
-       return 0
-}
-
 supported_kernel() {
-    case "$(uname -r)" in
+    if [ -f "/sys/class/tty/console/uevent" ]; then
     2.[012345].*) return 1 ;;
     esac
     return 0
 }
 
 set_hotplug_handler() {
-    echo /sbin/udevsend > /proc/sys/kernel/hotplug
+    echo "" > /proc/sys/kernel/hotplug
 }
-
+                                                                                                                                                       return 0                                             
 export ACTION=add
 prog=udev
 ret=0
@@ -161,14 +76,11 @@ busy
 
 if ! supported_kernel; then
     fail
-    echo "udev requires a kernel >= 2.6.x, not started."
-    exit 0                                                
 fi
-
 # mount the tmpfs on ${udev_root%/}, if not already done
 LANG=C awk "\$2 == \"${udev_root%/}\" && \$3 == \"tmpfs\" { exit 1 }" /proc/mounts && {
-       if LANG=C fgrep -q "none ${udev_root%/}/pts " /proc/mounts; then
-               PTSDIR=$(mktemp -d ${TMPDIR:-/tmp}/tmpXXXXXX)
+       if LANG=C fgrep -q "none ${udev_root%/}/pts " /proc/mounts; then
+               PTSDIR=$(mktemp -d ${TMPDIR:-/tmp}/tmpXXXXXX)
                mount --move $udev_root/pts "$PTSDIR"
        fi
        if LANG=C fgrep -q "none ${udev_root%/}/shm " /proc/mounts; then
@@ -190,39 +102,21 @@ LANG=C awk "\$2 == \"${udev_root%/}\" && \$3 == \"tmpfs\" { exit 1 }" /proc/moun
        ret=$(( $ret + $? ))
 }
 
-
 kill_udevd > "$udev_root/null" 2>&1
 
-scsi_replay > "$udev_root/null" 2>&1
-
-ret=$(( $ret + $? ))
-
-ide_scan > "$udev_root/null" 2>&1
-
-# Starting the hotplug events dispatcher
-/sbin/udevd --daemon
-
-# Making extra nodes
-make_extra_nodes
-
-# Setting default hotplug handler
-set_hotplug_handler
-
-# Synthesizing the initial hotplug events
-/sbin/${UDEV_STARTER}
-
-# wait for /dev to be fully populated
-while [ -d /dev/.udev/queue/ ]; do
-    sleep 0.2
-    udevd_timeout=$(($udevd_timeout - 1))
-    if [ $udevd_timeout -eq 0 ]; then
-       break
-    fi
-done
-
-# Start workaround for broken Linux input subsystem
-/lib/udev/udev_input_coldplug start
-
+if [ -f "/sys/class/tty/console/uevent" ]; then
+       # Start udevd daemon
+       udevd -d
+       
+        # Making extra nodes
+       make_extra_nodes
+       
+        # Setting default hotplug handler
+       set_hotplug_handler
+else
+    echo "udev requires a kernel >= 2.6.15, not started."
+    exit 0                                                
+fi
 ret=$(( $ret + $? ))
 [ $ret -eq 0 ] && ok || fail
 exit 0
This page took 0.203843 seconds and 4 git commands to generate.