Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/configs/baseline/grub
diff options
context:
space:
mode:
authornl6720 <nl6720@gmail.com>2023-01-28 14:04:15 +0200
committernl6720 <nl6720@gmail.com>2023-02-22 18:28:28 +0200
commitf7502001b0e538bd443cb7ab82539f5aaa7afddb (patch)
treebda1ba1917479ba56aec0d81173ef5e9d3b46735 /configs/baseline/grub
parentb94d7c4ce5afdec032835378a7f6c564aecb05ed (diff)
configs/*/grub/grub.cfg: reuse ARCHISO_HINT and ARCHISO_UUID passed from the embedded grub.cfg
The `grub.cfg` embedded in the GRUB binaries already sets `ARCHISO_HINT` and `ARCHISO_UUID` in most cases. To avoid performing the same searches multiple times, use the existing variables.
Diffstat (limited to 'configs/baseline/grub')
-rw-r--r--configs/baseline/grub/grub.cfg10
1 files changed, 7 insertions, 3 deletions
diff --git a/configs/baseline/grub/grub.cfg b/configs/baseline/grub/grub.cfg
index d606b10..e855ea9 100644
--- a/configs/baseline/grub/grub.cfg
+++ b/configs/baseline/grub/grub.cfg
@@ -25,9 +25,13 @@ if serial --unit=0 --speed=115200; then
fi
# Search for the ISO volume
-regexp --set=1:ARCHISO_HINT '^\(([^)]+)\)' "${cmdpath}"
-search --no-floppy --set=root --file '/.disk/%UUID_SEARCH_FILENAME%.uuid' --hint "${ARCHISO_HINT}"
-probe --set ARCHISO_UUID --fs-uuid "${root}"
+if [ -z "${ARCHISO_UUID}" ]; then
+ if [ -z "${ARCHISO_HINT}" ]; then
+ regexp --set=1:ARCHISO_HINT '^\(([^)]+)\)' "${cmdpath}"
+ fi
+ search --no-floppy --set=root --file '/.disk/%UUID_SEARCH_FILENAME%.uuid' --hint "${ARCHISO_HINT}"
+ probe --set ARCHISO_UUID --fs-uuid "${root}"
+fi
# Set default menu entry
default=archlinux