]> git.ipfire.org Git - thirdparty/ipxe.git/commitdiff
[util] Update mergerom.pl to handle .mrom images
authorMichael Brown <mcb30@ipxe.org>
Mon, 11 Jun 2012 18:27:23 +0000 (19:27 +0100)
committerMichael Brown <mcb30@ipxe.org>
Tue, 12 Jun 2012 14:15:06 +0000 (15:15 +0100)
Signed-off-by: Michael Brown <mcb30@ipxe.org>
src/util/mergerom.pl

index f9c52502d13de827ca6ee848e4744d7ad00e55e2..a1b456e2597f1266d8ef9e76e973c614d399107a 100755 (executable)
@@ -87,12 +87,15 @@ foreach my $rom ( @roms ) {
   # Fix checksum for this ROM segment
   $rom->fix_checksum();
 
+  # Add this ROM to base ROM
+  my $data = substr ( $baserom->get(), 0, $baserom->length() );
+  $data .= $rom->get();
+  $data .= $baserom->next_image()->get() if $baserom->next_image();
+  $baserom->set ( $data );
+
   $offset += $rom->length;
 }
 
 $baserom->pnp_header->fix_checksum() if $baserom->pnp_header;
 $baserom->fix_checksum();
 $baserom->save ( "-" );
-foreach my $rom ( @roms ) {
-  $rom->save ( "-" );
-}