Hi,

Attached is a proposed patch for an option to exclude files or directories 
from the squashfs root filesystem.

The motivation for this feature is to be able to create smaller ISO images. 
For example, the following list of excludes makes the ISO about 7MB 
smaller:
var/cache/apt
var/lib/apt
var/lib/dpkg

Removing these directories from the chroot does not work, since the chroot 
is also used for installing tools and removing the administrative 
directories of apt and dpkg breaks those installations. Excluding them when 
running mksquashfs does not have that problem.

Some things I was unsure about:
- The added code block is modeled after the code block that handles the 
squashfs.sort file. That code block has a #FIXME comment after the copy 
statement. I don't know what should be fixed there, but there is a chance 
my code has the same problem since it's very similar.
- Should this feature be tied to squashfs or should there be a generic way 
of excluding files from the root filesystem? And if it should be generic, 
is that something for the future or must it be dealt with right now?

Please review this patch and tell me whether it can be accepted as-is, with 
modifications or not at all.

Bye,
                Maarten
--- lh_binary_rootfs.org	2007-10-24 14:09:13.000000000 +0200
+++ lh_binary_rootfs	2007-10-24 15:08:37.000000000 +0200
@@ -183,6 +183,13 @@
 			MKSQUASHFS_OPTIONS="${MKSQUASHFS_OPTIONS} -info"
 		fi
 
+		if [ -f config/binary_rootfs/squashfs.exclude ]
+		then
+			# Note: the -ef option has to be before -e.
+			MKSQUASHFS_OPTIONS="${MKSQUASHFS_OPTIONS} -ef squashfs.exclude"
+			cp config/binary_rootfs/squashfs.exclude chroot
+		fi
+
 		if [ "${LH_PACKAGES_LISTS}" = "minimal" ] || [ "${LH_PACKAGES_LISTS}" = "mini" ]
 		then
 			MKSQUASHFS_OPTIONS="${MKSQUASHFS_OPTIONS} -e $(ls chroot/boot/${LINUX}* chroot/boot/initrd.img* chroot/${LINUX}* chroot/initrd.img* | sed 's,chroot/,,g')"

Attachment: signature.asc
Description: This is a digitally signed message part.

_______________________________________________
debian-live-devel mailing list
[email protected]
http://lists.alioth.debian.org/mailman/listinfo/debian-live-devel

Reply via email to