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.
- for dev in "${sysblock}" "${sysblock}"/*
+ for dev in "${sysblock}"/* "${sysblock}"
do
if [ -e "${dev}/dev" ]
then
do
if [ -e "${dev}/dev" ]
then
for sysblock in $(echo /sys/block/* | tr ' ' '\n' | grep -v loop | grep -v ram | grep -v fd)
do
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
for dev in $(subdevices "${sysblock}")
do
devname=$(sys2dev "${dev}")
if echo "${black_listed_devices}" | grep -q -w "${devname}"
then
- # skip this device enterely
for sysblock in $(echo /sys/block/* | tr ' ' '\n' | grep -v loop | grep -v ram | grep -v fd)
do
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}")
for dev in $(subdevices "${sysblock}")
do
devname=$(sys2dev "${dev}")
if echo "${black_listed_devices}" | grep -q -w "${devname}"
then
if echo "${black_listed_devices}" | grep -q -w "${devname}"
then
- # skip this device enterely