From 64d5dccb6b19c5d23a640b4de1bdd80d0a65c494 Mon Sep 17 00:00:00 2001 From: Silvan Calarco Date: Sat, 28 Feb 2015 23:21:52 +0100 Subject: [PATCH] Remove any created initramfs except failsafe one --- platforms/livecd-gnome-root/post.inc.sh | 11 +++++++---- platforms/livecd-light-root/post.inc.sh | 11 +++++++---- platforms/livedvd-root/post.inc.sh | 12 +++++++----- platforms/livegames-root/post.inc.sh | 11 ++++++----- platforms/testcd-root/post.inc.sh | 2 -- 5 files changed, 27 insertions(+), 20 deletions(-) diff --git a/platforms/livecd-gnome-root/post.inc.sh b/platforms/livecd-gnome-root/post.inc.sh index 504f351..9b0a3d2 100644 --- a/platforms/livecd-gnome-root/post.inc.sh +++ b/platforms/livecd-gnome-root/post.inc.sh @@ -24,10 +24,13 @@ chroot $MOUNTDIR rpm -e VirtualBox-vboxguest dkms --noscripts for K in $KERNEL_EXTRAVER $KERNEL_MORE_EXTRAVER; do # remove kernel headers installed by dkms chroot $MOUNTDIR smart remove kernel-${K}-headers -y - # remove unused initramfs generated by kernel - rm -f $MOUNTDIR/boot/initramfs-${KERNEL_MAJVER}${K}.img* - # remove failsafe image to save space for livecd - rm -f $MOUNTDIR/boot/initramfs-${KERNEL_MAJVER}${KERNEL_EXTRAVER}-failsafe.img* +done +# remove unused initramfs generated by kernel +for f in $MOUNTDIR/boot/initramfs-*.img*; do + case "$f" in + *failsafe*) continue ;; + *) rm -f $f ;; + esac done # install all GConf rules diff --git a/platforms/livecd-light-root/post.inc.sh b/platforms/livecd-light-root/post.inc.sh index b1121ea..6ba339b 100644 --- a/platforms/livecd-light-root/post.inc.sh +++ b/platforms/livecd-light-root/post.inc.sh @@ -17,10 +17,13 @@ chroot $MOUNTDIR rpm -e VirtualBox-vboxguest dkms --noscripts for K in $KERNEL_EXTRAVER $KERNEL_MORE_EXTRAVER; do # remove kernel headers installed by dkms chroot $MOUNTDIR smart remove kernel-${K}-headers -y - # remove unused initramfs generated by kernel - rm -f $MOUNTDIR/boot/initramfs-${KERNEL_MAJVER}${K}.img* - # remove failsafe image to save space for livecd - rm -f $MOUNTDIR/boot/initramfs-${KERNEL_MAJVER}${KERNEL_EXTRAVER}-failsafe.img* +done +# remove unused initramfs generated by kernel +for f in $MOUNTDIR/boot/initramfs-*.img*; do + case "$f" in + *failsafe*) continue ;; + *) rm -f $f ;; + esac done # remove some documentation to save space on CD diff --git a/platforms/livedvd-root/post.inc.sh b/platforms/livedvd-root/post.inc.sh index 19c5018..a96ee49 100644 --- a/platforms/livedvd-root/post.inc.sh +++ b/platforms/livedvd-root/post.inc.sh @@ -16,10 +16,12 @@ for K in $KERNEL_EXTRAVER $KERNEL_MORE_EXTRAVER; do # pre-create video drivers for VirtualBox chroot $MOUNTDIR dkms install -q -m vboxguest -v ${virtualbox_ver} -k ${KERNEL_MAJVER}$K --force chroot $MOUNTDIR dkms install -q -m vboxvideo -v ${virtualbox_ver} -k ${KERNEL_MAJVER}$K --force - # remove unused initramfs generated by kernel - rm -f $MOUNTDIR/boot/initramfs-${KERNEL_MAJVER}${K}.img* -# # remove failsafe image to save space for livecd -# rm -f $MOUNTDIR/boot/initramfs-${KERNEL_MAJVER}${KERNEL_EXTRAVER}-failsafe.img* done - +# remove unused initramfs generated by kernel +for f in $MOUNTDIR/boot/initramfs-*.img*; do + case "$f" in + *failsafe*) continue ;; + *) rm -f $f ;; + esac +done prelink diff --git a/platforms/livegames-root/post.inc.sh b/platforms/livegames-root/post.inc.sh index 795ee8b..d03e015 100644 --- a/platforms/livegames-root/post.inc.sh +++ b/platforms/livegames-root/post.inc.sh @@ -6,11 +6,12 @@ for f in /usr/share/applications/chromium-devel.desktop; do chroot $MOUNTDIR /opt/kde/bin/kickoffcfg --add-favorite $f done -for K in $KERNEL_EXTRAVER $KERNEL_MORE_EXTRAVER; do - # remove unused initramfs generated by kernel - rm -f $MOUNTDIR/boot/initramfs-${KERNEL_MAJVER}${K}.img* - # remove failsafe image to save space for livecd - rm -f $MOUNTDIR/boot/initramfs-${KERNEL_MAJVER}${KERNEL_EXTRAVER}-failsafe.img* +# remove unused initramfs generated by kernel +for f in $MOUNTDIR/boot/initramfs-*.img*; do + case "$f" in + *failsafe*) continue ;; + *) rm -f $f ;; + esac done prelink diff --git a/platforms/testcd-root/post.inc.sh b/platforms/testcd-root/post.inc.sh index a0a9241..f68b558 100644 --- a/platforms/testcd-root/post.inc.sh +++ b/platforms/testcd-root/post.inc.sh @@ -17,8 +17,6 @@ chroot $MOUNTDIR rpm -e VirtualBox-vboxguest dkms --noscripts for K in $KERNEL_EXTRAVER $KERNEL_MORE_EXTRAVER; do # remove kernel headers installed by dkms chroot $MOUNTDIR smart remove kernel-${K}-headers -y - # remove failsafe image to save space for livecd - #rm -f $MOUNTDIR/boot/initramfs-${KERNEL_MAJVER}${KERNEL_EXTRAVER}-failsafe.img* done # remove unused initramfs generated by kernel for f in $MOUNTDIR/boot/initramfs-*.img* do