Skip to content

Commit

Permalink
install: Track if we already had an ostree repo in rootfs
Browse files Browse the repository at this point in the history
Prep for containers#137

Signed-off-by: Colin Walters <[email protected]>
  • Loading branch information
cgwalters committed Nov 5, 2024
1 parent 07593a0 commit d4f7f97
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lib/src/install.rs
Original file line number Diff line number Diff line change
Expand Up @@ -877,6 +877,9 @@ fn require_skopeo_with_containers_storage() -> Result<()> {
pub(crate) struct RootSetup {
luks_device: Option<String>,
device_info: crate::blockdev::PartitionTable,
/// True if the rootfs already had /ostree
#[allow(dead_code)]
has_ostree: bool,
rootfs: Utf8PathBuf,
rootfs_fd: Dir,
rootfs_uuid: Option<String>,
Expand Down Expand Up @@ -1744,6 +1747,9 @@ pub(crate) async fn install_to_filesystem(

let skip_finalize =
matches!(fsopts.replace, Some(ReplaceMode::Alongside)) || fsopts.skip_finalize;
let has_ostree = rootfs_fd
.try_exists("ostree/repo")
.context("Querying extant ostree repo")?;
let mut rootfs = RootSetup {
luks_device: None,
device_info,
Expand All @@ -1753,6 +1759,7 @@ pub(crate) async fn install_to_filesystem(
boot,
kargs,
skip_finalize,
has_ostree,
};

install_to_filesystem_impl(&state, &mut rootfs).await?;
Expand Down
1 change: 1 addition & 0 deletions lib/src/install/baseline.rs
Original file line number Diff line number Diff line change
Expand Up @@ -428,5 +428,6 @@ pub(crate) fn install_create_rootfs(
boot,
kargs,
skip_finalize: false,
has_ostree: false, // Must not exist yet
})
}

0 comments on commit d4f7f97

Please sign in to comment.