[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1362087602-8979-9-git-send-email-joern@logfs.org>
Date: Thu, 28 Feb 2013 16:40:01 -0500
From: Joern Engel <joern@...fs.org>
To: linux-kernel@...r.kernel.org
Cc: Andrew Morton <akpm@...ux-foundation.org>,
Borislav Petkov <bp@...en8.de>, Jeff Moyer <jmoyer@...hat.com>,
Takashi Iwai <tiwai@...e.de>, Joern Engel <joern@...fs.org>
Subject: [PATCH 8/9] blockconsole: Allow to pass a device file path to bcon_tail
From: Takashi Iwai <tiwai@...e.de>
... instead of always looking through all devices.
Minor tweak: Moved the "CANDIDATES=" line below Takashi's new code.
Signed-off-by: Takashi Iwai <tiwai@...e.de>
Signed-off-by: Joern Engel <joern@...fs.org>
---
Documentation/block/blockconsole/bcon_tail | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/Documentation/block/blockconsole/bcon_tail b/Documentation/block/blockconsole/bcon_tail
index eb3524b..70926c6 100755
--- a/Documentation/block/blockconsole/bcon_tail
+++ b/Documentation/block/blockconsole/bcon_tail
@@ -58,6 +58,21 @@ end_of_log() {
# HEADER contains a newline, so the funny quoting is necessary
HEADER='
Linux blockconsole version 1.1'
+
+DEV="$1"
+if [ -n "$DEV" ]; then
+ if [ ! -b "$DEV" ]; then
+ echo "bcon_tail: No block device file $DEV"
+ exit 1
+ fi
+ if [ "`head -c32 $DEV`" != "$HEADER" ]; then
+ echo "bcon_tail: Invalid device file $DEV"
+ exit 1
+ fi
+ end_of_log $DEV
+ exit 0
+fi
+
CANDIDATES=`lsscsi |sed 's|.*/dev|/dev|'`
for DEV in $CANDIDATES; do
--
1.7.10.4
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists