[build] Handle all driver list construction via parserom.pl

Handle construction of the EFI, Linux, Xen, and VMBus driver build
rules via parserom.pl to ensure consistency.  In particular, this
allows those drivers to appear in the DRIVERS_SECBOOT list used to
filter out non-permitted drivers in a Secure Boot build.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
Michael Brown
2026-02-13 13:43:37 +00:00
parent c9158cb32c
commit ae8e23a452
17 changed files with 56 additions and 13 deletions
+20 -2
View File
@@ -36,7 +36,8 @@ if ( $debug ) {
my %RE = (
'parse_driver_class' => qr{ drivers/ (\w+?) / }x,
'parse_family' => qr{^ (?:\./)? (.*) \..+? $}x,
'find_rom_line' => qr/^ \s* ( (PCI|ISA|USB|DT)_ROM \s*
'find_rom_line' => qr/^ \s* ( (PCI|ISA|USB|DT|EFI|
LINUX|XEN|VMBUS)_ROM \s*
\( \s* (.*?) \s* \) \s* ) [,;]/msx,
'find_secboot' => qr/^ \s* FILE_SECBOOT \s*
\( \s* PERMITTED \s* \) \s* ; \s* $/mx,
@@ -122,7 +123,7 @@ sub process_rom_decl {
return process_isa_rom($state, $rom_decl) if $rom_type eq "ISA";
return process_usb_rom($state, $rom_decl) if $rom_type eq "USB";
return process_dt_rom($state, $rom_decl) if $rom_type eq "DT";
return;
return process_basic_rom($state, $rom_decl);
}
# Extract values from PCI_ROM declaration lines and dispatch to
@@ -198,6 +199,23 @@ sub process_dt_rom {
return 1;
}
# Extract values from basic ROM declaration lines and dispatch to
# Makefile rule generator
sub process_basic_rom {
my ($state, $decl) = @_;
return unless defined $decl;
return unless length $decl;
(my $image, $decl) = extract_quoted_string($decl, 'IMAGE');
(my $desc, $decl) = extract_quoted_string($decl, 'DESCRIPTION');
if ( $image and $desc ) {
print_make_rules( $state, $image, $desc );
} else {
my $macro = (uc $state->{'type'})."_ROM";
log_debug("WARNING", "Malformed $macro macro on line $. of $state->{source_file}");
}
return 1;
}
# Output Makefile rules for the specified ROM declarations
sub print_make_rules {
my ( $state, $image, $desc, $vendor, $device, $dup ) = @_;