david/ipxe
david
/
ipxe
Archived
1
0
Fork 0

[util] Update mergerom.pl to handle iPXE ROM header

Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
Michael Brown 2012-07-23 18:05:01 +01:00
parent 5de45cd3da
commit 8cac5c0c92
1 changed files with 18 additions and 3 deletions

View File

@ -44,9 +44,6 @@ my $offset = $baserom->length;
foreach my $rom ( @roms ) {
# Update base length
$baserom->{length} += $rom->{length};
# Merge initialisation entry point
merge_entry_points ( $baserom->{init}, $rom->{init}, $offset );
@ -85,6 +82,24 @@ foreach my $rom ( @roms ) {
merge_entry_points ( $baserom_pnp->{bev}, $rom_pnp->{bev}, $offset );
}
# Update iPXE header, if present
my $baserom_ipxe = $baserom->ipxe_header;
my $rom_ipxe = $rom->ipxe_header;
if ( $baserom_ipxe ) {
# Update shrunk length
$baserom_ipxe->{shrunk_length} = ( $baserom->{length} +
( $rom_ipxe ?
$rom_ipxe->{shrunk_length} :
$rom->{length} ) );
# Fix checksum
$baserom_ipxe->fix_checksum();
}
# Update base length
$baserom->{length} += $rom->{length};
# Fix checksum for this ROM segment
$rom->fix_checksum();