Imported Debian patch 2.3.1-77
[debian/makedev] / MAKEDEV
diff --git a/MAKEDEV b/MAKEDEV
index 62d6ee6e59c392286ce84024334f6c3518765836..d9224a445397c94e95e89bb8b728242caafd2deb 100644 (file)
--- a/MAKEDEV
+++ b/MAKEDEV
@@ -44,10 +44,19 @@ major_lp=6
 
 #---#---#---#---#---#---#---#---#---#---#---#---#---#---#---#---#---#---#---#
 
-# if udev is running, and we're in /dev, relocate ourselves 
-if [ -d /.dev/ ] && [ "`pwd`" = /dev ] && [ -e /proc/mounts ] \
-   && grep -qE '^[^ ]+ /\.dev' /proc/mounts; then
-       cd /.dev/
+# try to do the right things if udev is running
+if [ "$WRITE_ON_UDEV" ]; then
+  :
+elif [ -d /dev/.static/dev/ ] && [ "`pwd`" = /dev ] && [ -e /proc/mounts ] \
+    && grep -qE '^[^ ]+ /dev/\.static/dev' /proc/mounts; then
+  cd /dev/.static/dev/
+elif [ -d /.dev/ ] && [ "`pwd`" = /dev ] && [ -e /proc/mounts ] \
+    && grep -qE '^[^ ]+ /\.dev' /proc/mounts; then
+  cd /.dev/
+elif [ -d .udevdb/ ] && [ "`pwd`" = /dev ]; then
+  echo ".udevdb presence implies active udev.  Aborting MAKEDEV invocation."
+  # use exit 0, not 1, so postinst scripts don't fail on this
+  exit 0
 fi
 
 #---#---#---#---#---#---#---#---#---#---#---#---#---#---#---#---#---#---#---#
@@ -1045,7 +1054,7 @@ do
                major=`Major $arg 10` || continue
                makedev $arg    c $major 175 $video
                ;;
-       hwrandom)
+       hwrng)
                major=`Major $arg 10` || continue
                makedev $arg    c $major 183 $private
                ;;
@@ -1128,6 +1137,9 @@ do
        systrace)
                makedev systrace  c 10 226 $private
                ;;
+       uinput)
+               makedev input/uinput  c 10 223 $mouse
+               ;;
        js)
                major=`Major Joystick 13` || continue
                for unit in 0 1 2 3