Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

storaged: Use kernelopt.sh to set rd.neednet=1 #20422

Merged
merged 2 commits into from
May 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pkg/systemd/kernelopt.sh → pkg/lib/kernelopt.sh
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ update_zipl() {
# main
#

if [ -z "${2:-}" -o -n "${3:-}" ] || [ "$1" != "set" -a "$1" != "remove" ]; then
if [ -z "${2:-}" ] || [ -n "${3:-}" ] || [ "$1" != "set" -a "$1" != "remove" ]; then
Dismissed Show dismissed Hide dismissed
error "Usage: '$0 set <option>[=<value>]' or '$0 remove <option>'"
fi

Expand Down
6 changes: 4 additions & 2 deletions pkg/storaged/crypto/keyslots.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ import { EmptyState, EmptyStateBody } from "@patternfly/react-core/dist/esm/comp

import { check_missing_packages, install_missing_packages, Enum as PkEnum } from "packagekit";
import { fmt_to_fragments } from "utils.jsx";
import kernelopt_sh from "kernelopt.sh";

import { remember_passphrase } from "../anaconda.jsx";

import {
Expand Down Expand Up @@ -320,8 +322,8 @@ function ensure_initrd_clevis_support(steps, progress, package_name) {

function ensure_root_nbde_support(steps, progress) {
progress(_("Adding rd.neednet=1 to kernel command line"), null);
return cockpit.spawn(["grubby", "--update-kernel=ALL", "--args=rd.neednet=1"],
{ superuser: "require", err: "message" })
return cockpit.script(kernelopt_sh, ["set", "rd.neednet=1"],
{ superuser: "require", err: "message" })
.then(() => ensure_initrd_clevis_support(steps, progress, "clevis-dracut"));
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/systemd/hwinfo.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ import { SortByDirection } from "@patternfly/react-table";
import { ListingTable } from "cockpit-components-table.jsx";
import { WithDialogs, useDialogs } from "dialogs.jsx";

import kernelopt_sh from "./kernelopt.sh";
import kernelopt_sh from "kernelopt.sh";
import detect from "./hw-detect.js";

import { superuser } from "superuser";
Expand Down
2 changes: 1 addition & 1 deletion test/verify/check-system-info
Original file line number Diff line number Diff line change
Expand Up @@ -583,7 +583,7 @@ fi
self.assertNotIn('nosmt', m.execute('cat /proc/cmdline'))

# updates mitigations=nosmt when that is present
m.upload(["../pkg/systemd/kernelopt.sh"], "/tmp/")
m.upload(["../pkg/lib/kernelopt.sh"], "/tmp/")
m.execute("/tmp/kernelopt.sh remove nosmt; /tmp/kernelopt.sh set mitigations=auto,nosmt")
m.reboot()
self.login_and_go('/system/hwinfo')
Expand Down