Commit 4ad9349a authored by Natanael Copa's avatar Natanael Copa

main/mkinitfs: delete unused initramfs images

ref #660
parent 199ad41b
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=mkinitfs
pkgver=2.3.4
pkgrel=1
pkgrel=2
pkgdesc="Tool to generate initramfs images for Alpine"
url=http://git.alpinelinux.org/cgit/mkinitfs
depends="busybox apk-tools>=2.0"
......
......@@ -30,6 +30,7 @@ for i in "$@"; do
-e "s:initrd /$flavor.gz:initrd /boot/initramfs-$flavor:" \
$f
fi
done
# extlinux will use path relative partition, so if /boot is on a
......@@ -38,3 +39,12 @@ if ! [ -e /boot/boot ]; then
ln -sf / /boot/boot
fi
# cleanup unused initramfs
for i in /boot/initramfs-[0-9]*; do
[ -f $i ] || continue
if ! [ -f /boot/vmlinuz-${i#/boot/initramfs-} ]; then
rm "$i"
fi
done
exit 0
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment