Skip to content

Commit

Permalink
storage: Export mount points when in Anaconda mode
Browse files Browse the repository at this point in the history
  • Loading branch information
mvollmer committed Jan 3, 2024
1 parent ea9a84d commit 36f3514
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions pkg/storaged/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -609,6 +609,7 @@ client.update = (first_time) => {
client.ready = true;
if (client.ready) {
update_indices();
client.export_mount_point_mapping();
reset_pages();
make_overview_page();
client.dispatchEvent("changed");
Expand Down Expand Up @@ -1529,4 +1530,20 @@ 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;

0 comments on commit 36f3514

Please sign in to comment.