34
34
}
35
35
36
36
# Parse options
37
- hostkey=
38
37
genprotimgvm=/data.secex/genprotimgvm.qcow2
39
38
ignition_pubkey=
40
39
rc=0
41
40
build=
42
41
force=
43
- options=$( getopt --options h --longoptions help,force,build:,hostkey:, genprotimgvm: -- " $@ " ) || rc=$?
42
+ options=$( getopt --options h --longoptions help,force,build:,genprotimgvm: -- " $@ " ) || rc=$?
44
43
[ $rc -eq 0 ] || {
45
44
print_help
46
45
exit 1
@@ -59,10 +58,6 @@ while true; do
59
58
build=$2
60
59
shift
61
60
;;
62
- --hostkey)
63
- hostkey=$( realpath " $2 " )
64
- shift
65
- ;;
66
61
--genprotimgvm)
67
62
genprotimgvm=" $2 "
68
63
shift
156
151
img=${name} -${build} -${image_type}${image_suffix} .${basearch} .${image_format}
157
152
path=${PWD} /${img}
158
153
159
- ignition_platform_id=" ${image_type} "
160
-
161
- # dasd and metal4k are different disk formats, but they're still metal
162
- if [ " ${image_type} " = dasd ] || [ " ${image_type} " = metal4k ]; then
163
- ignition_platform_id=metal
164
- fi
165
-
166
154
# We do some extra handling of the rootfs here; it feeds into size estimation.
167
155
rootfs_type=$( jq -re .rootfs < " ${image_json} " )
168
156
@@ -242,18 +230,15 @@ image_dynamic_yaml="${tmp_builddir}/image-dynamic.yaml"
242
230
image_dynamic_json=" ${tmp_builddir} /image-dynamic.json"
243
231
image_for_disk_json=" ${tmp_builddir} /image-for-disk.json"
244
232
cat > " ${image_dynamic_yaml} " << EOF
245
- # Used by create_disk.sh
246
233
buildid: "${build} "
247
234
imgid: "${img} "
248
235
ostree-commit: "${commit} "
249
- # Used by both create_disk.sh and runvm-osbuild
250
236
container-imgref: "${container_imgref} "
251
237
deploy-via-container: "${deploy_via_container} "
252
238
osname: "${name} "
253
239
ostree-container: "${ostree_container} "
254
240
ostree-ref: "${ref} "
255
241
extra-kargs-string: "${extra_kargs} "
256
- # Used by runvm-osbuild
257
242
image-type: "${image_type} "
258
243
ostree-repo: "${ostree_repo} "
259
244
metal-image-size: "${metal_image_size_mb} "
@@ -287,18 +272,8 @@ if [ "${OSBUILD_SUPPORTED:-}" != "" ] && [ "${COSA_USE_OSBUILD:-}" != "0" ]; the
287
272
--mpp " /usr/lib/coreos-assembler/osbuild-manifests/coreos.osbuild.${basearch} .mpp.yaml" \
288
273
--filepath " ${path} .tmp" " ${osbuild_extra_args[@]} "
289
274
else
290
- runvm " ${qemu_args[@]} " -- \
291
- /usr/lib/coreos-assembler/create_disk.sh \
292
- --config " ${image_for_disk_json} " \
293
- --platform " ${ignition_platform_id} " \
294
- --platforms-json " ${platforms_json} " \
295
- " ${disk_args[@]} "
296
-
297
- # Now that we've created the image let's resize it to the desired
298
- # size for qemu (and all images based on it).
299
- if [[ $image_type == qemu ]]; then
300
- qemu-img resize " ${path} .tmp" " ${cloud_image_size_mb} M"
301
- fi
275
+ echo " OSBUILD_SUPPORTED is not supported or COSA_USE_OSBUILD is unset"
276
+ exit 1
302
277
fi
303
278
304
279
if [[ $secure_execution -eq " 1" ]]; then
0 commit comments