From 4ad9349a4135087214c6ca5170d7faaebc29e796 Mon Sep 17 00:00:00 2001 From: Natanael Copa Date: Wed, 1 Jun 2011 08:41:03 +0000 Subject: main/mkinitfs: delete unused initramfs images ref #660 --- main/mkinitfs/mkinitfs.trigger | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'main/mkinitfs/mkinitfs.trigger') 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 -- cgit v1.2.3