pmaports/main/postmarketos-mkinitfs/postmarketos-mkinitfs.post-upgrade
Oliver Smith e048839588
main/postmarketos-mkinitfs: don't rm vmlinuz-* (MR 2501)
Adjust post-upgrade script to not remove vmlinuz-*. This causes problems
with devices using kernels from Alpine, where the kernel is not
installed to /boot/vmlinuz, as it is now the case in postmarketOS, but
e.g. in /boot/vmlinuz-rpi. The intention was to clean up files when
migrating from the old postmarketos-mkinitfs to the new one (>= 1.0.0).
However, the /boot/vmlinuz* files are managed by apk, so they should
already get removed.

Add -v, so it prints a message when removing a file from /boot.
2021-09-08 23:40:13 +02:00

12 lines
465 B
Bash

#!/bin/sh
# This attempts to clean up files in /boot left over from when mkinitfs
# 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"
done
exit 0