Skip to content

Commit

Permalink
rpmostree: Use --merge for kargs
Browse files Browse the repository at this point in the history
Without `--merge`, all kernel arguments will be replaced, which is
not what is desired in general. Especially with bootc karg support
which we definitely want to work with Anaconda.

Signed-off-by: Colin Walters <[email protected]>
(cherry picked from commit cb7276e)

Resolves: RHEL-73029
  • Loading branch information
cgwalters authored and jkonecny12 committed Jan 30, 2025
1 parent 51cba8e commit e8d8502
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -569,7 +569,7 @@ def _set_kargs(self):
device_tree.GetDeviceData(root_name)
)

set_kargs_args = ["admin", "instutil", "set-kargs"]
set_kargs_args = ["admin", "instutil", "set-kargs", "--merge"]
set_kargs_args.extend(bootloader.GetArguments())
set_kargs_args.append("root=" + device_tree.GetFstabSpec(root_name))

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -706,8 +706,15 @@ def test_btrfs_run(self, devdata_mock, storage_mock, symlink_mock, rename_mock,
)
exec_mock.assert_called_once_with(
"ostree",
["admin", "instutil", "set-kargs", "BOOTLOADER-ARGS", "root=FSTAB-SPEC",
"rootflags=subvol=device-name", "rw"],
["admin",
"instutil",
"set-kargs",
"--merge",
"BOOTLOADER-ARGS",
"root=FSTAB-SPEC",
"rootflags=subvol=device-name",
"rw"
],
root=sysroot
)

Expand Down Expand Up @@ -743,7 +750,14 @@ def test_nonbtrfs_run(self, devdata_mock, storage_mock, symlink_mock, rename_moc
)
exec_mock.assert_called_once_with(
"ostree",
["admin", "instutil", "set-kargs", "BOOTLOADER-ARGS", "root=FSTAB-SPEC", "rw"],
["admin",
"instutil",
"set-kargs",
"--merge",
"BOOTLOADER-ARGS",
"root=FSTAB-SPEC",
"rw"
],
root=sysroot
)

Expand Down Expand Up @@ -826,7 +840,14 @@ def test_bootupd_run_with_leavebootorder(self, devdata_mock, storage_mock, symli
),
call(
"ostree",
["admin", "instutil", "set-kargs", "BOOTLOADER-ARGS", "root=FSTAB-SPEC", "rw"],
["admin",
"instutil",
"set-kargs",
"--merge",
"BOOTLOADER-ARGS",
"root=FSTAB-SPEC",
"rw"
],
root=sysroot
)
])
Expand Down

0 comments on commit e8d8502

Please sign in to comment.