Skip to content

Commit

Permalink
buildextend-installer: require metal4k image for live build
Browse files Browse the repository at this point in the history
In practice it's required for all release images, and we've forgotten
about this before:

    coreos/fedora-coreos-pipeline#250

This increases build time for local development, but improves the
consistency of build artifacts and reduces code complexity a bit.
  • Loading branch information
bgilbert authored and openshift-merge-robot committed Jul 21, 2020
1 parent 4f14272 commit ec0931d
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions src/cmd-buildextend-installer
Original file line number Diff line number Diff line change
Expand Up @@ -149,17 +149,19 @@ def generate_iso():
initramfs_img = 'initramfs.img'

tmpisofile = os.path.join(tmpdir, iso_name)
img_metal_obj = buildmeta['images'].get('metal')
if img_metal_obj is None:
raise Exception("ISO generation requires `metal` image")

img_metal = os.path.join(builddir, img_metal_obj['path'])
img_metal_checksum = img_metal_obj['sha256']

img_metal_obj = buildmeta['images'].get('metal')
img_metal4k_obj = buildmeta['images'].get('metal4k')
if img_metal4k_obj is not None:
if is_live:
if img_metal_obj is None or img_metal4k_obj is None:
raise Exception("Live image generation requires `metal` and `metal4k` images")
img_metal4k = os.path.join(builddir, img_metal4k_obj['path'])
img_metal4k_checksum = img_metal4k_obj['sha256']
else:
if img_metal_obj is None:
raise Exception("ISO image generation requires `metal` image")
img_metal = os.path.join(builddir, img_metal_obj['path'])
img_metal_checksum = img_metal_obj['sha256']

# Find the directory under `/usr/lib/modules/<kver>` where the
# kernel/initrd live. It will be the 2nd entity output by
Expand Down Expand Up @@ -190,15 +192,13 @@ def generate_iso():
# Add osmet files
if is_live:
tmp_osmet = os.path.join(tmpinitrd_base, img_metal_obj['path'] + '.osmet')
tmp_osmet4k = os.path.join(tmpinitrd_base, img_metal4k_obj['path'] + '.osmet')
print(f'Generating osmet file for 512b metal image')
run_verbose(['/usr/lib/coreos-assembler/osmet-pack',
img_metal, '512', tmp_osmet, img_metal_checksum])
if img_metal4k_obj is not None:
tmp_osmet4k = os.path.join(tmpinitrd_base, img_metal4k_obj['path'] + '.osmet')
print(f'Generating osmet file for 4k metal image')
run_verbose(['/usr/lib/coreos-assembler/osmet-pack',
img_metal4k, '4096', tmp_osmet4k,
img_metal4k_checksum])
print(f'Generating osmet file for 4k metal image')
run_verbose(['/usr/lib/coreos-assembler/osmet-pack',
img_metal4k, '4096', tmp_osmet4k, img_metal4k_checksum])

# Generate root squashfs
tmp_squashfs = None
Expand Down

0 comments on commit ec0931d

Please sign in to comment.