|
|
@ -150,24 +150,30 @@ chroot ${ROOT} apt-get clean
|
|
|
|
rm ${ROOT}var/lib/apt/lists/*_*
|
|
|
|
rm ${ROOT}var/lib/apt/lists/*_*
|
|
|
|
rm ${ROOT}var/spool/postfix/maildrop/*
|
|
|
|
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
|
|
|
|
# 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=$(python -c "print int($(du -sk $ROOT|sed 's/[^0-9].*$//')*1.1+$USZ)")
|
|
|
|
(( SZ > 2097150 )) && SZ=2097150
|
|
|
|
(( SZ > 2097150 )) && SZ=2097150
|
|
|
|
rm -f $IMG
|
|
|
|
SZ=2097150 # XXX fix size for now
|
|
|
|
dd if=/dev/zero of=$IMG seek=$SZ bs=1024 count=1
|
|
|
|
|
|
|
|
INUM=""
|
|
|
|
for fsbs in 4096:4096 1024:65536; do
|
|
|
|
if [ -n "$UINUM" ]; then
|
|
|
|
FSBLOCK=${fsbs%:*}
|
|
|
|
INUM="-N "$(python -c "print $(find ${ROOT} | wc -l)+$UINUM")
|
|
|
|
COMP=${fsbs#*:}
|
|
|
|
fi
|
|
|
|
IMGNAME=${IMG}.${fsbs}
|
|
|
|
mke2fs $INUM -Osparse_super -F $IMG
|
|
|
|
rm -f $IMGNAME
|
|
|
|
DEV=$(losetup -f);
|
|
|
|
dd if=/dev/zero of=$IMGNAME seek=$SZ bs=1024 count=1
|
|
|
|
losetup $DEV $IMG
|
|
|
|
INUM=""
|
|
|
|
mkdir -p livecd.mnt
|
|
|
|
[ -n "$UINUM" ] && INUM="-N "$(python -c "print $(find ${ROOT}|wc -l)+$UINUM") || INUM=""
|
|
|
|
MOUNTS="$MOUNTS $(pwd)/livecd.mnt"
|
|
|
|
mke2fs -b $FSBLOCK $INUM -Osparse_super -F $IMGNAME
|
|
|
|
mount $DEV livecd.mnt
|
|
|
|
losetup $DEV $IMGNAME
|
|
|
|
rsync -a ${ROOT} livecd.mnt
|
|
|
|
mount $DEV livecd.mnt
|
|
|
|
umount $DEV
|
|
|
|
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
|
|
|
|
chroot ${ROOT} dpkg-query -W --showformat='${Package} ${Version}\n' > livecd.manifest
|
|
|
|
|
|
|
|
|
|
|
|