File tree 1 file changed +5
-4
lines changed
1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -45,26 +45,27 @@ impl<'a> DiskImageBuilder<'a> {
45
45
Self { files : Vec :: new ( ) }
46
46
}
47
47
/// Add or replace a ramdisk to be included in the final image.
48
- pub fn set_ramdisk ( & mut self , path : & ' a PathBuf ) {
49
- self . add_or_replace_file ( path, RAMDISK_FILE_NAME ) ;
48
+ pub fn set_ramdisk ( & mut self , path : & ' a PathBuf ) -> & mut Self {
49
+ self . add_or_replace_file ( path, RAMDISK_FILE_NAME )
50
50
}
51
51
52
52
/// Add or replace a kernel to be included in the final image.
53
- pub fn set_kernel ( & mut self , path : & ' a PathBuf ) {
53
+ pub fn set_kernel ( & mut self , path : & ' a PathBuf ) -> & mut Self {
54
54
self . add_or_replace_file ( path, KERNEL_FILE_NAME )
55
55
}
56
56
57
57
/// Add or replace arbitrary files.
58
58
/// NOTE: You can overwrite internal files if you choose, such as EFI/BOOT/BOOTX64.EFI
59
59
/// This can be useful in situations where you want to generate an image, but not use the provided bootloader.
60
- pub fn add_or_replace_file ( & mut self , path : & ' a PathBuf , target : & ' a str ) {
60
+ pub fn add_or_replace_file ( & mut self , path : & ' a PathBuf , target : & ' a str ) -> & mut Self {
61
61
self . files . insert (
62
62
0 ,
63
63
DiskImageFile :: < ' a > {
64
64
source : & path,
65
65
destination : & target,
66
66
} ,
67
67
) ;
68
+ self
68
69
}
69
70
fn create_fat_filesystem_image (
70
71
& self ,
You can’t perform that action at this time.
0 commit comments