All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3] util/grub.d/linux: Improve initramfs detection
@ 2022-05-03  4:12 Oskari Pirhonen
  2022-05-17 15:30 ` Daniel Kiper
  0 siblings, 1 reply; 2+ messages in thread
From: Oskari Pirhonen @ 2022-05-03  4:12 UTC (permalink / raw)
  To: grub-devel

Add detection for initramfs of the form *.img.old. For example, Gentoo's
sys-kernel/genkernel installs it as initramfs-*.img and moves any
existing one to initramfs-*.img.old.

Apply the same scheme to initrd-*.img and initrd-*.gz files for
consistency.

Signed-off-by: Oskari Pirhonen <xxc3ncoredxx@gmail.com>
---
v2 -> v3:
- include initrd-* files in the commit message
- fix indentation to follow existing
- leave initramfs-genkernel-* on their own line

v1 -> v2:
- don't reorder the checks
- include 20_linux_xen.in

 util/grub.d/10_linux.in     | 6 ++++--
 util/grub.d/20_linux_xen.in | 6 ++++--
 2 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in
index ca068038e..b4a4d6900 100644
--- a/util/grub.d/10_linux.in
+++ b/util/grub.d/10_linux.in
@@ -215,8 +215,10 @@ while [ "x$list" != "x" ] ; do
   done
 
   initrd_real=
-  for i in "initrd.img-${version}" "initrd-${version}.img" "initrd-${version}.gz" \
-	   "initrd-${version}" "initramfs-${version}.img" \
+  for i in "initrd.img-${version}" "initrd-${version}.img" \
+	   "initrd-${alt_version}.img.old" "initrd-${version}.gz" \
+	   "initrd-${alt_version}.gz.old" "initrd-${version}" \
+	   "initramfs-${version}.img" "initramfs-${alt_version}.img.old" \
 	   "initrd.img-${alt_version}" "initrd-${alt_version}.img" \
 	   "initrd-${alt_version}" "initramfs-${alt_version}.img" \
 	   "initramfs-genkernel-${version}" \
diff --git a/util/grub.d/20_linux_xen.in b/util/grub.d/20_linux_xen.in
index f45559ff8..51a983926 100644
--- a/util/grub.d/20_linux_xen.in
+++ b/util/grub.d/20_linux_xen.in
@@ -284,8 +284,10 @@ while [ "x${xen_list}" != "x" ] ; do
 	linux_root_device_thisversion="${LINUX_ROOT_DEVICE}"
 
 	initrd_real=
-	for i in "initrd.img-${version}" "initrd-${version}.img" "initrd-${version}.gz" \
-	   "initrd-${version}" "initramfs-${version}.img" \
+	for i in "initrd.img-${version}" "initrd-${version}.img" \
+	   "initrd-${alt_version}.img.old" "initrd-${version}.gz" \
+	   "initrd-${alt_version}.gz.old" "initrd-${version}" \
+	   "initramfs-${version}.img" "initramfs-${alt_version}.img.old" \
 	   "initrd.img-${alt_version}" "initrd-${alt_version}.img" \
 	   "initrd-${alt_version}" "initramfs-${alt_version}.img" \
 	   "initramfs-genkernel-${version}" \
-- 
2.35.1



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH v3] util/grub.d/linux: Improve initramfs detection
  2022-05-03  4:12 [PATCH v3] util/grub.d/linux: Improve initramfs detection Oskari Pirhonen
@ 2022-05-17 15:30 ` Daniel Kiper
  0 siblings, 0 replies; 2+ messages in thread
From: Daniel Kiper @ 2022-05-17 15:30 UTC (permalink / raw)
  To: xxc3ncoredxx; +Cc: grub-devel

On Mon, May 02, 2022 at 11:12:56PM -0500, Oskari Pirhonen wrote:
> Add detection for initramfs of the form *.img.old. For example, Gentoo's
> sys-kernel/genkernel installs it as initramfs-*.img and moves any
> existing one to initramfs-*.img.old.
>
> Apply the same scheme to initrd-*.img and initrd-*.gz files for
> consistency.
>
> Signed-off-by: Oskari Pirhonen <xxc3ncoredxx@gmail.com>

Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>

Daniel


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-05-17 15:30 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-05-03  4:12 [PATCH v3] util/grub.d/linux: Improve initramfs detection Oskari Pirhonen
2022-05-17 15:30 ` Daniel Kiper

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.