You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

catrom.pl 633B

1234567891011121314151617181920212223242526272829
  1. #!/usr/bin/perl -w
  2. use warnings;
  3. use strict;
  4. use FindBin;
  5. use lib "$FindBin::Bin";
  6. use Option::ROM qw ( :all );
  7. my @romfiles = @ARGV
  8. or die "Usage: $0 rom-file-1 rom-file-2 ... > multi-rom-file\n";
  9. while ( my $romfile = shift @romfiles ) {
  10. # Read ROM file
  11. my $rom = new Option::ROM;
  12. $rom->load ( $romfile );
  13. # Tag final image as non-final in all except the final ROM
  14. if ( @romfiles ) {
  15. my $image = $rom;
  16. $image = $image->next_image() while $image->next_image();
  17. $image->pci_header->{last_image} &= ~PCI_LAST_IMAGE;
  18. $image->fix_checksum();
  19. }
  20. # Write ROM file to STDOUT
  21. $rom->save ( "-" );
  22. }