From 79f16f1a87e91c4e5295e893915a1b70c0de7e58 Mon Sep 17 00:00:00 2001 From: LaMont Jones Date: Thu, 13 Jan 2005 19:35:02 +0000 Subject: [PATCH] try to get some rsyncability happening --- debian/changelog | 6 ++++++ livecd.sh | 38 ++++++++++++++++++++++---------------- 2 files changed, 28 insertions(+), 16 deletions(-) diff --git a/debian/changelog b/debian/changelog index d290ae3e..b8eab8d8 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +livecd-rootfs (0.5) hoary; urgency=low + + * Buildd various .cloop filesystems, to see if rsync loves us + + -- LaMont Jones Thu, 13 Jan 2005 12:34:30 -0700 + livecd-rootfs (0.4) hoary; urgency=low * Need to actually umount the fsimg before compressing it. diff --git a/livecd.sh b/livecd.sh index b139e4c8..329aa299 100755 --- a/livecd.sh +++ b/livecd.sh @@ -150,24 +150,30 @@ chroot ${ROOT} apt-get clean rm ${ROOT}var/lib/apt/lists/*_* rm ${ROOT}var/spool/postfix/maildrop/* +mkdir -p livecd.mnt +MOUNTS="$MOUNTS $(pwd)/livecd.mnt" +DEV=$(losetup -f); + # Make the filesystem, with some room for meta data and such SZ=$(python -c "print int($(du -sk $ROOT|sed 's/[^0-9].*$//')*1.1+$USZ)") (( SZ > 2097150 )) && SZ=2097150 -rm -f $IMG -dd if=/dev/zero of=$IMG seek=$SZ bs=1024 count=1 -INUM="" -if [ -n "$UINUM" ]; then - INUM="-N "$(python -c "print $(find ${ROOT} | wc -l)+$UINUM") -fi -mke2fs $INUM -Osparse_super -F $IMG -DEV=$(losetup -f); -losetup $DEV $IMG -mkdir -p livecd.mnt -MOUNTS="$MOUNTS $(pwd)/livecd.mnt" -mount $DEV livecd.mnt -rsync -a ${ROOT} livecd.mnt -umount $DEV +SZ=2097150 # XXX fix size for now + +for fsbs in 4096:4096 1024:65536; do + FSBLOCK=${fsbs%:*} + COMP=${fsbs#*:} + IMGNAME=${IMG}.${fsbs} + rm -f $IMGNAME + dd if=/dev/zero of=$IMGNAME seek=$SZ bs=1024 count=1 + INUM="" + [ -n "$UINUM" ] && INUM="-N "$(python -c "print $(find ${ROOT}|wc -l)+$UINUM") || INUM="" + mke2fs -b $FSBLOCK $INUM -Osparse_super -F $IMGNAME + losetup $DEV $IMGNAME + mount $DEV livecd.mnt + rsync -a ${ROOT} livecd.mnt + umount $DEV + losetup -d $DEV + create_compressed_fs $IMGNAME $COMP > livecd.cloop-${FSBS} +done -create_compressed_fs $IMG 65536 > livecd.cloop chroot ${ROOT} dpkg-query -W --showformat='${Package} ${Version}\n' > livecd.manifest -