summaryrefslogtreecommitdiffstats
path: root/rescue/Flash
diff options
context:
space:
mode:
authorOlivier Blin <oblin@mandriva.com>2007-07-05 14:52:06 +0000
committerOlivier Blin <oblin@mandriva.com>2007-07-05 14:52:06 +0000
commita4fcd7c7353cbf03bd6d5304314bfcdfeca5c03c (patch)
treea6f869decfe494cc23d9f04fc4a3ad5a871bb3ff /rescue/Flash
parent3f6173e1fc72a1627a6767de156ed0a5cb5e4a3c (diff)
downloaddrakx-backup-do-not-use-a4fcd7c7353cbf03bd6d5304314bfcdfeca5c03c.tar
drakx-backup-do-not-use-a4fcd7c7353cbf03bd6d5304314bfcdfeca5c03c.tar.gz
drakx-backup-do-not-use-a4fcd7c7353cbf03bd6d5304314bfcdfeca5c03c.tar.bz2
drakx-backup-do-not-use-a4fcd7c7353cbf03bd6d5304314bfcdfeca5c03c.tar.xz
drakx-backup-do-not-use-a4fcd7c7353cbf03bd6d5304314bfcdfeca5c03c.zip
introduce has_label() function
Diffstat (limited to 'rescue/Flash')
-rw-r--r--rescue/Flash/scripts/rescue_common23
1 files changed, 16 insertions, 7 deletions
diff --git a/rescue/Flash/scripts/rescue_common b/rescue/Flash/scripts/rescue_common
index d09a3de1c..676a955da 100644
--- a/rescue/Flash/scripts/rescue_common
+++ b/rescue/Flash/scripts/rescue_common
@@ -1,22 +1,31 @@
#!/bin/bash
function detect_version() {
+ if has_label Share; then
+ version="1.0"
+ else
+ version="1.05"
+ fi
+}
+
+function has_label() {
+ local _label _tmpdir
+ _label=$1
_tmpdir="/tmp/$$"
mkdir -p $_tmpdir
nash --force > /dev/null 2>&1 <<EOF
-mount -t vfat LABEL=Share $_tmpdir
+mount -t vfat LABEL=$_label $_tmpdir
EOF
- if [ $? -eq 0 ]; then
- version="1.0"
- else
- version="1.05"
- fi
-
+
+ rc=$?
+
umount $_tmpdir 2> /dev/null
rmdir $_tmpdir 2> /dev/null
+
+ return $rc
}
function check_vendor() {