Skip to content

Commit

Permalink
storage: Don't bother with mount options in Anaconda mode
Browse files Browse the repository at this point in the history
Anaconda will impose their own anyway.
  • Loading branch information
mvollmer committed Jan 30, 2024
1 parent ac54438 commit b78ee80
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
8 changes: 4 additions & 4 deletions pkg/storaged/block/format-dialog.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -421,8 +421,8 @@ function format_dialog_internal(client, path, start, size, enable_dos_extended,
})
]
}),
at_boot_input(at_boot, is_filesystem),
mount_options(opt_ro, extra_options, is_filesystem),
at_boot_input(at_boot, vals => is_filesystem(vals) && !client.in_anaconda_mode()),
mount_options(opt_ro, extra_options, vals => is_filesystem(vals) && !client.in_anaconda_mode()),
],
update: function (dlg, vals, trigger) {
if (trigger == "at_boot")
Expand Down Expand Up @@ -519,15 +519,15 @@ function format_dialog_internal(client, path, start, size, enable_dos_extended,
if (!mount_now || vals.at_boot == "never") {
mount_options.push("noauto");
}
if (vals.mount_options.ro)
if (vals.mount_options?.ro)
mount_options.push("ro");
if (vals.at_boot == "never")
mount_options.push("x-cockpit-never-auto");
if (vals.at_boot == "nofail")
mount_options.push("nofail");
if (vals.at_boot == "netdev")
mount_options.push("_netdev");
if (vals.mount_options.extra)
if (vals.mount_options?.extra)
mount_options.push(vals.mount_options.extra);

mount_point = vals.mount_point;
Expand Down
8 changes: 4 additions & 4 deletions pkg/storaged/filesystem/mounting-dialog.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@ import {

const _ = cockpit.gettext;

export const mount_options = (opt_ro, extra_options, is_filesystem) => {
export const mount_options = (opt_ro, extra_options, is_visible) => {
return CheckBoxes("mount_options", _("Mount options"),
{
visible: is_filesystem,
visible: is_visible,
value: {
ro: opt_ro,
extra: extra_options || false
Expand All @@ -57,10 +57,10 @@ export const mount_options = (opt_ro, extra_options, is_filesystem) => {
});
};

export const at_boot_input = (at_boot, is_filesystem) => {
export const at_boot_input = (at_boot, is_visible) => {
return SelectOne("at_boot", _("At boot"),
{
visible: is_filesystem,
visible: is_visible,
value: at_boot,
explanation: mount_explanation[at_boot],
choices: [
Expand Down
4 changes: 2 additions & 2 deletions pkg/storaged/stratis/pool.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,8 @@ function create_fs(pool) {
variant == "nomount");
}
}),
mount_options(false, false),
at_boot_input(client.in_anaconda_mode() ? "local" : "nofail"),
mount_options(false, false, () => !client.in_anaconda_mode()),
at_boot_input(client.in_anaconda_mode() ? "local" : "nofail", () => !client.in_anaconda_mode()),
],
update: function (dlg, vals, trigger) {
if (trigger == "at_boot")
Expand Down
4 changes: 2 additions & 2 deletions pkg/storaged/stratis/utils.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -130,15 +130,15 @@ export function set_mount_options(path, vals, forced_options) {

if (vals.variant == "nomount" || vals.at_boot == "never")
mount_options.push("noauto");
if (vals.mount_options.ro)
if (vals.mount_options?.ro)
mount_options.push("ro");
if (vals.at_boot == "never")
mount_options.push("x-cockpit-never-auto");
if (vals.at_boot == "nofail")
mount_options.push("nofail");
if (vals.at_boot == "netdev")
mount_options.push("_netdev");
if (vals.mount_options.extra)
if (vals.mount_options?.extra)
mount_options.push(vals.mount_options.extra);

mount_options = mount_options.concat(forced_options);
Expand Down

0 comments on commit b78ee80

Please sign in to comment.