cmd-buildextend-metal: Fix ref_is_temp handling
In the non-Anaconda path when not using a ref, we were embedding the
temporary ref we create into the origin rather than the checksum
directly.
Really, `${ref-:${commit}}` doesn't work because the `ref` variable is
always defined, it's just that it might be a temporary one.
@@ -163,7 +163,13 @@ save_var_subdirs="$(python3 -c 'import sys, yaml; print(yaml.safe_load(sys.stdin
if [ -z "${use_anaconda}" ]; then
qemu-img create -f ${image_format} "${path}.tmp" "$size"
- runvm_with_disk "${path}.tmp" ${image_format} /usr/lib/coreos-assembler/create_disk.sh /dev/vda "$ostree_repo" "${ref-:${commit}}" "${ostree_remote}" /usr/lib/coreos-assembler/grub.cfg "$name" "${save_var_subdirs}" "\"$kargs\""
+ # In the anaconda path, run_virtinstall dereferences in the ref_is_temp
+ # case. Here, we need to dereference ourselves.
+ ref_arg=${ref}
+ if [ -n "${ref_is_temp}" ]; then
+ ref_arg=${commit}
+ fi
+ runvm_with_disk "${path}.tmp" ${image_format} /usr/lib/coreos-assembler/create_disk.sh /dev/vda "$ostree_repo" "${ref_arg}" "${ostree_remote}" /usr/lib/coreos-assembler/grub.cfg "$name" "${save_var_subdirs}" "\"$kargs\""
mv "${path}.tmp" "$path"
echo "{}" > tmp/vm-iso-checksum.json
else
