Skip to content

Commit 8e68e45

Browse files
install/composefs: Move state to /state/deploy/<image_id>
Also create `/var` inside `/state/deploy/<image_id>` as a symlink to `../../fedora/os/var` which is to be the case for every deployment Signed-off-by: Pragyan Poudyal <[email protected]>
1 parent 770a57b commit 8e68e45

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

lib/src/install.rs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1683,12 +1683,20 @@ fn setup_composefs_boot(root_setup: &RootSetup, state: &State, image_id: &str) -
16831683

16841684
let state_path = root_setup
16851685
.physical_root_path
1686-
.join(format!("state/{}", id.to_hex()));
1686+
.join(format!("state/deploy/{}", id.to_hex()));
16871687

1688-
create_dir_all(state_path.join("var"))?;
16891688
create_dir_all(state_path.join("etc/upper"))?;
16901689
create_dir_all(state_path.join("etc/work"))?;
16911690

1691+
let actual_var_path = root_setup
1692+
.physical_root_path
1693+
.join(format!("state/os/fedora/var"));
1694+
1695+
create_dir_all(&actual_var_path)?;
1696+
1697+
symlink(Path::new("../../os/fedora/var"), state_path.join("var"))
1698+
.context("Failed to create symlink for /var")?;
1699+
16921700
let OstreeExtImgRef {
16931701
name: image_name,
16941702
transport,

0 commit comments

Comments
 (0)