Skip to content

Commit 08a5ff6

Browse files
authored
Merge pull request #166 from cgwalters/add-auto-mode
Use `bootupctl --auto` in alongside mode
2 parents 6849620 + 35d95a2 commit 08a5ff6

File tree

1 file changed

+3
-27
lines changed

1 file changed

+3
-27
lines changed

lib/src/bootloader.rs

Lines changed: 3 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
use std::os::unix::prelude::PermissionsExt;
2-
use std::path::Path;
32

43
use anyhow::{Context, Result};
54
use camino::Utf8Path;
@@ -15,16 +14,6 @@ const GRUB_BOOT_UUID_FILE: &str = "bootuuid.cfg";
1514
/// The name of the mountpoint for efi (as a subdirectory of /boot, or at the toplevel)
1615
pub(crate) const EFI_DIR: &str = "efi";
1716

18-
/// Return `true` if the system is booted via EFI
19-
pub(crate) fn is_efi_booted() -> Result<bool> {
20-
if !super::install::ARCH_USES_EFI {
21-
return Ok(false);
22-
}
23-
Path::new("/sys/firmware/efi")
24-
.try_exists()
25-
.map_err(Into::into)
26-
}
27-
2817
#[context("Installing bootloader")]
2918
pub(crate) fn install_via_bootupd(
3019
device: &Utf8Path,
@@ -33,22 +22,9 @@ pub(crate) fn install_via_bootupd(
3322
is_alongside: bool,
3423
) -> Result<()> {
3524
let verbose = std::env::var_os("BOOTC_BOOTLOADER_DEBUG").map(|_| "-vvvv");
36-
// If we're doing an alongside install, only match the boot method because Anaconda defaults
37-
// to only doing that. This is only on x86_64 because that's the only arch that has multiple
38-
// components right now.
39-
// TODO: Add --component=auto which moves this logic into bootupd
40-
let component_args = if cfg!(target_arch = "x86_64") && is_alongside {
41-
assert!(super::install::ARCH_USES_EFI);
42-
let install_efi = is_efi_booted()?;
43-
let component_arg = if install_efi {
44-
"--component=EFI"
45-
} else {
46-
"--component=BIOS"
47-
};
48-
Some(component_arg)
49-
} else {
50-
None
51-
};
25+
// If we're doing an alongside install, only match the host boot method because Anaconda defaults
26+
// to only doing that.
27+
let component_args = is_alongside.then_some("--auto");
5228
let args = ["backend", "install", "--with-static-configs"]
5329
.into_iter()
5430
.chain(verbose)

0 commit comments

Comments
 (0)