From 17c49c165b75df29d2efaf18720c8afa89e10ac2 Mon Sep 17 00:00:00 2001 From: a1ive <10670106+a1ive@users.noreply.github.com> Date: Mon, 4 May 2020 19:52:59 +0800 Subject: [PATCH] iso: fix gpt bug --- boot/grubfm/rules/iso/e2b_test.sh | 13 ++++--------- boot/grubfm/rules/iso/loop_test.sh | 25 +++++++++++-------------- 2 files changed, 15 insertions(+), 23 deletions(-) diff --git a/boot/grubfm/rules/iso/e2b_test.sh b/boot/grubfm/rules/iso/e2b_test.sh index d6752303..35876b1a 100644 --- a/boot/grubfm/rules/iso/e2b_test.sh +++ b/boot/grubfm/rules/iso/e2b_test.sh @@ -1,17 +1,12 @@ source ${prefix}/func.sh; -probe --set=fs -f "${grubfm_device}"; -if [ "${fs}" != "fat" -a "${fs}" != "exfat" -a "${fs}" != "ntfs" ]; +if regexp 'hd[0-9]+,[msdos]*[1-3]' "${grubfm_device}"; then - return; -fi; -probe --set=partmap -p "${grubfm_device}"; -if [ "${partmap}" != "msdos" ]; -then - return; + set grubfm_test=1; fi; -if regexp 'hd[0-9]+,[a-zA-Z]*[1-3]' "${grubfm_device}"; +probe --set=partmap -p "${grubfm_device}"; +if [ "${partmap}" = "msdos" -a "${grubfm_test}" = "1" ]; then set grubfm_test=1; else diff --git a/boot/grubfm/rules/iso/loop_test.sh b/boot/grubfm/rules/iso/loop_test.sh index 374cc0fd..314446b2 100644 --- a/boot/grubfm/rules/iso/loop_test.sh +++ b/boot/grubfm/rules/iso/loop_test.sh @@ -1,19 +1,16 @@ source ${prefix}/func.sh; -if ! regexp '^hd.*' "${grubfm_device}"; +if regexp '^hd.*' "${grubfm_device}"; then - set grubfm_test=0; - return; -fi; + loopback -d loop; + loopback loop "${grubfm_file}"; + if [ -f (loop)/boot/grub/loopback.cfg ]; + then + set grubfm_test=1; + else + set grubfm_test=0; + fi; -loopback -d loop; -loopback loop "${grubfm_file}"; -if [ -f (loop)/boot/grub/loopback.cfg ]; -then - set grubfm_test=1; -else - set grubfm_test=0; + source ${prefix}/rules/iso/loop_detect.sh; + loopback -d loop; fi; - -source ${prefix}/rules/iso/loop_detect.sh; -loopback -d loop;