summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorT(A)ILS developers <amnesia@boum.org>2010-10-20 18:33:12 +0200
committerDaniel Baumann <daniel@debian.org>2011-03-09 17:59:20 +0100
commit55f18c76f09ca7e86bb14a1b5131ced120ba8026 (patch)
treeaa0f95f98a336c610d6d491041efc787bd561a52 /scripts
parent274ce8e4e2b902e4e7b4871c284cee0285cf18a6 (diff)
downloadlive-boot-55f18c76f09ca7e86bb14a1b5131ced120ba8026.tar.gz
live-boot-55f18c76f09ca7e86bb14a1b5131ced120ba8026.zip
Enhancing devices search ordering.
E.g. prefer mounting /dev/sdb1 rather than /dev/sdb. The isohybrid feature makes both valid devices for being searched for a live filesystem image. Previous code mounted /dev/sdb on /live/image which makes it hard to create a second partition on the USB stick. This brings the need to explicitly check whether the full device is in the blacklist before even considering its subdevices: the previous blacklist checking code worked because the full device was always considered before its subdevices, which is not true anymore.
Diffstat (limited to 'scripts')
-rw-r--r--scripts/live-helpers22
1 files changed, 19 insertions, 3 deletions
diff --git a/scripts/live-helpers b/scripts/live-helpers
index 0e9b0d0..b1883ff 100644
--- a/scripts/live-helpers
+++ b/scripts/live-helpers
@@ -26,7 +26,7 @@ subdevices ()
sysblock=${1}
r=""
- for dev in "${sysblock}" "${sysblock}"/*
+ for dev in "${sysblock}"/* "${sysblock}"
do
if [ -e "${dev}/dev" ]
then
@@ -297,13 +297,21 @@ find_cow_device ()
for sysblock in $(echo /sys/block/* | tr ' ' '\n' | grep -v loop | grep -v ram | grep -v fd)
do
+ fulldevname=$(sys2dev "${sysblock}")
+
+ if echo "${black_listed_devices}" | grep -q -w "${fulldevname}"
+ then
+ # skip this device entirely
+ break
+ fi
+
for dev in $(subdevices "${sysblock}")
do
devname=$(sys2dev "${dev}")
if echo "${black_listed_devices}" | grep -q -w "${devname}"
then
- # skip this device enterely
+ # skip this subdevice
break
fi
@@ -383,6 +391,14 @@ find_files ()
for sysblock in $(echo /sys/block/* | tr ' ' '\n' | grep -v loop | grep -v ram | grep -v fd)
do
+ fulldevname=$(sys2dev "${sysblock}")
+
+ if echo "${black_listed_devices}" | grep -q -w "${fulldevname}"
+ then
+ # skip this device entirely
+ break
+ fi
+
for dev in $(subdevices "${sysblock}")
do
devname=$(sys2dev "${dev}")
@@ -390,7 +406,7 @@ find_files ()
if echo "${black_listed_devices}" | grep -q -w "${devname}"
then
- # skip this device enterely
+ # skip this subdevice
break
fi