Skip to content

Commit

Permalink
Implement --replace also for S390
Browse files Browse the repository at this point in the history
  • Loading branch information
sstark authored and bcl committed Jun 25, 2024
1 parent ff5f2ef commit 62c7426
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/bin/mkksiso
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ def EditGrub2(rm_args, add_args, replace_list, tmpdir):
os.replace(orig_cfg + ".new", orig_cfg)


def EditS390(rm_args, add_args, new_volid, old_volid, tmpdir):
def EditS390(rm_args, add_args, replace_list, tmpdir):
"""
Modify the cmdline for s390 config files
Add the new arguments and change existing volid if requested
Expand All @@ -388,8 +388,6 @@ def EditS390(rm_args, add_args, new_volid, old_volid, tmpdir):
log.warning("No s390 config files found")
return

change_volid = old_volid != new_volid

for cfg in s390_cfgs:
orig_cfg = tmpdir + "/" + cfg
if not os.path.exists(orig_cfg):
Expand All @@ -402,8 +400,9 @@ def EditS390(rm_args, add_args, new_volid, old_volid, tmpdir):

cmdline = " ".join(l.strip() for l in lines)
# Replace the volid
if change_volid and old_volid in cmdline:
cmdline = cmdline.replace(old_volid, new_volid)
for from_item, to_item in replace_list:
if from_item in cmdline:
cmdline = cmdline.replace(from_item, to_item)
args = SplitCmdline(cmdline)
new_args = AlterKernelArgs(args, rm_args, add_args)

Expand Down Expand Up @@ -481,7 +480,7 @@ def MakeKickstartISO(input_iso, output_iso, ks="", updates_image="", add_paths=N
# Add kickstart command and optionally change the volid of the available config files
EditIsolinux(remove_args, add_args, replace_list, tmpdir)
EditGrub2(remove_args, add_args, replace_list, tmpdir)
EditS390(remove_args, add_args, new_volid, old_volid, tmpdir)
EditS390(remove_args, add_args, replace_list, tmpdir)

if os.uname().machine.startswith("s390"):
RebuildS390CDBoot(tmpdir)
Expand Down

0 comments on commit 62c7426

Please sign in to comment.