integrate-distro.sh: Add support for /dev/loopXXX

Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
Jan Lindemann 2016-11-01 11:22:35 +00:00
commit 2366ce571c

View file

@ -473,7 +473,8 @@ get_opts()
shift
;;
-w)
cwd=$2
cwd="$2"
cd "$cwd"
shift
;;
-s)
@ -499,6 +500,12 @@ log()
echo $@ >&2
}
fatal()
{
log $@
exit 1
}
run()
{
local exit_on_error=0
@ -1297,8 +1304,13 @@ fi
if [ "$install_dev" ]; then
tmp=`realpath "$install_dev"`
[ -b "$tmp" ] || fatal "device \"$install_dev\" is not a link to a block device"
install_dev="$tmp"
case $install_dev in
/dev/sd*) part_sep="";;
/dev/loop*) part_sep="";;
/dev/nbd*) part_sep="p";;
esac
@ -1314,9 +1326,11 @@ if [ "$install_dev" ]; then
/dev/sde) install_grub_dev_num=4;;
/dev/nbd*)
install_grub_dev_num=${d/\/dev\/nbd/};;
/dev/loop*)
install_grub_dev_num=0;;
*)
log "device \"$install_dev\" can't be mapped onto a grub device number, edit $myname to add support"
exit 1;;
fatal "device \"$install_dev\" can't be mapped onto a grub device number, edit $myname to add support"
;;
esac
run_dev=/dev/sda