+ Anaconda will tell us here what is wrong with the current config.
+
+ );
+};
diff --git a/pkg/storaged/client.js b/pkg/storaged/client.js
index 6dd9f43ec9c..85a5e14c7db 100644
--- a/pkg/storaged/client.js
+++ b/pkg/storaged/client.js
@@ -591,6 +591,7 @@ client.update = (first_time) => {
update_indices();
client.path_warnings = find_warnings(client);
create_pages();
+ client.export_mount_point_mapping();
client.dispatchEvent("changed");
}
};
@@ -721,6 +722,15 @@ function init_model(callback) {
).then(() => info);
}
+ try {
+ client.anaconda = JSON.parse(window.localStorage.getItem("cockpit_anaconda"));
+ } catch {
+ console.warn("Can't parse cockpit_anaconda configuration as JSON");
+ client.anaconda = null;
+ }
+
+ console.log("ANACONDA", client.anaconda);
+
pull_time().then(() => {
read_os_release().then(os_release => {
client.os_release = os_release;
@@ -1464,4 +1474,56 @@ client.get_config = (name, def) => {
}
};
+client.in_anaconda_mode = () => !!client.anaconda;
+
+client.strip_mount_point_prefix = (dir) => {
+ const mpp = client.anaconda?.mount_point_prefix;
+
+ if (dir && mpp) {
+ if (dir.indexOf(mpp) != 0)
+ return false;
+
+ dir = dir.substr(mpp.length);
+ if (dir == "")
+ dir = "/";
+ }
+
+ return dir;
+};
+
+client.add_mount_point_prefix = (dir) => {
+ const mpp = client.anaconda?.mount_point_prefix;
+ if (mpp) {
+ if (dir == "/")
+ dir = mpp;
+ else
+ dir = mpp + dir;
+ }
+ return dir;
+};
+
+client.should_ignore_device = (devname) => {
+ return client.anaconda?.ignore_devices && client.anaconda.ignore_devices.indexOf(devname) != -1;
+};
+
+client.should_ignore_block = (block) => {
+ return client.should_ignore_device(utils.decode_filename(block.PreferredDevice));
+};
+
+client.export_mount_point_mapping = () => {
+ const mpm = { };
+ for (const p in client.blocks) {
+ const b = client.blocks[p];
+ for (const c of b.Configuration) {
+ if (c[0] == "fstab") {
+ const dir = client.strip_mount_point_prefix(utils.decode_filename(c[1].dir.v));
+ if (dir)
+ mpm[dir] = utils.decode_filename(b.PreferredDevice);
+ }
+ }
+ }
+
+ window.localStorage.setItem("cockpit_mount_points", JSON.stringify(mpm));
+};
+
export default client;
diff --git a/pkg/storaged/content-views.jsx b/pkg/storaged/content-views.jsx
index aea8e65f0ac..8c94a3f12dd 100644
--- a/pkg/storaged/content-views.jsx
+++ b/pkg/storaged/content-views.jsx
@@ -509,7 +509,7 @@ function block_description(client, block, options) {
type = cockpit.format(C_("storage-id-desc", "$0 filesystem"), block.IdType);
if (client.fsys_sizes.data[mount_point])
size = client.fsys_sizes.data[mount_point];
- used_for = mount_point;
+ used_for = client.strip_mount_point_prefix(mount_point);
} else if (block.IdUsage == "raid") {
if (block_pvol && client.vgroups[block_pvol.VolumeGroup]) {
const vgroup = client.vgroups[block_pvol.VolumeGroup];
@@ -601,6 +601,18 @@ function append_row(client, rows, level, key, name, desc, tabs, job_object, opti
if (info)
info = <>{"\n"}{info}>;
+ let location;
+ if (desc.used_for === false) {
+ // XXX - urks
+ location = _("(Not part of target)");
+ menu = null;
+ tabs.actions = null;
+ tabs.renderers = [];
+ } else if (desc.link)
+ location =