stage2: tweak 99-cleanup-boot for efficiency

Thanks glebfm@ for noticing that Simply (an m-p-d product)
takes no kernel inside squashfs but relies on livecd-install's
50-restore-kernel.sh hook to copy the kernel from iso9660
and regenerate initrd (which is a must anyways but requires
System.map to be still around).

This saves about 3 Mb in ISO size for a LiveCD using
kernel-image-std-def-4.1.15-alt1.x86_64.rpm.
This commit is contained in:
Michael Shigorin 2016-01-12 20:01:18 +03:00
parent 837e6be9a7
commit 37e77285cd

View File

@ -1,10 +1,15 @@
#!/bin/sh
# don't cripple the image to be copied over
[ -x /usr/sbin/live-install -o -x /usr/sbin/livecd-install -o \
-x /usr/sbin/homeros-install -o -x /usr/sbin/luwrain-install ] && exit 0
# NB: livecd-install has 50-restore-kernel.sh
[ -x /usr/sbin/live-install -o \
-x /usr/sbin/homeros-install -o \
-x /usr/sbin/luwrain-install ] && exit 0
# no need for the kernel in live root otherwise: it's been booted already
rm -f /boot/*
# NB: installkernel run by that livecd-install hook needs System.map
rm -f -- /boot/{initrd,vmlinuz}*
[ -x /usr/sbin/livecd-install ] || rm -f -- /boot/*
: