+ 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 2ce4cbdcc7ac..fdbc0067c770 100644
--- a/pkg/storaged/client.js
+++ b/pkg/storaged/client.js
@@ -479,6 +479,7 @@ function update_indices() {
client.update = () => {
update_indices();
client.path_warnings = find_warnings(client);
+ client.export_mount_point_mapping();
client.dispatchEvent("changed");
};
@@ -628,6 +629,15 @@ function init_model(callback) {
}
}
+ 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;
@@ -1371,4 +1381,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 23531db5c8e2..ec4b2015d3f1 100644
--- a/pkg/storaged/content-views.jsx
+++ b/pkg/storaged/content-views.jsx
@@ -467,7 +467,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];
@@ -559,6 +559,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 =