diff --git a/rpmostree-cxxrs.cxx b/rpmostree-cxxrs.cxx index ad66b314d0..8b354e096a 100644 --- a/rpmostree-cxxrs.cxx +++ b/rpmostree-cxxrs.cxx @@ -2172,6 +2172,9 @@ extern "C" ::rust::repr::PtrLen rpmostreecxx$cxxbridge1$compose_postprocess_final_pre (::std::int32_t rootfs_dfd) noexcept; + ::rust::repr::PtrLen rpmostreecxx$cxxbridge1$compose_postprocess_final ( + ::std::int32_t rootfs_dfd, ::rpmostreecxx::Treefile const &treefile) noexcept; + ::rust::repr::PtrLen rpmostreecxx$cxxbridge1$convert_var_to_tmpfiles_d ( ::std::int32_t rootfs_dfd, ::rpmostreecxx::GCancellable const &cancellable) noexcept; @@ -2181,9 +2184,6 @@ extern "C" ::rust::repr::PtrLen rpmostreecxx$cxxbridge1$workaround_selinux_cross_labeling ( ::std::int32_t rootfs_dfd, ::rpmostreecxx::GCancellable &cancellable) noexcept; - ::rust::repr::PtrLen rpmostreecxx$cxxbridge1$prepare_rpmdb_base_location ( - ::std::int32_t rootfs_dfd, ::rpmostreecxx::GCancellable &cancellable) noexcept; - ::rust::repr::PtrLen rpmostreecxx$cxxbridge1$compose_postprocess_rpm_macro (::std::int32_t rootfs_dfd) noexcept; @@ -3969,11 +3969,10 @@ compose_postprocess_final_pre (::std::int32_t rootfs_dfd) } void -convert_var_to_tmpfiles_d (::std::int32_t rootfs_dfd, - ::rpmostreecxx::GCancellable const &cancellable) +compose_postprocess_final (::std::int32_t rootfs_dfd, ::rpmostreecxx::Treefile const &treefile) { ::rust::repr::PtrLen error$ - = rpmostreecxx$cxxbridge1$convert_var_to_tmpfiles_d (rootfs_dfd, cancellable); + = rpmostreecxx$cxxbridge1$compose_postprocess_final (rootfs_dfd, treefile); if (error$.ptr) { throw ::rust::impl< ::rust::Error>::error (error$); @@ -3981,9 +3980,11 @@ convert_var_to_tmpfiles_d (::std::int32_t rootfs_dfd, } void -rootfs_prepare_links (::std::int32_t rootfs_dfd) +convert_var_to_tmpfiles_d (::std::int32_t rootfs_dfd, + ::rpmostreecxx::GCancellable const &cancellable) { - ::rust::repr::PtrLen error$ = rpmostreecxx$cxxbridge1$rootfs_prepare_links (rootfs_dfd); + ::rust::repr::PtrLen error$ + = rpmostreecxx$cxxbridge1$convert_var_to_tmpfiles_d (rootfs_dfd, cancellable); if (error$.ptr) { throw ::rust::impl< ::rust::Error>::error (error$); @@ -3991,11 +3992,9 @@ rootfs_prepare_links (::std::int32_t rootfs_dfd) } void -workaround_selinux_cross_labeling (::std::int32_t rootfs_dfd, - ::rpmostreecxx::GCancellable &cancellable) +rootfs_prepare_links (::std::int32_t rootfs_dfd) { - ::rust::repr::PtrLen error$ - = rpmostreecxx$cxxbridge1$workaround_selinux_cross_labeling (rootfs_dfd, cancellable); + ::rust::repr::PtrLen error$ = rpmostreecxx$cxxbridge1$rootfs_prepare_links (rootfs_dfd); if (error$.ptr) { throw ::rust::impl< ::rust::Error>::error (error$); @@ -4003,10 +4002,11 @@ workaround_selinux_cross_labeling (::std::int32_t rootfs_dfd, } void -prepare_rpmdb_base_location (::std::int32_t rootfs_dfd, ::rpmostreecxx::GCancellable &cancellable) +workaround_selinux_cross_labeling (::std::int32_t rootfs_dfd, + ::rpmostreecxx::GCancellable &cancellable) { ::rust::repr::PtrLen error$ - = rpmostreecxx$cxxbridge1$prepare_rpmdb_base_location (rootfs_dfd, cancellable); + = rpmostreecxx$cxxbridge1$workaround_selinux_cross_labeling (rootfs_dfd, cancellable); if (error$.ptr) { throw ::rust::impl< ::rust::Error>::error (error$); diff --git a/rpmostree-cxxrs.h b/rpmostree-cxxrs.h index f71836ce25..8736d14131 100644 --- a/rpmostree-cxxrs.h +++ b/rpmostree-cxxrs.h @@ -1842,6 +1842,9 @@ void compose_postprocess (::std::int32_t rootfs_dfd, ::rpmostreecxx::Treefile &t void compose_postprocess_final_pre (::std::int32_t rootfs_dfd); +void compose_postprocess_final (::std::int32_t rootfs_dfd, + ::rpmostreecxx::Treefile const &treefile); + void convert_var_to_tmpfiles_d (::std::int32_t rootfs_dfd, ::rpmostreecxx::GCancellable const &cancellable); @@ -1850,9 +1853,6 @@ void rootfs_prepare_links (::std::int32_t rootfs_dfd); void workaround_selinux_cross_labeling (::std::int32_t rootfs_dfd, ::rpmostreecxx::GCancellable &cancellable); -void prepare_rpmdb_base_location (::std::int32_t rootfs_dfd, - ::rpmostreecxx::GCancellable &cancellable); - void compose_postprocess_rpm_macro (::std::int32_t rootfs_dfd); void postprocess_cleanup_rpmdb (::std::int32_t rootfs_dfd); diff --git a/rust/src/composepost.rs b/rust/src/composepost.rs index 43174c23e0..38b30dc4d3 100644 --- a/rust/src/composepost.rs +++ b/rust/src/composepost.rs @@ -1028,14 +1028,11 @@ fn workaround_selinux_cross_labeling_recurse( Ok(()) } -pub fn prepare_rpmdb_base_location( - rootfs_dfd: i32, - cancellable: Pin<&mut crate::FFIGCancellable>, -) -> CxxResult<()> { +/// This is the nearly the last code executed before we run `ostree commit`. +pub fn compose_postprocess_final(rootfs_dfd: i32, _treefile: &Treefile) -> CxxResult<()> { let rootfs = unsafe { &crate::ffiutil::ffi_dirfd(rootfs_dfd)? }; - let cancellable = &cancellable.gobj_wrap(); - hardlink_rpmdb_base_location(rootfs, Some(cancellable))?; + hardlink_rpmdb_base_location(rootfs, None)?; Ok(()) } diff --git a/rust/src/lib.rs b/rust/src/lib.rs index 318f0bca4e..459131e082 100644 --- a/rust/src/lib.rs +++ b/rust/src/lib.rs @@ -290,16 +290,13 @@ pub mod ffi { unified_core: bool, ) -> Result<()>; fn compose_postprocess_final_pre(rootfs_dfd: i32) -> Result<()>; + fn compose_postprocess_final(rootfs_dfd: i32, treefile: &Treefile) -> Result<()>; fn convert_var_to_tmpfiles_d(rootfs_dfd: i32, cancellable: &GCancellable) -> Result<()>; fn rootfs_prepare_links(rootfs_dfd: i32) -> Result<()>; fn workaround_selinux_cross_labeling( rootfs_dfd: i32, cancellable: Pin<&mut GCancellable>, ) -> Result<()>; - fn prepare_rpmdb_base_location( - rootfs_dfd: i32, - cancellable: Pin<&mut GCancellable>, - ) -> Result<()>; fn compose_postprocess_rpm_macro(rootfs_dfd: i32) -> Result<()>; fn postprocess_cleanup_rpmdb(rootfs_dfd: i32) -> Result<()>; fn rewrite_rpmdb_for_target(rootfs_dfd: i32, normalize: bool) -> Result<()>; diff --git a/src/libpriv/rpmostree-postprocess.cxx b/src/libpriv/rpmostree-postprocess.cxx index 7d34ca0549..761ff20b9e 100644 --- a/src/libpriv/rpmostree-postprocess.cxx +++ b/src/libpriv/rpmostree-postprocess.cxx @@ -462,8 +462,8 @@ postprocess_final (int rootfs_dfd, rpmostreecxx::Treefile &treefile, gboolean un return glnx_prefix_error (error, "During kernel processing"); } - /* we're composing a new tree; copy the rpmdb to the base location */ - ROSCXX_TRY (prepare_rpmdb_base_location (rootfs_dfd, *cancellable), error); + /* And now the penultimate postprocessing */ + ROSCXX_TRY (compose_postprocess_final (rootfs_dfd, treefile), error); return TRUE; }