mirror of
https://git.launchpad.net/livecd-rootfs
synced 2025-02-23 03:11:12 +00:00
switch ext2 image creation to use loop mounting instead of genext2fs
This commit is contained in:
parent
9f58353e84
commit
2bd2e11e5a
7
debian/changelog
vendored
7
debian/changelog
vendored
@ -1,8 +1,13 @@
|
||||
livecd-rootfs (1.139) UNRELEASED; urgency=low
|
||||
|
||||
[ Steve Langasek ]
|
||||
* One more undefined variable fix for set -u
|
||||
|
||||
-- Steve Langasek <steve.langasek@ubuntu.com> Wed, 21 Jul 2010 11:10:44 +0200
|
||||
[ Oliver Grawert ]
|
||||
* drop genext2fs, it is simply to slow, instead we use a loop munted ext2
|
||||
image now.
|
||||
|
||||
-- Oliver Grawert <ogra@ubuntu.com> Wed, 21 Jul 2010 15:12:18 +0200
|
||||
|
||||
livecd-rootfs (1.138) maverick; urgency=low
|
||||
|
||||
|
2
debian/control
vendored
2
debian/control
vendored
@ -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
|
||||
|
19
livecd.sh
19
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
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user