File tree Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Original file line number Diff line number Diff line change @@ -37,11 +37,9 @@ impl BiosBoot {
37
37
}
38
38
39
39
/// Add a ramdisk file to the image
40
- pub fn with_ramdisk ( & self , ramdisk_path : & Path ) -> Self {
41
- Self {
42
- kernel : self . kernel . to_owned ( ) ,
43
- ramdisk : Some ( ramdisk_path. to_owned ( ) ) ,
44
- }
40
+ pub fn set_ramdisk ( & mut self , ramdisk_path : & Path ) -> & mut Self {
41
+ self . ramdisk = Some ( ramdisk_path. to_owned ( ) ) ;
42
+ self
45
43
}
46
44
47
45
/// Create a bootable UEFI disk image at the given path.
@@ -81,7 +79,7 @@ impl BiosBoot {
81
79
files. insert ( KERNEL_FILE_NAME , kernel_path) ;
82
80
files. insert ( BIOS_STAGE_3 , stage_3_path) ;
83
81
files. insert ( BIOS_STAGE_4 , stage_4_path) ;
84
- if has_rd_path {
82
+ if let Some ( ramdisk_path ) = & self . ramdisk {
85
83
files. insert ( RAMDISK_FILE_NAME , ramdisk_path) ;
86
84
}
87
85
let out_file = NamedTempFile :: new ( ) . context ( "failed to create temp file" ) ?;
You can’t perform that action at this time.
0 commit comments