Skip to contentSkip to conversation

aoe: add documentation for udev users

PATCH Applied Bodo Eggert 3 participants 3 messages Jan 20, 2005 – Feb 1, 2005 1 message not in the archive Documentation

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

Review

Quoted 7 lines · Ed L Cashin
(quoted diff) +7 -0
+if test -z "$conf"; then
+        conf="`find /etc -type f -name udev.conf 2> /dev/null`"
+fi
+if test -z "$conf" || test ! -r $conf; then
+        echo "$me Error: could not find readable udev.conf in /etc" 1>&2
+        exit 1
+fi

This will fail and print
---
bash: test: etc/udev.conf: binary operator expected
---
if there is more than one udev.conf.

Fix: Always put quotes around variables.

#2 lore raw
Quoted 16 lines · Bodo Eggert

Review

Quoted 7 lines · Ed L Cashin
(quoted diff) +7 -0
+if test -z "$conf"; then
+        conf="`find /etc -type f -name udev.conf 2> /dev/null`"
+fi
+if test -z "$conf" || test ! -r $conf; then
+        echo "$me Error: could not find readable udev.conf in /etc" 1>&2
+        exit 1
+fi

This will fail and print
---
bash: test: etc/udev.conf: binary operator expected
---
if there is more than one udev.conf.

Quoted 1 line

Fix: Always put quotes around variables.

Thanks. With the changes below, it still will complain if it finds more than one udev.conf, but only if /etc/udev/udev.conf doesn't exist.

Quote all shell variables, and use /etc/udev/udev.conf if available.

Documentation/aoe/udev-install.sh +9 -5
diff -uprN a/Documentation/aoe/udev-install.sh b/Documentation/aoe/udev-install.sh
@@ -8,11 +8,15 @@ me="`basename $0`"
 # (or environment can specify where to find udev.conf)
 #
 if test -z "$conf"; then
-	conf="`find /etc -type f -name udev.conf 2> /dev/null`"
-fi
-if test -z "$conf" || test ! -r $conf; then
-	echo "$me Error: could not find readable udev.conf in /etc" 1>&2
-	exit 1
+	if test -r /etc/udev/udev.conf; then
+		conf=/etc/udev/udev.conf
+	else
+		conf="`find /etc -type f -name udev.conf 2> /dev/null`"
+		if test -z "$conf" || test ! -r "$conf"; then
+			echo "$me Error: no udev.conf found" 1>&2
+			exit 1
+		fi
+	fi
 fi
 
 # find the directory where udev rules are stored, often
Signature · 2 lines
-- 
  Ed L Cashin <[email protected]>
Applied
#3 lore raw
Quoted 20 lines · Ed L Cashin
Quoted 16 lines · Bodo Eggert

Review

Quoted 7 lines · Ed L Cashin
(quoted diff) +7 -0
+if?test?-z?"$conf";?then
+????????conf="`find?/etc?-type?f?-name?udev.conf?2>?/dev/null`"
+fi
+if?test?-z?"$conf"?||?test?!?-r?$conf;?then
+????????echo?"$me?Error:?could?not?find?readable?udev.conf?in?/etc"?1>&2
+????????exit?1
+fi

This will fail and print
---
bash: test: etc/udev.conf: binary operator expected
---
if there is more than one udev.conf.

Quoted 1 line

Fix: Always put quotes around variables.

Quoted 8 lines

Thanks. With the changes below, it still will complain if it finds more than one udev.conf, but only if /etc/udev/udev.conf doesn't exist.

Quote all shell variables, and use /etc/udev/udev.conf if available.

Applied, thanks.

greg k-h