diff --git a/boot/grubfm/func.sh b/boot/grubfm/func.sh index 2e10a078..57bd335c 100644 --- a/boot/grubfm/func.sh +++ b/boot/grubfm/func.sh @@ -19,6 +19,16 @@ function to_g4d_path { lua ${prefix}/g4d_path.lua; } +function unmap_cd { + for dev in (cd*); + do + if [ -e ${dev} ]; + then + map -x ${dev}; + fi; + done; +} + regexp --set=1:grubfm_path '(/.*)$' "${grubfm_file}"; regexp --set=1:grubfm_dir '^(.*/).*$' "${grubfm_path}"; regexp --set=1:grubfm_device '^\(([0-9a-zA-Z,]+)\)/.*' "${grubfm_file}"; diff --git a/boot/grubfm/rules/iso/e2b.sh b/boot/grubfm/rules/iso/e2b.sh index 25d53956..c02da2f6 100644 --- a/boot/grubfm/rules/iso/e2b.sh +++ b/boot/grubfm/rules/iso/e2b.sh @@ -22,6 +22,7 @@ then partnew --type=0x00 --file="${grubfm_file}" "${grubfm_disk}" 4; if [ "$grub_platform" = "efi" ]; then + unmap_cd; map "${grubfm_file}"; elif [ "$grub_platform" = "pc" ]; then diff --git a/boot/grubfm/rules/iso/map.sh b/boot/grubfm/rules/iso/map.sh index f11ad331..b27cfc3f 100644 --- a/boot/grubfm/rules/iso/map.sh +++ b/boot/grubfm/rules/iso/map.sh @@ -2,6 +2,7 @@ source ${prefix}/func.sh; if [ "$grub_platform" = "efi" ]; then + unmap_cd; map "${grubfm_file}"; elif [ "$grub_platform" = "pc" ]; then