diff options
Diffstat (limited to 'extras')
-rw-r--r-- | extras/ide-devfs.sh | 12 | ||||
-rw-r--r-- | extras/scsi-devfs.sh | 4 | ||||
-rw-r--r-- | extras/start_udev | 2 |
3 files changed, 8 insertions, 10 deletions
diff --git a/extras/ide-devfs.sh b/extras/ide-devfs.sh index 4d021c5e87..4f20259480 100644 --- a/extras/ide-devfs.sh +++ b/extras/ide-devfs.sh @@ -15,15 +15,13 @@ else fi get_dev_number() { - local x= - local num=0 - local MEDIA= - local DRIVE="${1%%[0-9]*}" + num=0 + DRIVE="${1%%[0-9]*}" for x in /proc/ide/*/media; do if [ -e "${x}" ]; then - MEDIA=`cat ${x}` - if [ "${MEDIA}" = "$2" ]; then + lMEDIA=`cat ${x}` + if [ "${lMEDIA}" = "$2" ]; then num=$((${num} + 1)) fi if [ "${x}" = "/proc/ide/${DRIVE}/media" ]; then @@ -35,7 +33,7 @@ get_dev_number() { echo $((${num} - 1)) } -if [ -z "$3" -a -f /proc/ide/${1}/media ]; then +if [ -z "$3" ] && [ -f /proc/ide/${1}/media ]; then MEDIA=`cat /proc/ide/${1}/media` if [ "${MEDIA}" = "cdrom" ]; then echo ide/host${HOST}/bus${BUS}/target${TARGET}/lun0/cd cdroms/cdrom`get_dev_number $1 cdrom` diff --git a/extras/scsi-devfs.sh b/extras/scsi-devfs.sh index 30f4553a5b..12c8aa8eb5 100644 --- a/extras/scsi-devfs.sh +++ b/extras/scsi-devfs.sh @@ -14,7 +14,7 @@ # BUS="scsi", KERNEL="sg*", PROGRAM="/etc/udev/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 -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 @@ -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}" -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 diff --git a/extras/start_udev b/extras/start_udev index 4908d05b70..bbf32a1bb9 100644 --- a/extras/start_udev +++ b/extras/start_udev @@ -1,4 +1,4 @@ -#! /bin/bash +#! /bin/sh # # start_udev # |