grub-config: Fix paths of default linux

master
BodgeMaster 2023-06-21 07:26:51 +02:00
parent ce19ca2f1a
commit 2b4b7f4b1a
1 changed files with 2 additions and 0 deletions

View File

@ -11,12 +11,14 @@ if [ ! -f "$DEFAULT_LINUX" ]; then
# in cases where its a .gz or .xz or whatever
DEFAULT_LINUX=$(find /boot -type l -name "vmlinu*" 2>/dev/null | sort | head -n1)
fi
DEFAULT_LINUX="$(sed 's|^/boot/||' <<< "$DEFAULT_LINUX")"
DEFAULT_INITRAMFS=/boot/initramfs.img
if [ ! -f "$DEFAULT_INITRAMFS" ]; then
# hope to find anything named initramfs or initrd
DEFAULT_INITRAMFS=$(find /boot -type l -name "init*" 2>/dev/null | sort | head -n1)
fi
DEFAULT_INITRAMFS="$(sed 's|^/boot/||' <<< "$DEFAULT_INITRAMFS")"
function make_menuentry {
# $1 is the kernel path