File tree 1 file changed +20
-10
lines changed
1 file changed +20
-10
lines changed Original file line number Diff line number Diff line change @@ -210,17 +210,27 @@ impl<S: LanzabooteSigner> Installer<S> {
210
210
. context ( "Failed to install the kernel." ) ?;
211
211
212
212
// Assemble and install the initrd, and record its path on the ESP.
213
- let initrd_location = tempdir
214
- . write_secure_file (
215
- fs:: read (
216
- bootspec
217
- . initrd
218
- . as_ref ( )
219
- . context ( "Lanzaboote does not support missing initrd yet." ) ?,
213
+ // It is not needed to write the initrd in a temporary directory
214
+ // if we do not have any initrd secret.
215
+ let initrd_location = if bootspec. initrd_secrets . is_some ( ) {
216
+ tempdir
217
+ . write_secure_file (
218
+ fs:: read (
219
+ bootspec
220
+ . initrd
221
+ . as_ref ( )
222
+ . context ( "Lanzaboote does not support missing initrd yet." ) ?,
223
+ )
224
+ . context ( "Failed to read the initrd." ) ?,
220
225
)
221
- . context ( "Failed to read the initrd." ) ?,
222
- )
223
- . context ( "Failed to copy the initrd to the temporary directory." ) ?;
226
+ . context ( "Failed to copy the initrd to the temporary directory." ) ?
227
+ } else {
228
+ bootspec
229
+ . initrd
230
+ . clone ( )
231
+ . expect ( "Lanzaboote does not support missing initrd yet." )
232
+ } ;
233
+
224
234
if let Some ( initrd_secrets_script) = & bootspec. initrd_secrets {
225
235
append_initrd_secrets ( initrd_secrets_script, & initrd_location, generation. version ) ?;
226
236
}
You can’t perform that action at this time.
0 commit comments