diff --git a/src/cmd-buildextend-live b/src/cmd-buildextend-live index 92ddf1dd17..de7d3a2308 100755 --- a/src/cmd-buildextend-live +++ b/src/cmd-buildextend-live @@ -317,6 +317,7 @@ def generate_iso(): kargs = ' '.join(kargs_array) print(f'Substituting ISO kernel arguments: {kargs}') + default_kargs = '' files_with_karg_embed_areas = {} karg_embed_area_length = 0 # Grab all the contents from the live dir from the configs @@ -341,6 +342,13 @@ def generate_iso(): buf = newbuf karg_area_end = re.search(r'(#+) COREOS_KARG_EMBED_AREA\n', buf) if karg_area_end is not None: + if len(default_kargs) == 0: + default_kargs = buf[karg_area_start.start():karg_area_end.end()] + files_with_karg_embed_areas['.cmdline'] = 0 + cmdline = os.path.join(tmpisoroot, '.cmdline') + with open(cmdline, 'w') as fh: + fh.write(default_kargs if len(default_kargs) != 0 else kargs) + length = karg_area_end.start() + len(karg_area_end[1]) - karg_area_start.start() files_with_karg_embed_areas[filename] = karg_area_start.start() if karg_embed_area_length == 0: @@ -519,7 +527,7 @@ def generate_iso(): ISO_SYSTEM_AREA_SIZE = 32768 # number of karg files we allow for in the format - MAX_KARG_FILES = 6 + MAX_KARG_FILES = 7 assert len(files_with_karg_embed_areas) <= MAX_KARG_FILES # these can really never change without ratcheting on the @@ -527,7 +535,7 @@ def generate_iso(): INITRDFMT = '<8s2Q' assert struct.calcsize(INITRDFMT) == 24 KARGSFMT = f"<8s{MAX_KARG_FILES+1}Q" # +1 for area length - assert struct.calcsize(KARGSFMT) == 64 + assert struct.calcsize(KARGSFMT) == 72 # Start of the Ignition padding within the ISO offset = file_offset_in_iso(isoinfo, ignition_img)