From 13930b49ed7e4ce928e7abfdcb30572abb6d0534 Mon Sep 17 00:00:00 2001 From: Adam Conrad Date: Wed, 11 Jan 2006 18:15:18 +0000 Subject: [PATCH] Simple squashfs support --- debian/changelog | 2 ++ debian/control | 2 +- livecd.sh | 23 ++++++++++++++++++++++- 3 files changed, 25 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index da2a18f6..a27cc5e1 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,6 +1,8 @@ livecd-rootfs (0.27) UNRELEASED; urgency=low * Copy the kernel out of the livefs as well, so we have one that matches. + * Enable rudimentary support for squashfs filesystems, initially enabling + it on the primary architectures only (powerpc, i386, amd64) -- Adam Conrad Sat, 7 Jan 2006 00:25:10 +1100 diff --git a/debian/control b/debian/control index 11b57355..c93bf8f6 100644 --- a/debian/control +++ b/debian/control @@ -7,7 +7,7 @@ Standards-Version: 3.6.1.0 Package: livecd-rootfs Architecture: all -Depends: debootstrap, rsync, cloop-utils, python-minimal|python, procps +Depends: debootstrap, rsync, cloop-utils, python-minimal|python, procps, squashfs-tools Suggests: partimage Description: construction script for the livecd rootfs livecd-rootfs provides the script used to create the root filesystem diff --git a/livecd.sh b/livecd.sh index ab537ed3..2e92e488 100755 --- a/livecd.sh +++ b/livecd.sh @@ -4,7 +4,10 @@ #### (c) Copyright 2004,2005 Canonical Ltd. All rights reserved. #### ###################################################################### -# Depends: debootstrap, rsync, cloop-utils, python-minimal|python, procps +# Depends: debootstrap, rsync, cloop-utils, python-minimal|python, procps, squashfs-tools + +SQUASH_ARCHES="i386 amd64 powerpc" +CLOOP_ARCHES="ia64 hppa sparc" cleanup() { for mnt in $MOUNTS ${ROOT}lib/modules/*/volatile; do @@ -292,6 +295,8 @@ deb-src ${SECSRCMIRROR} ${STE}-security ${COMP} ln -s livecd.${FS}.kernel-"${SUBARCH}" livecd.${FS}.kernel fi + livefs_cloop() + { mkdir -p livecd.mnt MOUNTS="$MOUNTS $(pwd)/livecd.mnt" DEV=$(losetup -f); @@ -331,4 +336,20 @@ deb-src ${SECSRCMIRROR} ${STE}-security ${COMP} fi create_compressed_fs $IMGNAME $COMP > livecd.${FS}.cloop-${fsbs} done + } + + livefs_squash() + { + mksquashfs ${ROOT} livecd.${FS}.squashfs + chmod 644 livecd.${FS}.squashfs + } + + for i in $SQUASH_ARCHES; do + if [ "$ARCH" = "$i" ]; then livefs_squash; fi + done + + for i in $CLOOP_ARCHES; do + if [ "$ARCH" = "$i" ]; then livefs_cloop; fi + done + done