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.

fixrom.pl 1.0KB

12345678910111213141516171819202122232425262728293031323334
  1. #!/usr/bin/perl -w
  2. #
  3. # Copyright (C) 2010 Michael Brown <mbrown@fensystems.co.uk>.
  4. #
  5. # This program is free software; you can redistribute it and/or
  6. # modify it under the terms of the GNU General Public License as
  7. # published by the Free Software Foundation; either version 2 of the
  8. # License, or any later version.
  9. #
  10. # This program is distributed in the hope that it will be useful, but
  11. # WITHOUT ANY WARRANTY; without even the implied warranty of
  12. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  13. # General Public License for more details.
  14. #
  15. # You should have received a copy of the GNU General Public License
  16. # along with this program; if not, write to the Free Software
  17. # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  18. use strict;
  19. use warnings;
  20. use FindBin;
  21. use lib "$FindBin::Bin";
  22. use Option::ROM qw ( :all );
  23. my @romfiles = @ARGV;
  24. foreach my $romfile ( @romfiles ) {
  25. my $rom = new Option::ROM;
  26. $rom->load ( $romfile );
  27. $rom->pnp_header->fix_checksum() if $rom->pnp_header;
  28. $rom->fix_checksum();
  29. $rom->save ( $romfile );
  30. }