@@ -160,7 +160,7 @@ impl<S: Signer> Installer<S> {
160
160
// The kernels and initrds are content-addressed.
161
161
// Thus, this cannot overwrite files of old generation with different content.
162
162
self . install_generation ( & generation)
163
- . context ( "Failed to install generation." ) ?;
163
+ . with_context ( || format ! ( "Failed to install generation {}" , generation . version ) ) ?;
164
164
for ( name, bootspec) in & generation. spec . bootspec . specialisations {
165
165
let specialised_generation = generation. specialise ( name, bootspec) ;
166
166
self . install_generation ( & specialised_generation)
@@ -264,7 +264,7 @@ impl<S: Signer> Installer<S> {
264
264
let stub_target = self
265
265
. esp_paths
266
266
. linux
267
- . join ( stub_name ( generation, & self . signer ) ?) ;
267
+ . join ( stub_name ( generation, & self . signer ) . context ( "Get stub name" ) ?) ;
268
268
self . gc_roots . extend ( [ & stub_target] ) ;
269
269
install_signed ( & self . signer , & lanzaboote_image_path, & stub_target)
270
270
. context ( "Failed to install the Lanzaboote stub." ) ?;
@@ -279,8 +279,9 @@ impl<S: Signer> Installer<S> {
279
279
let stub_target = self
280
280
. esp_paths
281
281
. linux
282
- . join ( stub_name ( generation, & self . signer ) ?) ;
283
- let stub = fs:: read ( & stub_target) ?;
282
+ . join ( stub_name ( generation, & self . signer ) . context ( "While getting stub name" ) ?) ;
283
+ let stub = fs:: read ( & stub_target)
284
+ . with_context ( || format ! ( "Failed to read the stub: {}" , stub_target. display( ) ) ) ?;
284
285
let kernel_path = resolve_efi_path (
285
286
& self . esp_paths . esp ,
286
287
pe:: read_section_data ( & stub, ".linux" ) . context ( "Missing kernel path." ) ?,
0 commit comments