summaryrefslogtreecommitdiff
path: root/helpers
diff options
context:
space:
mode:
authorDaniel Baumann <daniel@debian.org>2008-08-25 16:36:37 +0200
committerDaniel Baumann <daniel@debian.org>2011-03-09 19:03:40 +0100
commitef222396cd30ed23c58d4483b867d6abe7808e75 (patch)
tree71b78021cddbc60e627de87e30dec6e8fbbe0383 /helpers
parent38bb8efc83e2e53fa04129dc64ea0bd90ce2a36a (diff)
downloadvyos-live-build-ef222396cd30ed23c58d4483b867d6abe7808e75.tar.gz
vyos-live-build-ef222396cd30ed23c58d4483b867d6abe7808e75.zip
Introducing config/binary_rootfs/excludes as a generic way to exclude files manually from the binary image.
Diffstat (limited to 'helpers')
-rwxr-xr-xhelpers/lh_binary_rootfs45
1 files changed, 36 insertions, 9 deletions
diff --git a/helpers/lh_binary_rootfs b/helpers/lh_binary_rootfs
index c17660d88..ed0c98c20 100755
--- a/helpers/lh_binary_rootfs
+++ b/helpers/lh_binary_rootfs
@@ -88,6 +88,37 @@ do
fi
done
+# Handling chroot excludes
+if [ "${LH_CHROOT_BUILD}" = "enabled" ]
+then
+ if [ -f config/binary_rootfs/excludes ]
+ then
+ cp config/binary_rootfs/excludes chroot/chroot/excludes
+ Chroot chroot/chroot "cat /excludes | xargs rm -rf"
+ rm -f chroot/chroot/excludes
+ fi
+
+ if [ "${LH_DEBIAN_INSTALLER}" != "live" ]
+ then
+ case "${LH_PACKAGES_LISTS}" in
+ stripped|minimal)
+ # kernel images
+ rm -f chroot/chroot/boot/${LINUX}*
+ rm -f chroot/chroot/boot/initrd.img*
+
+ # kernel symlinks
+ rm -f chroot/chroot/${LINUX}*
+ rm -f chroot/chroot/initrd.img*
+ ;;
+ esac
+ fi
+else
+ if [ "${LH_CHROOT_FILESYSTEM}" != "squashfs" ]
+ then
+ Echo_warning "rootfs excludes are not supported on non-chrooted builds unless squashfs as chroot filesystem is used, thus ignoring excludes now."
+ fi
+fi
+
case "${LH_CHROOT_FILESYSTEM}" in
ext2|ext3)
# Checking depends
@@ -223,15 +254,6 @@ case "${LH_CHROOT_FILESYSTEM}" in
MKSQUASHFS_OPTIONS="${MKSQUASHFS_OPTIONS} -info"
fi
- if [ "${LH_DEBIAN_INSTALLER}" != "live" ]
- then
- case "${LH_PACKAGES_LISTS}" in
- stripped|minimal)
- MKSQUASHFS_OPTIONS="${MKSQUASHFS_OPTIONS} -e $(ls chroot/boot/${LINUX}* chroot/boot/initrd.img* chroot/${LINUX}* chroot/initrd.img* | sed 's|chroot/||g')"
- ;;
- esac
- fi
-
if [ -f config/binary_rootfs/squashfs.sort ]
then
MKSQUASHFS_OPTIONS="${MKSQUASHFS_OPTIONS} -sort squashfs.sort"
@@ -249,6 +271,11 @@ case "${LH_CHROOT_FILESYSTEM}" in
;;
disabled)
+ if [ -f config/binary_rootfs/excludes ]
+ then
+ MKSQUASHFS_OPTIONS="${MKSQUASHFS_OPTIONS} -ef config/binary_rootfs/excludes"
+ fi
+
mksquashfs chroot binary/${INITFS}/filesystem.squashfs ${MKSQUASHFS_OPTIONS}
;;
esac