Skip to content

Commit

Permalink
Even better test the modules deletion pipeline
Browse files Browse the repository at this point in the history
Now works when there's only one directory in modules (matching the
kernel) and when kernels are substrings of each other
  • Loading branch information
prydom committed Apr 13, 2024
1 parent 1e34d7f commit 425fe5a
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions config/scripts/regen-initramfs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"

0 comments on commit 425fe5a

Please sign in to comment.