From 425fe5a7f0622336a8c0b2f66215c2c969c81abf Mon Sep 17 00:00:00 2001 From: Jordan Pryde Date: Sat, 13 Apr 2024 14:40:22 -0700 Subject: [PATCH] Even better test the modules deletion pipeline Now works when there's only one directory in modules (matching the kernel) and when kernels are substrings of each other --- config/scripts/regen-initramfs.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/config/scripts/regen-initramfs.sh b/config/scripts/regen-initramfs.sh index e5943e3..2f5eda6 100644 --- a/config/scripts/regen-initramfs.sh +++ b/config/scripts/regen-initramfs.sh @@ -2,9 +2,10 @@ set -oue pipefail KVER="$(rpm -q kernel | sed -rn 's/^kernel-(.*)$/\1/p')" -ls -1 /usr/lib/modules | grep -vZ "$KVER" | sed -z 's/[[:space:]]*$//' \ - | xargs -0 -- printf "/usr/lib/modules/%s\0" \ - | xargs -0 -- rm -rf +ls -1 --zero /usr/lib/modules | grep -vz "^$KVER$" \ + | sed -z 's/[[:space:]]*$//' \ + | xargs -r -0 -- printf "/usr/lib/modules/%s\0" \ + | xargs -r -0 -- rm -rf mkdir -p /tmp/dracut dracut --reproducible -v --add 'ostree' --tmpdir '/tmp/dracut' -f --no-hostonly --kver $KVER "/usr/lib/modules/$KVER/initramfs.img"