--- grub-2.12/util/grub.d/10_linux.in.orig 2023-12-23 20:04:08.760546100 +0100 +++ grub-2.12/util/grub.d/10_linux.in 2023-12-23 20:09:01.621915577 +0100 @@ -295,14 +295,33 @@ # TRANSLATORS: %s is replaced with an OS name echo "submenu '$(gettext_printf "Advanced options for %s" "${OS}" | grub_quote)' \$menuentry_id_option 'gnulinux-advanced-$boot_device_id' {" is_top_level=false + else + linux_entry "${OS}" "${version}" default \ + "${GRUB_CMDLINE_LINUX} ${GRUB_CMDLINE_LINUX_DEFAULT}" fi - linux_entry "${OS}" "${version}" advanced \ - "${GRUB_CMDLINE_LINUX} ${GRUB_CMDLINE_LINUX_DEFAULT}" + linux_entry "${OS} (with debug messages)" "${version}" debug \ + "${GRUB_CMDLINE_LINUX} debug" + if [ "x${GRUB_DISABLE_RECOVERY}" != "xtrue" ]; then linux_entry "${OS}" "${version}" recovery \ "${GRUB_CMDLINE_LINUX_RECOVERY} ${GRUB_CMDLINE_LINUX}" fi + + initrd= + for i in "initramfs-${version}-failsafe.img.gz" "initramfs-${alt_version}-failsafe.img.gz" \ + "initramfs-${version}-failsafe.img" "initramfs-${alt_version}-failsafe.img" \ + "initramfs-${version}-failsafe.cpio.gz" "initramfs-${alt_version}-failsafe.cpio.gz"; do + if test -e "${dirname}/${i}" ; then + initrd="$i" + break + fi + done + if test -n "${initrd}" ; then + gettext_printf "Found initrd image: %s\n" "${dirname}/${initrd}" >&2 + linux_entry "${OS} (failsafe)" "${version}" advanced \ + "rddebug splash selinux=0 ${GRUB_CMDLINE_LINUX_DEFAULT}" + fi done # If at least one kernel was found, then we need to