1
1
use anyhow:: { anyhow, bail, Context , Result } ;
2
- use camino:: { Utf8Path , Utf8PathBuf } ;
2
+ use camino:: Utf8Path ;
3
3
use fn_error_context:: context;
4
4
5
5
use crate :: task:: Task ;
6
6
use bootc_blockdev:: PartitionTable ;
7
7
8
8
/// The name of the mountpoint for efi (as a subdirectory of /boot, or at the toplevel)
9
9
pub ( crate ) const EFI_DIR : & str = "efi" ;
10
- #[ cfg( feature = "install-to-disk" ) ]
11
- pub ( crate ) const ESP_GUID : & str = "C12A7328-F81F-11D2-BA4B-00A0C93EC93B" ;
12
- #[ cfg( feature = "install-to-disk" ) ]
13
- pub ( crate ) const PREPBOOT_GUID : & str = "9E1A2D38-C612-4316-AA26-8B49521E5A8B" ;
14
- #[ cfg( feature = "install-to-disk" ) ]
15
- pub ( crate ) const PREPBOOT_LABEL : & str = "PowerPC-PReP-boot" ;
16
- #[ cfg( target_arch = "powerpc64" ) ]
17
- /// We make a best-effort to support MBR partitioning too.
18
- pub ( crate ) const PREPBOOT_MBR_TYPE : & str = "41" ;
19
-
20
- /// Find the device to pass to bootupd. Only on powerpc64 right now
21
- /// we explicitly find one with a specific label.
22
- ///
23
- /// This should get fixed once we execute on https://github.com/coreos/bootupd/issues/432
24
- fn get_bootupd_device ( device : & PartitionTable ) -> Result < Utf8PathBuf > {
25
- #[ cfg( target_arch = "powerpc64" ) ]
26
- {
27
- return device
28
- . partitions
29
- . iter ( )
30
- . find ( |p| matches ! ( p. parttype. as_str( ) , PREPBOOT_GUID | PREPBOOT_MBR_TYPE ) )
31
- . ok_or_else ( || {
32
- anyhow:: anyhow!( "Failed to find PReP partition with GUID {PREPBOOT_GUID}" )
33
- } )
34
- . map ( |dev| dev. node . as_str ( ) . into ( ) ) ;
35
- }
36
- #[ cfg( not( target_arch = "powerpc64" ) ) ]
37
- return Ok ( device. path ( ) . into ( ) ) ;
38
- }
39
10
40
11
#[ context( "Installing bootloader" ) ]
41
12
pub ( crate ) fn install_via_bootupd (
@@ -47,7 +18,7 @@ pub(crate) fn install_via_bootupd(
47
18
// bootc defaults to only targeting the platform boot method.
48
19
let bootupd_opts = ( !configopts. generic_image ) . then_some ( [ "--update-firmware" , "--auto" ] ) ;
49
20
50
- let devpath = get_bootupd_device ( device) ? ;
21
+ let devpath = device. path ( ) ;
51
22
let args = [ "backend" , "install" , "--write-uuid" ]
52
23
. into_iter ( )
53
24
. chain ( verbose)
0 commit comments