Broken grub config generation with initrd in new 09_slackware_linux
by kaott from LinuxQuestions.org on (#6NSCH)
Howdy,
The new 09_slackware_linux grub script generates broken configs with initrds on my machines, which cause them to not boot.
The problme seems to be that it generates a full path to the initrd.gz file instead of a relative one.
That is:
initrd /boot/initrd.gz
instead of
initrd /initrd.gz
Here is a potential patch:
Code:--- 09_slackware_linux.backup 2024-06-25 15:27:05.713030818 -0700
+++ /etc/grub.d/09_slackware_linux 2024-06-25 15:48:23.264154959 -0700
@@ -92,7 +92,7 @@
if test -n "${initrd}" ; then
cat << EOF
echo $(gettext "Loading initial ramdisk ...")
- initrd ${initrd}
+ initrd ${rel_dirname}/${initrd}
EOF
fi
cat << EOF
@@ -133,9 +133,9 @@
${GRUB_EARLY_INITRD_LINUX_CUSTOM}; do
if [ -e "${dirname}/${i}" ]; then
if [ -z "$initrd" ]; then
- initrd="${dirname}/$i"
+ initrd="$i"
else
- initrd="$initrd ${dirname}/$i"
+ initrd="$initrd $i"
fi
fi
done
@@ -147,9 +147,9 @@
if [ -e "${dirname}/${i}" ]; then
actual_initrd="true"
if [ -z "$initrd" ]; then
- initrd="${dirname}/$i"
+ initrd="$i"
else
- initrd="$initrd ${dirname}/$i"
+ initrd="$initrd $i"
fi
break
fi
The new 09_slackware_linux grub script generates broken configs with initrds on my machines, which cause them to not boot.
The problme seems to be that it generates a full path to the initrd.gz file instead of a relative one.
That is:
initrd /boot/initrd.gz
instead of
initrd /initrd.gz
Here is a potential patch:
Code:--- 09_slackware_linux.backup 2024-06-25 15:27:05.713030818 -0700
+++ /etc/grub.d/09_slackware_linux 2024-06-25 15:48:23.264154959 -0700
@@ -92,7 +92,7 @@
if test -n "${initrd}" ; then
cat << EOF
echo $(gettext "Loading initial ramdisk ...")
- initrd ${initrd}
+ initrd ${rel_dirname}/${initrd}
EOF
fi
cat << EOF
@@ -133,9 +133,9 @@
${GRUB_EARLY_INITRD_LINUX_CUSTOM}; do
if [ -e "${dirname}/${i}" ]; then
if [ -z "$initrd" ]; then
- initrd="${dirname}/$i"
+ initrd="$i"
else
- initrd="$initrd ${dirname}/$i"
+ initrd="$initrd $i"
fi
fi
done
@@ -147,9 +147,9 @@
if [ -e "${dirname}/${i}" ]; then
actual_initrd="true"
if [ -z "$initrd" ]; then
- initrd="${dirname}/$i"
+ initrd="$i"
else
- initrd="$initrd ${dirname}/$i"
+ initrd="$initrd $i"
fi
break
fi