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 15, 2024
1 parent 1135fcb commit 806a99e
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 @@ -842,6 +842,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 @@ -1766,4 +1767,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 806a99e

Please sign in to comment.