diff --git a/README b/README index f3aa9f2..dd9dea0 100644 --- a/README +++ b/README @@ -27,6 +27,10 @@ of Qubes-specific rpms to install you want to use (e.g. qubes-gui-vm, etc). # ./qubeize_image +3a) You should remove yum cached files, and override unused block with +zeroes, via +# ./cleanup_image qubeized_images/name-root.img + 4) Make sure the symlinks in vm_kernels_XXX/ point to correct kernel and initramfs files you want to use for the template: diff --git a/cleanup_image b/cleanup_image new file mode 100755 index 0000000..ec17beb --- /dev/null +++ b/cleanup_image @@ -0,0 +1,26 @@ +#!/bin/sh + +IMG=$1 + +if ! [ $# -eq 1 ]; then + echo "usage $0 " + exit 1 +fi + + +if ! [ -f $IMG ]; then + echo $IMG does not exist + exit 1 +fi +ls -als $IMG +mount -o loop,offset=$((63*512)) $IMG mnt || exit 1 +INSTALLDIR=`pwd`/mnt/ +yum clean packages --installroot=$INSTALLDIR +dd if=/dev/zero of=mnt/fillme bs=1M +sync +rm mnt/fillme +umount mnt +cp --sparse=always $IMG $IMG.new +mv $IMG.new $IMG +ls -als $IMG +