(
state: &State,
rootfs: &mut RootSetup,
cleanup: Cleanup,
)
| 1991 | } |
| 1992 | |
| 1993 | async fn install_to_filesystem_impl( |
| 1994 | state: &State, |
| 1995 | rootfs: &mut RootSetup, |
| 1996 | cleanup: Cleanup, |
| 1997 | ) -> Result<()> { |
| 1998 | if matches!(state.selinux_state, SELinuxFinalState::ForceTargetDisabled) { |
| 1999 | rootfs.kargs.extend(&Cmdline::from("selinux=0")); |
| 2000 | } |
| 2001 | // Drop exclusive ownership since we're done with mutation |
| 2002 | let rootfs = &*rootfs; |
| 2003 | |
| 2004 | match rootfs.device_info.pttype.as_deref() { |
| 2005 | Some("dos") => crate::utils::medium_visibility_warning( |
| 2006 | "Installing to `dos` format partitions is not recommended", |
| 2007 | ), |
| 2008 | Some("gpt") => { |
| 2009 | // The only thing we should be using in general |
| 2010 | } |
| 2011 | Some(o) => { |
| 2012 | crate::utils::medium_visibility_warning(&format!("Unknown partition table type {o}")) |
| 2013 | } |
| 2014 | None => { |
| 2015 | // No partition table type - may be a filesystem install or loop device |
| 2016 | } |
| 2017 | } |
| 2018 | |
| 2019 | if state.composefs_options.composefs_backend { |
| 2020 | // Pre-flight disk space check for native composefs install path. |
| 2021 | { |
| 2022 | let imgref = &state.source.imageref; |
| 2023 | let img_manifest_config = get_container_manifest_and_config(&imgref).await?; |
| 2024 | crate::store::ensure_composefs_dir(&rootfs.physical_root)?; |
| 2025 | // Use init_path since the repo may not exist yet during install |
| 2026 | let config = |
| 2027 | RepositoryConfig::new(composefs_ctl::composefs::fsverity::Algorithm::SHA512) |
| 2028 | .set_insecure(); |
| 2029 | let (cfs_repo, _created) = crate::store::ComposefsRepository::init_path( |
| 2030 | &rootfs.physical_root, |
| 2031 | crate::store::COMPOSEFS, |
| 2032 | config, |
| 2033 | )?; |
| 2034 | crate::deploy::check_disk_space_composefs( |
| 2035 | &cfs_repo, |
| 2036 | &img_manifest_config.manifest, |
| 2037 | &crate::spec::ImageReference { |
| 2038 | image: imgref.name.clone(), |
| 2039 | transport: imgref.transport.to_string(), |
| 2040 | signature: None, |
| 2041 | }, |
| 2042 | )?; |
| 2043 | } |
| 2044 | let pull_result = initialize_composefs_repository( |
| 2045 | state, |
| 2046 | rootfs, |
| 2047 | state.composefs_options.allow_missing_verity, |
| 2048 | state.target_opts.unified_storage_exp, |
| 2049 | ) |
| 2050 | .await?; |
no test coverage detected