From 082b2f2d3a054448d14a0a71ff3f270fbe14e9f0 Mon Sep 17 00:00:00 2001 From: Oliver Grawert Date: Wed, 21 Jul 2010 15:15:18 +0200 Subject: [PATCH] Import patches-unapplied version 1.139 to ubuntu/maverick Imported using git-ubuntu import. Changelog parent: 0bf02053ce63fbc5de8921724be5d180d60e9c8a New changelog entries: [ Steve Langasek ] * One more undefined variable fix for set -u [ Oliver Grawert ] * drop genext2fs, it is simply to slow, instead we use a loop munted ext2 image now. --- debian/changelog | 11 +++++++++++ debian/control | 2 +- livecd.sh | 20 +++++++++++++++++--- 3 files changed, 29 insertions(+), 4 deletions(-) diff --git a/debian/changelog b/debian/changelog index f1d4427b..abf9cd17 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,14 @@ +livecd-rootfs (1.139) maverick; urgency=low + + [ Steve Langasek ] + * One more undefined variable fix for set -u + + [ Oliver Grawert ] + * drop genext2fs, it is simply to slow, instead we use a loop munted ext2 + image now. + + -- Oliver Grawert Wed, 21 Jul 2010 15:15:18 +0200 + livecd-rootfs (1.138) maverick; urgency=low * Don't go overboard with the downgrading of packages; this probably caused diff --git a/debian/control b/debian/control index 31e54293..d0d15536 100644 --- a/debian/control +++ b/debian/control @@ -8,7 +8,7 @@ Vcs-Bzr: http://bazaar.launchpad.net/~ubuntu-core-dev/livecd-rootfs/trunk Package: livecd-rootfs Architecture: all -Depends: ${misc:Depends}, debootstrap, rsync, python-minimal | python, procps, squashfs-tools (>= 1:3.3-1), grep-dctrl, fdupes, lsb-release, lzma, genext2fs +Depends: ${misc:Depends}, debootstrap, rsync, python-minimal | python, procps, squashfs-tools (>= 1:3.3-1), grep-dctrl, fdupes, lsb-release, lzma, e2fsprogs 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 a45b5423..0ac3084b 100755 --- a/livecd.sh +++ b/livecd.sh @@ -21,7 +21,7 @@ set -eu # Boston, MA 02110-1301 USA. # ########################################################################## -# Depends: debootstrap, rsync, python-minimal|python, procps, squashfs-tools, ltsp-server [i386], genext2fs +# Depends: debootstrap, rsync, python-minimal|python, procps, squashfs-tools, ltsp-server [i386], e2fsprogs cleanup() { for mnt in ${ROOT}dev/pts ${ROOT}dev/shm ${ROOT}.dev ${ROOT}dev \ @@ -30,7 +30,7 @@ cleanup() { umount $mnt || true done - [ -n "$DEV" ] && losetup -d $DEV || true + [ -n "$DEV" ] && umount $DEV && losetup -d $DEV || true grep ${ROOT} /proc/mounts && return 1 || return 0 } @@ -78,12 +78,25 @@ livefs_ext2() { # Add 10MiB extra free space for first boot + ext3 journal size=$(($(du -ks ${ROOT} | cut -f1) + (10240))) + MOUNTPOINT=$(mktemp -d) + DEV=$(losetup -f) echo "Building ext2 filesystem." # remove any stale filesystem images rm -f livecd.${FSS}.ext? - genext2fs -b $size -d ${ROOT} livecd.${FSS}.ext2 + # create an empty ext2 image and loop mount it + dd if=/dev/zero of=livecd.${FSS}.ext2 bs=1024 count=0 seek=$size + mke2fs livecd.${FSS}.ext2 + mount -o loop=${DEV} livecd.${FSS}.ext2 ${MOUNTPOINT} + + # copy chroot content to image + cp -a ${ROOT} ${MOUNTPOINT} + + # clean up + umount ${MOUNTPOINT} + rm -rf ${MOUNTPOINT} + losetup -d $DEV chmod 644 livecd.${FSS}.ext2 } @@ -155,6 +168,7 @@ IMAGEFORMAT="squashfs" # name is "ppa", don't omit it PPA="" APT_SOURCE="" +FORCE_YES="" while getopts :d:e:i:I:m:S:s:a:A:f:p name; do case $name in d) STE=$OPTARG;;