Much more rsyncable now

ubuntu/precise
LaMont Jones 20 years ago
parent 48b3af2545
commit 1de1d754a1

2
debian/control vendored

@ -7,7 +7,7 @@ Standards-Version: 3.6.1.0
Package: livecd-rootfs Package: livecd-rootfs
Architecture: all Architecture: all
Depends: sudo, debootstrap, rsync, cloop-utils, python-minimal|python Depends: sudo, debootstrap, rsync, cloop-utils, python-minimal|python, partimage
Description: construction script for the livecd rootfs Description: construction script for the livecd rootfs
livecd-rootfs provides the script used to create the root filesystem livecd-rootfs provides the script used to create the root filesystem
on the livecd. on the livecd.

@ -40,7 +40,7 @@ IMG=livecd.fsimg
MOUNTS="${ROOT}dev/pts ${ROOT}dev/shm ${ROOT}.dev ${ROOT}dev ${ROOT}proc" MOUNTS="${ROOT}dev/pts ${ROOT}dev/shm ${ROOT}.dev ${ROOT}dev ${ROOT}proc"
DEV="" DEV=""
rm -rf ${ROOT} $(pwd)/${IMG}-* rm -rf ${ROOT}
mkdir -p ${ROOT}var/cache/debconf mkdir -p ${ROOT}var/cache/debconf
cat << @@EOF > ${ROOT}var/cache/debconf/config.dat cat << @@EOF > ${ROOT}var/cache/debconf/config.dat
@ -172,15 +172,24 @@ for fsbs in 1024:65536; do
COMP=${fsbs#*:} COMP=${fsbs#*:}
IMGNAME=${IMG}-${FSBLOCK} IMGNAME=${IMG}-${FSBLOCK}
if [ ! -f ${IMGNAME} ]; then if [ ! -f ${IMGNAME} ]; then
dd if=/dev/zero of=$IMGNAME count=$SZ bs=1M if [ -f old-${IMGNAME} ]; then
INUM="" cp old-${IMGNAME} new-${IMGNAME}
[ -n "$UINUM" ] && INUM="-N "$(python -c "print $(find ${ROOT}|wc -l)+$UINUM") || INUM="" else
mke2fs -b $FSBLOCK $INUM -Osparse_super -F $IMGNAME dd if=/dev/zero of=new-${IMGNAME} count=$SZ bs=1M
losetup $DEV $IMGNAME INUM=""
[ -n "$UINUM" ] && INUM="-N "$(python -c "print $(find ${ROOT}|wc -l)+$UINUM") || INUM=""
mke2fs -b $FSBLOCK $INUM -Osparse_super -F new-${IMGNAME}
fi
losetup $DEV new-${IMGNAME}
mount $DEV livecd.mnt mount $DEV livecd.mnt
rsync -a ${ROOT} livecd.mnt rsync -a --delete --inplace --no-whole-file ${ROOT} livecd.mnt
umount $DEV umount $DEV
rm -rf partimg-${IMGNAME}.*
partimage -b -z0 --nodesc -f3 -c -o -y save $DEV partimg-${IMGNAME}
cat partimg-${IMGNAME}.*|partimage -b -z0 --nodesc -e -f3 -c -o -y restore $DEV stdin
losetup -d $DEV losetup -d $DEV
mv new-${IMGNAME} ${IMGNAME}
cp ${IMGNAME} old-${IMGNAME}
fi fi
create_compressed_fs $IMGNAME $COMP > livecd.cloop-${fsbs} create_compressed_fs $IMGNAME $COMP > livecd.cloop-${fsbs}
done done

Loading…
Cancel
Save