grub-luks2-improved-stable/0002-10_linux-detect-archlinux-initramfs.patch

63 lines
2.4 KiB
Diff
Raw Normal View History

2021-04-26 11:13:18 +02:00
From dbc289f59a2b204af19ef7212f3b6b07d3060452 Mon Sep 17 00:00:00 2001
2021-03-10 19:01:54 +01:00
From: Christian Hesse <mail@eworm.de>
2021-04-26 11:13:18 +02:00
Date: Mon, 26 Apr 2021 11:10:01 +0200
Subject: [PATCH 1/1] 10_linux: detect archlinux initramfs
2021-03-10 19:01:54 +01:00
---
2021-04-26 11:13:18 +02:00
util/grub.d/10_linux.in | 29 ++++++++++++++++++++++++++++-
1 file changed, 28 insertions(+), 1 deletion(-)
2021-03-10 19:01:54 +01:00
2014-04-07 13:01:47 +02:00
diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in
2021-04-26 11:13:18 +02:00
index e8b01c0d0..9b60af944 100644
2014-04-07 13:01:47 +02:00
--- a/util/grub.d/10_linux.in
+++ b/util/grub.d/10_linux.in
2021-04-26 11:13:18 +02:00
@@ -91,6 +91,10 @@ linux_entry ()
fi
if [ x$type != xsimple ] ; then
2014-04-07 13:01:47 +02:00
case $type in
2021-04-26 11:13:18 +02:00
+ booster)
+ title="$(gettext_printf "%s, with Linux %s (booster initramfs)" "${os}" "${version}")" ;;
2014-04-07 13:01:47 +02:00
+ fallback)
+ title="$(gettext_printf "%s, with Linux %s (fallback initramfs)" "${os}" "${version}")" ;;
2021-04-26 11:13:18 +02:00
recovery)
title="$(gettext_printf "%s, with Linux %s (recovery mode)" "${os}" "${version}")" ;;
2014-04-07 13:01:47 +02:00
*)
2021-04-26 11:13:18 +02:00
@@ -198,7 +202,7 @@ while [ "x$list" != "x" ] ; do
2014-04-07 13:01:47 +02:00
basename=`basename $linux`
dirname=`dirname $linux`
rel_dirname=`make_system_path_relative_to_its_root $dirname`
- version=`echo $basename | sed -e "s,^[^0-9]*-,,g"`
+ version=`echo $basename | sed -e "s,vmlinuz-,,g"`
alt_version=`echo $version | sed -e "s,\.old$,,g"`
linux_root_device_thisversion="${LINUX_ROOT_DEVICE}"
2021-04-26 11:13:18 +02:00
@@ -285,6 +289,29 @@ while [ "x$list" != "x" ] ; do
2014-04-07 13:01:47 +02:00
linux_entry "${OS}" "${version}" advanced \
"${GRUB_CMDLINE_LINUX} ${GRUB_CMDLINE_LINUX_DEFAULT}"
+
2014-04-07 13:01:47 +02:00
+ if test -e "${dirname}/initramfs-${version}-fallback.img" ; then
+ initrd="${initrd_early} initramfs-${version}-fallback.img"
+
2014-04-07 13:01:47 +02:00
+ if test -n "${initrd}" ; then
+ gettext_printf "Found fallback initrd image(s) in %s:%s\n" "${dirname}" "${initrd_extra} ${initrd}" >&2
2014-04-07 13:01:47 +02:00
+ fi
+
2014-04-07 13:01:47 +02:00
+ linux_entry "${OS}" "${version}" fallback \
+ "${GRUB_CMDLINE_LINUX} ${GRUB_CMDLINE_LINUX_DEFAULT}"
2014-04-07 13:01:47 +02:00
+ fi
2021-04-26 11:13:18 +02:00
+
+ if test -e "${dirname}/booster-${version}.img" ; then
+ initrd="${initrd_early} booster-${version}.img"
+
+ if test -n "${initrd}" ; then
+ gettext_printf "Found booster initrd image(s) in %s:%s\n" "${dirname}" "${initrd_extra} ${initrd}" >&2
+ fi
+
+ linux_entry "${OS}" "${version}" booster \
+ "${GRUB_CMDLINE_LINUX} ${GRUB_CMDLINE_LINUX_DEFAULT}"
+ fi
+
2014-04-07 13:01:47 +02:00
if [ "x${GRUB_DISABLE_RECOVERY}" != "xtrue" ]; then
linux_entry "${OS}" "${version}" recovery \
"single ${GRUB_CMDLINE_LINUX}"