You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
qubes-linux-template-builder/cleanup_image

27 lines
412 B

#!/bin/sh
IMG=$1
if ! [ $# -eq 1 ]; then
echo "usage $0 <img_file_name>"
exit 1
fi
if ! [ -f $IMG ]; then
echo $IMG does not exist
exit 1
fi
ls -als $IMG
mount -o loop $IMG mnt || exit 1
INSTALLDIR=`pwd`/mnt/
13 years ago
yum -c $PWD/yum.conf 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