diff options
author | Natanael Copa <ncopa@alpinelinux.org> | 2011-06-01 08:41:03 +0000 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2011-06-01 08:44:33 +0000 |
commit | 4ad9349a4135087214c6ca5170d7faaebc29e796 (patch) | |
tree | d0cb8539cd7019b36281b2dedc7b30958b1ea092 | |
parent | 199ad41bffe2fe98e3794752398a7e2713f9eb68 (diff) | |
download | aports-4ad9349a4135087214c6ca5170d7faaebc29e796.tar.bz2 aports-4ad9349a4135087214c6ca5170d7faaebc29e796.tar.xz |
main/mkinitfs: delete unused initramfs images
ref #660
-rw-r--r-- | main/mkinitfs/APKBUILD | 2 | ||||
-rw-r--r-- | main/mkinitfs/mkinitfs.trigger | 10 |
2 files changed, 11 insertions, 1 deletions
diff --git a/main/mkinitfs/APKBUILD b/main/mkinitfs/APKBUILD index 9820dc2d0a..5d4d760345 100644 --- a/main/mkinitfs/APKBUILD +++ b/main/mkinitfs/APKBUILD @@ -1,7 +1,7 @@ # 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" diff --git a/main/mkinitfs/mkinitfs.trigger b/main/mkinitfs/mkinitfs.trigger index f21a157e5e..4069d923f5 100644 --- a/main/mkinitfs/mkinitfs.trigger +++ b/main/mkinitfs/mkinitfs.trigger @@ -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 |