From b3e35c4161c530f818f4fdda3b4620b94ebbd866 Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Sun, 22 Oct 2023 13:12:59 -0400 Subject: [PATCH] install: Track `is_alongside` We're going to need to dispatch other behavior on this around the bootloader, so make it a generic thing. Signed-off-by: Colin Walters --- lib/src/install.rs | 8 ++++---- lib/src/install/baseline.rs | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/src/install.rs b/lib/src/install.rs index 32b632a89..69349c8fb 100644 --- a/lib/src/install.rs +++ b/lib/src/install.rs @@ -632,8 +632,8 @@ pub(crate) struct RootSetup { rootfs: Utf8PathBuf, rootfs_fd: Dir, rootfs_uuid: Option, - /// If true, do not try to remount the root read-only and flush the journal, etc. - skip_finalize: bool, + /// True if this is an "alongside" install where we didn't create the filesystem + is_alongside: bool, boot: Option, kargs: Vec, } @@ -882,7 +882,7 @@ async fn install_to_filesystem_impl(state: &State, rootfs: &mut RootSetup) -> Re .run()?; // Finalize mounted filesystems - if !rootfs.skip_finalize { + if !rootfs.is_alongside { let bootfs = rootfs.rootfs.join("boot"); for fs in [bootfs.as_path(), rootfs.rootfs.as_path()] { finalize_filesystem(fs)?; @@ -1112,7 +1112,7 @@ pub(crate) async fn install_to_filesystem(opts: InstallToFilesystemOpts) -> Resu rootfs_uuid: inspect.uuid.clone(), boot, kargs, - skip_finalize: matches!(fsopts.replace, Some(ReplaceMode::Alongside)), + is_alongside: matches!(fsopts.replace, Some(ReplaceMode::Alongside)), }; install_to_filesystem_impl(&state, &mut rootfs).await?; diff --git a/lib/src/install/baseline.rs b/lib/src/install/baseline.rs index 9eeb1cd78..e6875cb3c 100644 --- a/lib/src/install/baseline.rs +++ b/lib/src/install/baseline.rs @@ -387,6 +387,6 @@ pub(crate) fn install_create_rootfs( rootfs_uuid: Some(root_uuid.to_string()), boot: Some(boot), kargs, - skip_finalize: false, + is_alongside: false, }) }