@@ -79,8 +79,8 @@ use crate::boundimage::{BoundImage, ResolvedBoundImage};
7979use  crate :: composefs_consts:: { 
8080    BOOT_LOADER_ENTRIES ,  COMPOSEFS_CMDLINE ,  COMPOSEFS_INSECURE_CMDLINE , 
8181    COMPOSEFS_STAGED_DEPLOYMENT_FNAME ,  COMPOSEFS_TRANSIENT_STATE_DIR ,  ORIGIN_KEY_BOOT , 
82-     ORIGIN_KEY_BOOT_DIGEST ,  ORIGIN_KEY_BOOT_TYPE ,  STAGED_BOOT_LOADER_ENTRIES ,   STATE_DIR_ABS , 
83-     STATE_DIR_RELATIVE ,  USER_CFG ,  USER_CFG_STAGED , 
82+     ORIGIN_KEY_BOOT_DIGEST ,  ORIGIN_KEY_BOOT_TYPE ,  SHARED_VAR_PATH ,   STAGED_BOOT_LOADER_ENTRIES , 
83+     STATE_DIR_ABS ,   STATE_DIR_RELATIVE ,  USER_CFG ,  USER_CFG_STAGED , 
8484} ; 
8585use  crate :: containerenv:: ContainerExecutionInfo ; 
8686use  crate :: deploy:: { 
@@ -93,7 +93,7 @@ use crate::progress_jsonl::ProgressWriter;
9393use  crate :: spec:: ImageReference ; 
9494use  crate :: store:: Storage ; 
9595use  crate :: task:: Task ; 
96- use  crate :: utils:: sigpolicy_from_opt; 
96+ use  crate :: utils:: { path_relative_to ,   sigpolicy_from_opt} ; 
9797use  bootc_mount:: { inspect_filesystem,  Filesystem } ; 
9898
9999/// The toplevel boot directory 
@@ -2189,11 +2189,15 @@ pub(crate) fn write_composefs_state(
21892189    create_dir_all ( state_path. join ( "etc/upper" ) ) ?; 
21902190    create_dir_all ( state_path. join ( "etc/work" ) ) ?; 
21912191
2192-     let  actual_var_path = root_path. join ( format ! ( "state/os/fedora/var" ) ) ; 
2192+     let  actual_var_path = root_path. join ( SHARED_VAR_PATH ) ; 
21932193    create_dir_all ( & actual_var_path) ?; 
21942194
2195-     symlink ( Path :: new ( "../../os/fedora/var" ) ,  state_path. join ( "var" ) ) 
2196-         . context ( "Failed to create symlink for /var" ) ?; 
2195+     symlink ( 
2196+         path_relative_to ( state_path. as_std_path ( ) ,  actual_var_path. as_std_path ( ) ) 
2197+             . context ( "Getting var symlink path" ) ?, 
2198+         state_path. join ( "var" ) , 
2199+     ) 
2200+     . context ( "Failed to create symlink for /var" ) ?; 
21972201
21982202    let  ImageReference  { 
21992203        image :  image_name, 
0 commit comments