Skip to content

Commit

Permalink
[build] Replace obsolete makerom.pl with quick script using Option::ROM
Browse files Browse the repository at this point in the history
The only remaining useful function of makerom.pl is to correct the ROM
and PnP checksums; the PCI IDs are set at link time, and padding is
performed using padimg.pl.

Option::ROM already provides a facility for correcting the checksums,
so we may as well just use this instead.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
  • Loading branch information
mcb30 committed Apr 25, 2010
1 parent b7c548a commit d8c1f2e
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 251 deletions.
2 changes: 1 addition & 1 deletion src/Makefile
Expand Up @@ -32,7 +32,7 @@ OBJCOPY := $(CROSS_COMPILE)objcopy
NM := $(CROSS_COMPILE)nm
OBJDUMP := $(CROSS_COMPILE)objdump
PARSEROM := $(PERL) ./util/parserom.pl
MAKEROM := $(PERL) ./util/makerom.pl
FIXROM := $(PERL) ./util/fixrom.pl
SYMCHECK := $(PERL) ./util/symcheck.pl
SORTOBJDUMP := $(PERL) ./util/sortobjdump.pl
PADIMG := $(PERL) ./util/padimg.pl
Expand Down
24 changes: 0 additions & 24 deletions src/Makefile.housekeeping
Expand Up @@ -614,15 +614,6 @@ TGT_LD_FLAGS = $(foreach SYM,$(TGT_LD_PREFIX) $(TGT_LD_DRIVERS) obj_config,\
-u $(SYM) --defsym check_$(SYM)=$(SYM) ) \
$(patsubst %,--defsym %,$(TGT_LD_IDS))

# Calculate makerom flags for the specific target
# (e.g. "bin/dfe538--prism2_pci.zrom.tmp") and derive the variables:
#
# TGT_MAKEROM_FLAGS : target-specific flags for makerom (e.g.
# "-p 0x1186,0x1300")
#
TGT_MAKEROM_FLAGS = $(strip $(MAKEROM_FLAGS_$(TGT_ROM_NAME)) \
$(if $(TGT_PCI_VENDOR),$(strip -p $(TGT_PCI_VENDOR),$(TGT_PCI_DEVICE))))

# Calculate list of debugging versions of objects to be included in
# the target.
#
Expand Down Expand Up @@ -653,8 +644,6 @@ $(BIN)/%.info :
@$(ECHO)
@$(ECHO) 'LD target flags : $(TGT_LD_FLAGS)'
@$(ECHO)
@$(ECHO) 'makerom target flags : $(TGT_MAKEROM_FLAGS)'
@$(ECHO)
@$(ECHO) 'Debugging objects : $(DEBUG_OBJS)'
@$(ECHO) 'Replaced objects : $(DEBUG_ORIG_OBJS)'

Expand Down Expand Up @@ -863,19 +852,6 @@ $(BIN)/etherboot.% : $(BIN)/ipxe.%

endif # defined(BIN)

###############################################################################
#
# Rules for finalising files. TGT_MAKEROM_FLAGS is defined as part of
# the automatic build system and varies by target; it includes the
# "-p 0x1234,0x5678" string to set the PCI IDs.
#
FINALISE_rom = $(MAKEROM) $(MAKEROM_FLAGS) $(TGT_MAKEROM_FLAGS) \
-i$(IDENT) -s 0 $@

# Some ROMs require specific flags to be passed to makerom.pl
#
MAKEROM_FLAGS_3c503 = -3

###############################################################################
#
# The compression utilities
Expand Down
4 changes: 4 additions & 0 deletions src/arch/i386/Makefile.pcbios
Expand Up @@ -26,6 +26,10 @@ PAD_rom = $(PADIMG) --blksize=512 --byte=0xff $@
PAD_dsk = $(PADIMG) --blksize=512 $@
PAD_hd = $(PADIMG) --blksize=32768 $@

# Finalisation rules
#
FINALISE_rom = $(FIXROM) $@

# rule to make a non-emulation ISO boot image
NON_AUTO_MEDIA += iso
%iso: %lkrn util/geniso
Expand Down
34 changes: 34 additions & 0 deletions src/util/fixrom.pl
@@ -0,0 +1,34 @@
#!/usr/bin/perl -w
#
# Copyright (C) 2010 Michael Brown <mbrown@fensystems.co.uk>.
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 2 of the
# License, or any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.

use strict;
use warnings;

use FindBin;
use lib "$FindBin::Bin";
use Option::ROM qw ( :all );

my @romfiles = @ARGV;

foreach my $romfile ( @romfiles ) {
my $rom = new Option::ROM;
$rom->load ( $romfile );
$rom->pnp_header->fix_checksum() if $rom->pnp_header;
$rom->fix_checksum();
$rom->save ( $romfile );
}
226 changes: 0 additions & 226 deletions src/util/makerom.pl

This file was deleted.

0 comments on commit d8c1f2e

Please sign in to comment.