buildextend-live: make metal4k image optional if --fast
That should make it even faster to iterate on the live ISO, because we
don't incur the upfront cost of generating a metal4k image, as well as
the recurring cost of osmet generation at each iteration.
@@ -221,7 +221,11 @@ def generate_iso():
img_metal_checksum = img_metal_obj['sha256']
img_metal4k_obj = buildmeta.get_artifact_meta("metal4k", unmerged=True)["images"].get("metal4k")
if img_metal4k_obj is None:
- raise Exception("Live image generation requires `metal4k` image")
+ if not args.fast:
+ raise Exception("Live image generation requires `metal4k` image (use --fast to ignore)")
+ else:
+ print("Missing `metal4k` image; ignoring because of --fast")
+ else:
img_metal4k = os.path.join(builddir, img_metal4k_obj['path'])
img_metal4k_checksum = img_metal4k_obj['sha256']
@@ -272,6 +276,7 @@ def generate_iso():
run_verbose(['/usr/lib/coreos-assembler/osmet-pack',
img_metal, '512', tmp_osmet, img_metal_checksum,
'fast' if args.fast else 'normal'])
+ if img_metal4k_obj is not None:
tmp_osmet4k = os.path.join(tmpinitrd_rootfs, img_metal4k_obj['path'] + '.osmet')
print('Generating osmet file for 4k metal image')
run_verbose(['/usr/lib/coreos-assembler/osmet-pack',
