# Map device/sector through blockdevice mappings (e.g. lvm)
-run()
+map()
{
local found
- foundm=1
+ found=1
while [ -n "$found" ]; do
found=""
- for name in "$@"; do
+ for name in $mappers; do
if detect_$name; then
found=1
if do_$name; then
done
}
+scan()
+{
+ for name in $scanners; do
+ if detect_$name; then
+ if do_$name; then
+ return
+ fi
+ fi
+ done
+}
+
###########################################################################
unset LANG
echo "device $device"
echo "sector $sector"
-run $mappers
+map
if [ -z "$noscan" ]; then
- run $scanners
+ scan
fi