public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH block-2.6] aoe status.sh: handle sysfs not in /etc/mtab
@ 2005-01-26 21:02 Ed L Cashin
  2005-02-01  7:54 ` Greg KH
  0 siblings, 1 reply; 2+ messages in thread
From: Ed L Cashin @ 2005-01-26 21:02 UTC (permalink / raw)
  To: linux-kernel; +Cc: Greg K-H

[-- Attachment #1: Type: text/plain, Size: 254 bytes --]

Suse 9.1 Pro doesn't put /sys in /etc/mtab.  This patch makes the
example aoe status.sh script work when sysfs is mounted but `mount`
doesn't mention sysfs.


aoe status.sh: handle sysfs not in /etc/mtab
Signed-off-by: Ed L. Cashin <ecashin@coraid.com>


[-- Attachment #2: diff-aoe-stat --]
[-- Type: text/plain, Size: 668 bytes --]

--- a/Documentation/aoe/status.sh
+++ b/Documentation/aoe/status.sh
@@ -4,10 +4,13 @@
 set -e
 format="%8s\t%8s\t%8s\n"
 me=`basename $0`
+sysd=${sysfs_dir:-/sys}
 
 # printf "$format" device mac netif state
 
-test -z "`mount | grep sysfs`" && {
+# Suse 9.1 Pro doesn't put /sys in /etc/mtab
+#test -z "`mount | grep sysfs`" && {
+test ! -d "$sysd/block" && {
 	echo "$me Error: sysfs is not mounted" 1>&2
 	exit 1
 }
@@ -16,7 +19,7 @@
 	exit 1
 }
 
-for d in `ls -d /sys/block/etherd* 2>/dev/null | grep -v p` end; do
+for d in `ls -d $sysd/block/etherd* 2>/dev/null | grep -v p` end; do
 	# maybe ls comes up empty, so we use "end"
 	test $d = end && continue
 




[-- Attachment #3: Type: text/plain, Size: 41 bytes --]



-- 
  Ed L Cashin <ecashin@coraid.com>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2005-02-01  7:55 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-01-26 21:02 [PATCH block-2.6] aoe status.sh: handle sysfs not in /etc/mtab Ed L Cashin
2005-02-01  7:54 ` Greg KH

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox