Commit 1babd587 authored by Anton Midyukov's avatar Anton Midyukov

grub: Added the ability to define the default menu item

Example: @$(call set,GRUB_DEFAULT,uefi-firmware) @$(call xport,GRUB_DEFAULT) See features.in/grub/cfg.in/*.cfg
parent 346e3c21
......@@ -40,6 +40,16 @@ fi
# there should be DEFAULT directive there (at least for alterator-netinst)
default_change() {
local CFG=$1
if [ -n "$GLOBAL_GRUB_DEFAULT" ]; then
if [ -n "$(grep -i "$GLOBAL_GRUB_DEFAULT" "$CFG")" ]; then
DEFAULT="$GLOBAL_GRUB_DEFAULT"
sed -i '/^default/d'
echo "default=$DEFAULT" >> "$CFG"
else
echo "error: $GLOBAL_GRUB_DEFAULT missing in $CFG" >&2
exit 1
fi
fi
if ! grep -i '^default' "$CFG"; then
DEFAULT="$(grep -i '\-\-id ' "$CFG" | head -1 | rev| cut -f2 -d' ' |rev)"
if [ -n "$DEFAULT" ]; then
......
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