From dfd4d7dd433ce692d43dce4a2e2ab81fba7c3159 Mon Sep 17 00:00:00 2001 From: edgood1 Date: Sat, 1 Mar 2025 14:23:18 -0500 Subject: [PATCH] when multiple kernels and initrds exist, use the latest --- templates/debian.Dockerfile | 4 ++-- templates/ubuntu.Dockerfile | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/templates/debian.Dockerfile b/templates/debian.Dockerfile index 5d8b036..0443523 100644 --- a/templates/debian.Dockerfile +++ b/templates/debian.Dockerfile @@ -71,8 +71,8 @@ RUN DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends cr # needs to be after update-initramfs {{- if not .Grub }} -RUN mv $(find /boot -name 'vmlinuz-*') /boot/vmlinuz && \ - mv $(find /boot -name 'initrd.img-*') /boot/initrd.img +RUN mv $(ls -t /boot/vmlinuz-* | head -n 1) /boot/vmlinuz && \ + mv $(ls -t /boot/initrd.img-* | head -n 1) /boot/initrd.img {{- end }} RUN apt-get clean && \ diff --git a/templates/ubuntu.Dockerfile b/templates/ubuntu.Dockerfile index 1589379..f5db285 100644 --- a/templates/ubuntu.Dockerfile +++ b/templates/ubuntu.Dockerfile @@ -62,8 +62,8 @@ RUN DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends cr # needs to be after update-initramfs {{- if not .Grub }} -RUN mv $(find /boot -name 'vmlinuz-*') /boot/vmlinuz && \ - mv $(find /boot -name 'initrd.img-*') /boot/initrd.img +RUN mv $(ls -t /boot/vmlinuz-* | head -n 1) /boot/vmlinuz && \ + mv $(ls -t /boot/initrd.img-* | head -n 1) /boot/initrd.img {{- end }} RUN apt-get clean && \