[patch] makedev.sh - handle udev on Gentoo (/lib/udev)

View: New views
1 Messages — Rating Filter:   Alert me  

[patch] makedev.sh - handle udev on Gentoo (/lib/udev)

by Ed Santiago :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

Thanks for wish!  I've been using it daily since April 2003
and find it invaluable.

Here's a trivial little patch for makedev.sh.  Gentoo
seems to use /lib/udev/devices, not /etc.  The patch
below looks in both places.  (If both exist, it will
copy to both - weird situation, reasonable default).

Best regards, and thanks again,
^E
--
Ed Santiago               Toolsmith               ed@...




--- ./makedev.sh 2005/12/09 14:04:02 1.9
+++ ./makedev.sh 2006/12/01 15:10:19
@@ -5,6 +5,7 @@
 MAJOR_DATA=120
 MAJOR_CONTROL=121
 DIR="/dev/x10"
+UDEV_DIRS="/etc/udev/devices /lib/udev/devices"
 if [ $# -eq 3 ]
 then
  MAJOR_DATA=$1
@@ -102,11 +103,13 @@
 
 mknod $DIR/.api c $MAJOR_CONTROL 240
 
-if [ -d /etc/udev/devices ]; then
-  cp -arp $DIR /etc/udev/devices/
-  echo "*********************************************************"
-  echo "* You appear to be using udev.  A copy of the devices   *"
-  echo "* have been placed in /etc/udev/devices so that they    *"
-  echo "* automatically be created whenever the machine starts. *"
-  echo "*********************************************************"
-fi
+for udev_dir in $UDEV_DIRS; do
+  if [ -d $udev_dir ]; then
+    cp -arp $DIR $udev_dir/
+    echo "*********************************************************"
+    echo "* You appear to be using udev.  A copy of the devices   *"
+    echo "* have been placed in $udev_dir so that they    *"
+    echo "* automatically be created whenever the machine starts. *"
+    echo "*********************************************************"
+  fi
+done

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
wish-info mailing list
wish-info@...
https://lists.sourceforge.net/lists/listinfo/wish-info
LightInTheBox - Buy quality products at wholesale price