Skip to content

Commit

Permalink
rpmostree-postprocess.cxx: remove var/ in unified core mode
Browse files Browse the repository at this point in the history
With Jonathan's suggestion:
In unified core mode, /var entries are converted to tmpfiles.d at
import time and scriptlets are prevented from writing to /var. What
remains is just the compat symlinks that we created ourselves, which
we should stop writing since it duplicates other tmpfiles.d entries.
  • Loading branch information
HuijingHei committed Dec 5, 2023
1 parent 79ad6a7 commit ce207c9
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion src/libpriv/rpmostree-postprocess.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,20 @@ postprocess_final (int rootfs_dfd, rpmostreecxx::Treefile &treefile, gboolean un

ROSCXX_TRY (rootfs_prepare_links (rootfs_dfd), error);

ROSCXX_TRY (convert_var_to_tmpfiles_d (rootfs_dfd, *cancellable), error);
if (!unified_core_mode)
ROSCXX_TRY (convert_var_to_tmpfiles_d (rootfs_dfd, *cancellable), error);
else
{
/* In unified core mode, /var entries are converted to tmpfiles.d at
* import time and scriptlets are prevented from writing to /var. What
* remains is just the compat symlinks that we created ourselves, which we
* should stop writing since it duplicates other tmpfiles.d entries. */
if (!glnx_shutil_rm_rf_at (rootfs_dfd, "var", cancellable, error))
return FALSE;
/* but we still want the mount point as part of the OSTree commit */
if (mkdirat (rootfs_dfd, "var", 0755) < 0)
return glnx_throw_errno_prefix (error, "mkdirat(var)");
}

if (!rpmostree_rootfs_postprocess_common (rootfs_dfd, cancellable, error))
return FALSE;
Expand Down

0 comments on commit ce207c9

Please sign in to comment.