diff --git a/pkg/storaged/block/format-dialog.jsx b/pkg/storaged/block/format-dialog.jsx index 85350690961a..4b226c2d668e 100644 --- a/pkg/storaged/block/format-dialog.jsx +++ b/pkg/storaged/block/format-dialog.jsx @@ -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") @@ -519,7 +519,7 @@ 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"); @@ -527,7 +527,7 @@ function format_dialog_internal(client, path, start, size, enable_dos_extended, 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; diff --git a/pkg/storaged/filesystem/mounting-dialog.jsx b/pkg/storaged/filesystem/mounting-dialog.jsx index 0fc437a86a08..0ed7323bcfc6 100644 --- a/pkg/storaged/filesystem/mounting-dialog.jsx +++ b/pkg/storaged/filesystem/mounting-dialog.jsx @@ -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 @@ -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: [ diff --git a/pkg/storaged/stratis/pool.jsx b/pkg/storaged/stratis/pool.jsx index bf90a70db9d1..3ff397e41c93 100644 --- a/pkg/storaged/stratis/pool.jsx +++ b/pkg/storaged/stratis/pool.jsx @@ -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") diff --git a/pkg/storaged/stratis/utils.jsx b/pkg/storaged/stratis/utils.jsx index f19e0742e2c6..e2278dd792cc 100644 --- a/pkg/storaged/stratis/utils.jsx +++ b/pkg/storaged/stratis/utils.jsx @@ -130,7 +130,7 @@ 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"); @@ -138,7 +138,7 @@ export function set_mount_options(path, vals, forced_options) { 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);