Commit cd7bf027 authored by Anton Midyukov's avatar Anton Midyukov

grub: fix selection by default install2, if GRUB_DEFAULT is not set

Top item is no need to set a default. Also, this is no longer possible, as some items are not available for all grub variants.
parent 137428c5
......@@ -33,14 +33,8 @@ if [ -n "$GLOBAL_GRUB_DEFAULT" ]; then
echo "error: $GLOBAL_GRUB_DEFAULT missing in $CFG" >&2
exit 1
fi
elif [ -n "$(grep -i "--id 'linux'" "$CFG")" ]; then
DEFAULT=linux
else
DEFAULT="$(grep -i '\-\-id ' "$CFG" | head -1 | rev| cut -f2 -d' ' |rev)"
if [ -z "$DEFAULT" ]; then
echo "error: no DEFAULT or UI directive and cannot guess for $CFG" >&2
exit 1
fi
grep -i '\-\-id ' "$CFG" | grep 'linux' && DEFAULT=linux
fi
sed -i "s/@default_id@/$DEFAULT/" "$CFG"
}
......
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