[PATCH 02/22] grub: fixed search default in stage1/scripts.d/01-grub
Anton Midyukov
antohami at altlinux.org
Sun Jan 5 16:34:52 MSK 2020
The definition of the default menu item has been fixed.
Grub.cfg does not use label, uses --id.
It is assumed that --id is given last.
---
features.in/grub/stage1/scripts.d/01-grub | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/features.in/grub/stage1/scripts.d/01-grub b/features.in/grub/stage1/scripts.d/01-grub
index d331c0b016..9f87292925 100755
--- a/features.in/grub/stage1/scripts.d/01-grub
+++ b/features.in/grub/stage1/scripts.d/01-grub
@@ -24,10 +24,10 @@ fi
grep -hv '^#' .in/[0-9][0-9]*.cfg > "$CFG"
# there should be DEFAULT directive there (at least for alterator-netinst)
-if ! grep -i '^default' "$CFG"; then
- DEFAULT="$(grep -i '^label ' "$CFG" | head -1 | cut -f2 -d' ')"
+if ! grep -i '^default' .in/[0-9][0-9]*.cfg; then
+ DEFAULT="$(grep -i '\-\-id ' .in/[0-9][0-9]*.cfg | head -1 | rev| cut -f2 -d' ' |rev)"
if [ -n "$DEFAULT" ]; then
- echo "default $DEFAULT" >> "$CFG"
+ echo "default=$DEFAULT" >> "$CFG"
else
echo "error: no DEFAULT or UI directive and cannot guess" >&2
exit 1
--
2.24.1
--------------E54E3444F4BC138E1CEC79A9
Content-Type: text/x-patch;
name="0003-grub-generate-grub.cfg-for-grub-efi-ieee1275boot-and.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
filename*0="0003-grub-generate-grub.cfg-for-grub-efi-ieee1275boot-and.pa";
filename*1="tch"
More information about the devel-distro
mailing list