Skip to content
This repository has been archived by the owner on Jun 28, 2023. It is now read-only.

Commit

Permalink
wimboot: fix "--index=n" not working (#99)
Browse files Browse the repository at this point in the history
  • Loading branch information
a1ive committed Mar 15, 2023
1 parent 5b20b2f commit 19efd8f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 2 additions & 1 deletion grub-core/map/lib/wim.c
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,8 @@ int wim_count ( struct vfat_file *file, struct wim_header *header,
int rc;

/* Count metadata entries */
for ( offset = 0 ; ( offset + sizeof ( entry ) ) <= header->lookup.len ;
for ( offset = 0, *count = 0 ;
( offset + sizeof ( entry ) ) <= header->lookup.len ;
offset += sizeof ( entry ) ) {

/* Read entry */
Expand Down
4 changes: 4 additions & 0 deletions grub-core/map/lib/wimpatch.c
Original file line number Diff line number Diff line change
Expand Up @@ -688,6 +688,10 @@ static int wim_construct_patch ( struct vfat_file *file,
&patch->boot ) ) != 0 )
return rc;

/* Update boot image metadata in patched header, if applicable */
if ( boot_index )
memcpy ( boot, &patch->boot, sizeof ( *boot ) );

/* Record original boot index */
patch->boot_index = patch->header.boot_index;

Expand Down

0 comments on commit 19efd8f

Please sign in to comment.