File tree 1 file changed +2
-20
lines changed
1 file changed +2
-20
lines changed Original file line number Diff line number Diff line change 1
1
use crate :: { args:: RunnerArgs , builder:: Builder , config, ErrorString } ;
2
- use std:: { fs , process} ;
2
+ use std:: process;
3
3
4
4
pub ( crate ) fn runner ( args : RunnerArgs ) -> Result < i32 , ErrorString > {
5
5
let builder = Builder :: new ( None ) ?;
6
6
let config = config:: read_config ( builder. kernel_manifest_path ( ) . to_owned ( ) ) ?;
7
7
8
8
let bootimage_bin = {
9
- let kernel_target_dir = & builder. kernel_metadata ( ) . target_directory ;
10
- let bootimage_target_dir = kernel_target_dir. join ( "bootimage" ) . join ( "runner" ) ;
11
-
12
9
let parent = args
13
10
. executable
14
11
. parent ( )
@@ -19,22 +16,7 @@ pub(crate) fn runner(args: RunnerArgs) -> Result<i32, ErrorString> {
19
16
. ok_or ( "kernel executable has no file stem" ) ?
20
17
. to_str ( )
21
18
. ok_or ( "kernel executable file stem is not valid UTF-8" ) ?;
22
- let sub_path = parent. strip_prefix ( kernel_target_dir) . map_err ( |err| {
23
- format ! (
24
- "kernel executable does not live in kernel target directory: {}" ,
25
- err
26
- )
27
- } ) ?;
28
-
29
- let out_dir = bootimage_target_dir. join ( sub_path) ;
30
- fs:: create_dir_all ( & out_dir) . map_err ( |err| {
31
- format ! (
32
- "failed to create output directory {}: {}" ,
33
- out_dir. display( ) ,
34
- err
35
- )
36
- } ) ?;
37
- out_dir. join ( format ! ( "bootimage-{}.bin" , file_stem) )
19
+ parent. join ( format ! ( "bootimage-{}.bin" , file_stem) )
38
20
} ;
39
21
40
22
builder. create_bootimage ( & args. executable , & bootimage_bin, false ) ?;
You can’t perform that action at this time.
0 commit comments