diff --git a/src/cmd-init b/src/cmd-init index 016c5aebc2..6baf6e3598 100755 --- a/src/cmd-init +++ b/src/cmd-init @@ -193,7 +193,3 @@ mkdir -p cache mkdir -p builds mkdir -p tmp ostree --repo=repo init --mode=archive -if ! has_privileges && [ ! -f cache/cache.qcow2 ]; then - qemu-img create -f qcow2 cache/cache.qcow2 10G - LIBGUESTFS_BACKEND=direct virt-format --filesystem=xfs -a cache/cache.qcow2 -fi diff --git a/src/cmdlib.sh b/src/cmdlib.sh index 39dfb84bd4..fec3588afb 100755 --- a/src/cmdlib.sh +++ b/src/cmdlib.sh @@ -100,8 +100,11 @@ prepare_build() { preflight if ! [ -d repo ]; then fatal "No $(pwd)/repo found; did you run coreos-assembler init?" - elif ! has_privileges && [ ! -f cache/cache.qcow2 ]; then - fatal "No cache.qcow2 found; did you run coreos-assembler init?" + elif ! has_privileges; then + if [ ! -f cache/cache.qcow2 ]; then + qemu-img create -f qcow2 cache/cache.qcow2 10G + LIBGUESTFS_BACKEND=direct virt-format --filesystem=xfs -a cache/cache.qcow2 + fi fi workdir="$(pwd)"