@@ -13,12 +13,11 @@ extern crate alloc;
13
13
14
14
use alloc:: vec:: Vec ;
15
15
use log:: info;
16
- use uefi:: boot;
16
+ use uefi:: boot:: { self , LoadImageSource } ;
17
17
use uefi:: prelude:: * ;
18
18
use uefi:: proto:: device_path:: build:: { self , DevicePathBuilder } ;
19
19
use uefi:: proto:: device_path:: { DevicePath , DeviceSubType , DeviceType , LoadedImageDevicePath } ;
20
20
use uefi:: proto:: loaded_image:: LoadedImage ;
21
- use uefi:: table:: boot:: LoadImageSource ;
22
21
23
22
/// Get the device path of the shell app. This is the same as the
24
23
/// currently-loaded image's device path, but with the file path part changed.
@@ -43,23 +42,21 @@ fn get_shell_app_device_path(storage: &mut Vec<u8>) -> &DevicePath {
43
42
}
44
43
45
44
#[ entry]
46
- fn efi_main ( image : Handle , st : SystemTable < Boot > ) -> Status {
45
+ fn efi_main ( ) -> Status {
47
46
uefi:: helpers:: init ( ) . unwrap ( ) ;
48
- let boot_services = st. boot_services ( ) ;
49
47
50
48
let mut storage = Vec :: new ( ) ;
51
49
let shell_image_path = get_shell_app_device_path ( & mut storage) ;
52
50
53
51
// Load the shell app.
54
- let shell_image_handle = boot_services
55
- . load_image (
56
- image,
57
- LoadImageSource :: FromDevicePath {
58
- device_path : shell_image_path,
59
- from_boot_manager : false ,
60
- } ,
61
- )
62
- . expect ( "failed to load shell app" ) ;
52
+ let shell_image_handle = boot:: load_image (
53
+ boot:: image_handle ( ) ,
54
+ LoadImageSource :: FromDevicePath {
55
+ device_path : shell_image_path,
56
+ from_boot_manager : false ,
57
+ } ,
58
+ )
59
+ . expect ( "failed to load shell app" ) ;
63
60
64
61
// Set the command line passed to the shell app so that it will run the
65
62
// test-runner app. This automatically turns off the five-second delay.
@@ -74,9 +71,7 @@ fn efi_main(image: Handle, st: SystemTable<Boot>) -> Status {
74
71
}
75
72
76
73
info ! ( "launching the shell app" ) ;
77
- boot_services
78
- . start_image ( shell_image_handle)
79
- . expect ( "failed to launch the shell app" ) ;
74
+ boot:: start_image ( shell_image_handle) . expect ( "failed to launch the shell app" ) ;
80
75
81
76
Status :: SUCCESS
82
77
}
0 commit comments