1
1
use std:: os:: unix:: prelude:: PermissionsExt ;
2
- use std:: path:: Path ;
3
2
4
3
use anyhow:: { Context , Result } ;
5
4
use camino:: Utf8Path ;
@@ -15,16 +14,6 @@ const GRUB_BOOT_UUID_FILE: &str = "bootuuid.cfg";
15
14
/// The name of the mountpoint for efi (as a subdirectory of /boot, or at the toplevel)
16
15
pub ( crate ) const EFI_DIR : & str = "efi" ;
17
16
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
-
28
17
#[ context( "Installing bootloader" ) ]
29
18
pub ( crate ) fn install_via_bootupd (
30
19
device : & Utf8Path ,
@@ -33,22 +22,9 @@ pub(crate) fn install_via_bootupd(
33
22
is_alongside : bool ,
34
23
) -> Result < ( ) > {
35
24
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" ) ;
52
28
let args = [ "backend" , "install" , "--with-static-configs" ]
53
29
. into_iter ( )
54
30
. chain ( verbose)
0 commit comments