>From 63c0b2e2da50c7e16cd7b70ed8a8268939ef4e50 Mon Sep 17 00:00:00 2001 From: Anton Midyukov Date: Sun, 5 Jan 2020 20:34:52 +0700 Subject: [PATCH 02/22] grub: fixed search default in stage1/scripts.d/01-grub 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