@@ -70,23 +70,23 @@ impl DiskImageBuilder {
70
70
71
71
/// Add or replace a kernel to be included in the final image.
72
72
pub fn set_kernel ( & mut self , path : & Path ) -> & mut Self {
73
- self . set_file_source ( FileDataSource :: File ( path. to_path_buf ( ) ) , KERNEL_FILE_NAME )
73
+ self . set_file_source ( KERNEL_FILE_NAME , FileDataSource :: File ( path. to_path_buf ( ) ) )
74
74
}
75
75
76
76
/// Add or replace a ramdisk to be included in the final image.
77
77
pub fn set_ramdisk ( & mut self , path : & Path ) -> & mut Self {
78
- self . set_file_source ( FileDataSource :: File ( path. to_path_buf ( ) ) , RAMDISK_FILE_NAME )
78
+ self . set_file_source ( RAMDISK_FILE_NAME , FileDataSource :: File ( path. to_path_buf ( ) ) )
79
79
}
80
80
81
81
/// Configures the runtime behavior of the bootloader.
82
82
pub fn set_boot_config ( & mut self , boot_config : & BootConfig ) -> & mut Self {
83
83
let json =
84
84
serde_json:: to_string_pretty ( boot_config) . expect ( "failed to serialize BootConfig" ) ;
85
85
let bytes = json. as_bytes ( ) ;
86
- self . set_file_source ( FileDataSource :: Data ( bytes. to_vec ( ) ) , CONFIG_FILE_NAME )
86
+ self . set_file_source ( CONFIG_FILE_NAME , FileDataSource :: Data ( bytes. to_vec ( ) ) )
87
87
}
88
88
89
- pub fn set_file_source ( & mut self , source : FileDataSource , destination : & str ) -> & mut Self {
89
+ pub fn set_file_source ( & mut self , destination : & str , source : FileDataSource ) -> & mut Self {
90
90
let destination = destination. to_string ( ) ;
91
91
self . files . insert (
92
92
0 ,
@@ -98,12 +98,12 @@ impl DiskImageBuilder {
98
98
self
99
99
}
100
100
101
- pub fn set_file_contents ( & mut self , data : & [ u8 ] , destination : & str ) -> & mut Self {
102
- self . set_file_source ( FileDataSource :: Data ( data. to_vec ( ) ) , destination )
101
+ pub fn set_file_contents ( & mut self , destination : & str , data : & [ u8 ] ) -> & mut Self {
102
+ self . set_file_source ( destination , FileDataSource :: Data ( data. to_vec ( ) ) )
103
103
}
104
104
105
- pub fn set_file ( & mut self , file_path : & Path , destination : & str ) -> & mut Self {
106
- self . set_file_source ( FileDataSource :: File ( file_path. to_path_buf ( ) ) , destination )
105
+ pub fn set_file ( & mut self , destination : & str , file_path : & Path ) -> & mut Self {
106
+ self . set_file_source ( destination , FileDataSource :: File ( file_path. to_path_buf ( ) ) )
107
107
}
108
108
109
109
fn create_fat_filesystem_image (
0 commit comments