main/postmarketos-mkinitfs: tweak clean print (MR 6297)

Don't print the "Cleaning up old boot files..." message every time in
post-upgrade, only when it actually deletes files.
This commit is contained in:
Oliver Smith 2025-03-08 00:17:53 +01:00
parent eddffe3ec9
commit 200529afe0
No known key found for this signature in database
GPG key ID: 5AE7F5513E0885CB

View file

@ -4,9 +4,11 @@
# appended kernel 'flavors'. Without doing this cleanup, /boot might be more
# full than it needs to be, and things like copying files atomically in the new
# mkinitfs may not have enough space to do the atomic copy
echo "Cleaning up old boot files..."
for f in /boot/boot.img-* /boot/initramfs-*-extra* /boot/initramfs-*[!-extra]; do
[ -f "$f" ] && rm -v "$f"
if [ -f "$f" ]; then
echo "mkinitfs: cleaning up old boot file: $f"
rm "$f"
fi
done
exit 0