[PATCH 01/20] 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 620b8dac4b..11890e5381 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
--------------57A0C61BE7D9EDE338E3E6C8
Content-Type: text/x-patch;
name="0002-grub-replace-PATH-to-kernel-and-grub.cfg-to-boot.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
filename*0="0002-grub-replace-PATH-to-kernel-and-grub.cfg-to-boot.patch"
More information about the devel-distro
mailing list