public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Ed L Cashin <ecashin@coraid.com>
To: linux-kernel <linux-kernel@vger.kernel.org>
Cc: Greg K-H <greg@kroah.com>
Subject: [PATCH block-2.6] aoe status.sh: handle sysfs not in /etc/mtab
Date: Wed, 26 Jan 2005 16:02:02 -0500	[thread overview]
Message-ID: <878y6fzyyd.fsf@coraid.com> (raw)

[-- 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>

             reply	other threads:[~2005-01-27  1:14 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-01-26 21:02 Ed L Cashin [this message]
2005-02-01  7:54 ` [PATCH block-2.6] aoe status.sh: handle sysfs not in /etc/mtab Greg KH

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=878y6fzyyd.fsf@coraid.com \
    --to=ecashin@coraid.com \
    --cc=greg@kroah.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox