Skip to content

Commit d4f7f97

Browse files
committed
install: Track if we already had an ostree repo in rootfs
Prep for #137 Signed-off-by: Colin Walters <[email protected]>
1 parent 07593a0 commit d4f7f97

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

lib/src/install.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -877,6 +877,9 @@ fn require_skopeo_with_containers_storage() -> Result<()> {
877877
pub(crate) struct RootSetup {
878878
luks_device: Option<String>,
879879
device_info: crate::blockdev::PartitionTable,
880+
/// True if the rootfs already had /ostree
881+
#[allow(dead_code)]
882+
has_ostree: bool,
880883
rootfs: Utf8PathBuf,
881884
rootfs_fd: Dir,
882885
rootfs_uuid: Option<String>,
@@ -1744,6 +1747,9 @@ pub(crate) async fn install_to_filesystem(
17441747

17451748
let skip_finalize =
17461749
matches!(fsopts.replace, Some(ReplaceMode::Alongside)) || fsopts.skip_finalize;
1750+
let has_ostree = rootfs_fd
1751+
.try_exists("ostree/repo")
1752+
.context("Querying extant ostree repo")?;
17471753
let mut rootfs = RootSetup {
17481754
luks_device: None,
17491755
device_info,
@@ -1753,6 +1759,7 @@ pub(crate) async fn install_to_filesystem(
17531759
boot,
17541760
kargs,
17551761
skip_finalize,
1762+
has_ostree,
17561763
};
17571764

17581765
install_to_filesystem_impl(&state, &mut rootfs).await?;

lib/src/install/baseline.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -428,5 +428,6 @@ pub(crate) fn install_create_rootfs(
428428
boot,
429429
kargs,
430430
skip_finalize: false,
431+
has_ostree: false, // Must not exist yet
431432
})
432433
}

0 commit comments

Comments
 (0)