chiark / gitweb /
add "Persistent Device Naming" rules file for disks
[elogind.git] / extras / scsi-devfs.sh
index 30f4553a5bc29c38de565e633361415383a4d436..b1a17cb21ef7d1b3a322c5a742231a3cd06f9268 100644 (file)
@@ -8,13 +8,13 @@
 #
 # return devfs-names for scsi-devices
 # Usage in udev.rules:
 #
 # return devfs-names for scsi-devices
 # Usage in udev.rules:
-# BUS="scsi", KERNEL="sd*", PROGRAM="/etc/udev/scsi-devfs.sh sd %b %n", NAME="%c{1}", SYMLINK="%c{2} %k %c{3} %c{4}"
-# BUS="scsi", KERNEL="sr*", PROGRAM="/etc/udev/scsi-devfs.sh sr %b %n", NAME="%c{1}", SYMLINK="%c{2} %k %c{3} %c{4}"
-# BUS="scsi", KERNEL="st*", PROGRAM="/etc/udev/scsi-devfs.sh st %b %n", NAME="%c{1}", SYMLINK="%c{2} %k %c{3} %c{4}"
-# BUS="scsi", KERNEL="sg*", PROGRAM="/etc/udev/scsi-devfs.sh sg %b %n", NAME="%c{1}", SYMLINK="%c{2} %k %c{3} %c{4}"
+# BUS="scsi", KERNEL="sd*", PROGRAM="/etc/udev/scripts/scsi-devfs.sh sd %b %n", NAME="%c{1}", SYMLINK="%c{2} %k %c{3} %c{4}"
+# BUS="scsi", KERNEL="sr*", PROGRAM="/etc/udev/scripts/scsi-devfs.sh sr %b %n", NAME="%c{1}", SYMLINK="%c{2} %k %c{3} %c{4}"
+# BUS="scsi", KERNEL="st*", PROGRAM="/etc/udev/scripts/scsi-devfs.sh st %b %n", NAME="%c{1}", SYMLINK="%c{2} %k %c{3} %c{4}"
+# BUS="scsi", KERNEL="sg*", PROGRAM="/etc/udev/scripts/scsi-devfs.sh sg %b %n", NAME="%c{1}", SYMLINK="%c{2} %k %c{3} %c{4}"
 
 # Find out where sysfs is mounted. Exit if not available
 
 # Find out where sysfs is mounted. Exit if not available
-sysfs=`fgrep sysfs /proc/mounts | awk '{print $2}'`
+sysfs=`grep -F sysfs /proc/mounts | awk '{print $2}'`
 if [ "$sysfs" = "" ]; then
     echo "sysfs is required"
     exit 1
 if [ "$sysfs" = "" ]; then
     echo "sysfs is required"
     exit 1
@@ -63,7 +63,7 @@ s_com="b${scsi_bus}t${scsi_target}u${scsi_lun}$spart"
 l_log="scsi/host$scsi_host/$l_com"
 s_log="$1/c${scsi_host}${s_com}"
 
 l_log="scsi/host$scsi_host/$l_com"
 s_log="$1/c${scsi_host}${s_com}"
 
-readlink $2 | fgrep -q pci
+readlink $2 | grep -F -q pci
 if [ "$?" != "0" ]; then
     # Not a PCI controller, show logical locations only
     echo $l_log $s_log
 if [ "$?" != "0" ]; then
     # Not a PCI controller, show logical locations only
     echo $l_log $s_log