Commit 80e83624 authored by Anton Midyukov's avatar Anton Midyukov

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.
parent b9e5244e
...@@ -24,10 +24,10 @@ fi ...@@ -24,10 +24,10 @@ fi
grep -hv '^#' .in/[0-9][0-9]*.cfg > "$CFG" grep -hv '^#' .in/[0-9][0-9]*.cfg > "$CFG"
# there should be DEFAULT directive there (at least for alterator-netinst) # there should be DEFAULT directive there (at least for alterator-netinst)
if ! grep -i '^default' "$CFG"; then if ! grep -i '^default' .in/[0-9][0-9]*.cfg; then
DEFAULT="$(grep -i '^label ' "$CFG" | head -1 | cut -f2 -d' ')" DEFAULT="$(grep -i '\-\-id ' .in/[0-9][0-9]*.cfg | head -1 | rev| cut -f2 -d' ' |rev)"
if [ -n "$DEFAULT" ]; then if [ -n "$DEFAULT" ]; then
echo "default $DEFAULT" >> "$CFG" echo "default=$DEFAULT" >> "$CFG"
else else
echo "error: no DEFAULT or UI directive and cannot guess" >&2 echo "error: no DEFAULT or UI directive and cannot guess" >&2
exit 1 exit 1
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment