blob: 47f60faca39bec8e5f453ece393d363d5f88b137 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
#!/bin/sh
#
# prepare image as virt-builder template
#
# args
image="$1"
# config
scripts="$(dirname $0)"
info="${image%.qcow2}.info"
# checks
if test ! -f "$1"; then
echo "usage: $0 <image>"
exit 1
fi
# go!
set -ex
virt-sysprep -a "$image"
virt-sparsify --inplace "$image"
qemu-img info --output=json "$image" > "$info"
xz --verbose "$image"
$scripts/virt-builder-index.sh "$info"
|