Implementation of `bootc install finalize`.
(target: &Utf8Path)
| 2921 | |
| 2922 | /// Implementation of `bootc install finalize`. |
| 2923 | pub(crate) async fn install_finalize(target: &Utf8Path) -> Result<()> { |
| 2924 | // Log the installation finalization operation to systemd journal |
| 2925 | const INSTALL_FINALIZE_JOURNAL_ID: &str = "6d5e4f3a2b1c0d9e8f7a6b5c4d3e2f1a0"; |
| 2926 | |
| 2927 | tracing::info!( |
| 2928 | message_id = INSTALL_FINALIZE_JOURNAL_ID, |
| 2929 | bootc.target_path = target.as_str(), |
| 2930 | "Starting installation finalization for target: {}", |
| 2931 | target |
| 2932 | ); |
| 2933 | |
| 2934 | crate::cli::require_root(false)?; |
| 2935 | let sysroot = ostree::Sysroot::new(Some(&gio::File::for_path(target))); |
| 2936 | sysroot.load(gio::Cancellable::NONE)?; |
| 2937 | let deployments = sysroot.deployments(); |
| 2938 | // Verify we find a deployment |
| 2939 | if deployments.is_empty() { |
| 2940 | anyhow::bail!("Failed to find deployment in {target}"); |
| 2941 | } |
| 2942 | |
| 2943 | // Log successful finalization |
| 2944 | tracing::info!( |
| 2945 | message_id = INSTALL_FINALIZE_JOURNAL_ID, |
| 2946 | bootc.target_path = target.as_str(), |
| 2947 | "Successfully finalized installation for target: {}", |
| 2948 | target |
| 2949 | ); |
| 2950 | |
| 2951 | // For now that's it! We expect to add more validation/postprocessing |
| 2952 | // later, such as munging `etc/fstab` if needed. See |
| 2953 | |
| 2954 | Ok(()) |
| 2955 | } |
| 2956 | |
| 2957 | #[cfg(test)] |
| 2958 | mod tests { |
no test coverage detected