unify scanning block devices with the function get_devices()
Note that according to my tests, if scanning the floppy devices will occur an
error in the start of a Debian Live OS, and frequently that does not start.
diff -Naur initrd-110-7-orig.txt/scripts/live initrd.txt/scripts/live
--- initrd-110-7-orig.txt/scripts/live 2007-11-19 10:58:26.000000000 +0100
+++ initrd.txt/scripts/live 2007-11-19 12:32:24.000000000 +0100
@@ -1162,7 +1278,7 @@
fi
# or do the scan of block devices
- for sysblock in $(echo /sys/block/* | tr ' ' '\n' | grep -v loop | grep -v ram)
+ for sysblock in $(get_sysblock)
do
devname=$(sys2dev "${sysblock}")
fstype=$(get_fstype "${devname}")
diff -Naur initrd-110-7-orig.txt/scripts/live-helpers initrd.txt/scripts/live-helpers
--- initrd-110-7-orig.txt/scripts/live-helpers 2007-11-19 10:58:26.000000000 +0100
+++ initrd.txt/scripts/live-helpers 2007-11-19 12:34:54.000000000 +0100
@@ -222,10 +229,11 @@
find_cow_device ()
{
- pers_label="${1}"
- cow_backing="/${pers_label}-backing"
+ local pers_label="${1}"
+ local cow_backing="/${pers_label}-backing"
+ local sysblock dev devname
- for sysblock in $(echo /sys/block/* | tr ' ' '\n' | grep -v loop)
+ for sysblock in $(get_sysblock)
do
for dev in $(subdevices "${sysblock}")
do
@@ -258,10 +267,11 @@
# return the first of ${filenames} found on vfat and ext2/ext3 devices
# FIXME: merge with above function
- filenames="${1}"
- snap_backing="/snap-backing"
+ local filenames="${1}"
+ local snap_backing="/snap-backing"
+ local sysblock dev devname devfstype filename
- for sysblock in $(echo /sys/block/* | tr ' ' '\n' | grep -v loop)
+ for sysblock in $(get_sysblock)
do
for dev in $(subdevices "${sysblock}")
do
@@ -287,22 +297,63 @@
fi
done
done
+}
+
+get_sysblock ()
+{
+ echo /sys/block/* | tr ' ' '\n' | grep -v -e '/fd' | grep -v -e '/ram' | grep -v -e '/loop'
+ return 0
}
get_mac ()
{
_______________________________________________
debian-live-devel mailing list
[email protected]
http://lists.alioth.debian.org/mailman/listinfo/debian-live-devel