mirror of
https://github.com/ipxe/ipxe.git
synced 2026-05-05 12:26:37 +02:00
[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:
parent
c9158cb32c
commit
ae8e23a452
@ -249,11 +249,6 @@ DRIVERS_ipxe +=
|
||||
#
|
||||
DRIVERS_rpi += smsc95xx lan78xx
|
||||
|
||||
# Virtualised NIC drivers with hypervisor-specific bus types
|
||||
#
|
||||
DRIVERS_vmbus_net += netvsc
|
||||
DRIVERS_xenbus_net += netfront
|
||||
|
||||
###############################################################################
|
||||
#
|
||||
# Drag in the bulk of the build system
|
||||
|
||||
@ -30,7 +30,6 @@ DRIVERS_ipxe += $(DRIVERS_pci_infiniband)
|
||||
|
||||
# Include SNP and MNP drivers in the all-drivers build
|
||||
#
|
||||
DRIVERS_efi_net += snp mnp
|
||||
DRIVERS_ipxe += $(DRIVERS_efi_net)
|
||||
|
||||
# Rules for building EFI files
|
||||
|
||||
@ -19,6 +19,7 @@ LDFLAGS += -r -d
|
||||
# Source directories
|
||||
#
|
||||
SRCDIRS += drivers/linux
|
||||
SRCDIRS += drivers/net/linux
|
||||
SRCDIRS += interface/linux
|
||||
NON_AUTO_SRCS += interface/linux/linux_api.c
|
||||
|
||||
@ -28,9 +29,6 @@ NON_AUTO_MEDIA = linux
|
||||
|
||||
# Include Linux-specific drivers in all-drivers build
|
||||
#
|
||||
DRIVERS_linux_net += af_packet
|
||||
DRIVERS_linux_net += slirp
|
||||
DRIVERS_linux_net += tap
|
||||
DRIVERS_ipxe += $(DRIVERS_linux_net)
|
||||
|
||||
# Compiler flags for building host API wrapper
|
||||
|
||||
@ -7,5 +7,5 @@ include Makefile.efi
|
||||
|
||||
# Include Xen and Hyper-V drivers in the all-drivers build
|
||||
#
|
||||
DRIVERS_ipxe += $(DRIVERS_xenbus_net)
|
||||
DRIVERS_ipxe += $(DRIVERS_xen_net)
|
||||
DRIVERS_ipxe += $(DRIVERS_vmbus_net)
|
||||
|
||||
@ -113,5 +113,5 @@ DRIVERS_ipxe += $(DRIVERS_pci_infiniband)
|
||||
|
||||
# Include Xen and Hyper-V drivers in the all-drivers build
|
||||
#
|
||||
DRIVERS_ipxe += $(DRIVERS_xenbus_net)
|
||||
DRIVERS_ipxe += $(DRIVERS_xen_net)
|
||||
DRIVERS_ipxe += $(DRIVERS_vmbus_net)
|
||||
|
||||
@ -55,3 +55,6 @@ struct efi_driver mnp_driver __efi_driver ( EFI_DRIVER_MNP ) = {
|
||||
.start = mnpnet_start,
|
||||
.stop = mnpnet_stop,
|
||||
};
|
||||
|
||||
/* Generate build rules */
|
||||
EFI_ROM ( "mnp", "Managed Network Protocol NIC" );
|
||||
|
||||
@ -80,3 +80,6 @@ struct efi_driver nii_driver __efi_driver ( EFI_DRIVER_NII ) = {
|
||||
/** Drag in MNP driver */
|
||||
REQUIRING_SYMBOL ( snp_driver );
|
||||
REQUIRE_SYMBOL ( mnp_driver );
|
||||
|
||||
/* Generate build rules */
|
||||
EFI_ROM ( "snp", "Simple Network Protocol NIC" );
|
||||
|
||||
@ -323,3 +323,6 @@ struct linux_driver af_packet_nic_driver __linux_driver = {
|
||||
.probe = af_packet_nic_probe,
|
||||
.remove = af_packet_nic_remove,
|
||||
};
|
||||
|
||||
/* Generate build rules */
|
||||
LINUX_ROM ( "af_packet", "AF_PACKET binding NIC" );
|
||||
@ -550,3 +550,6 @@ struct linux_driver slirp_driver __linux_driver = {
|
||||
.probe = slirp_probe,
|
||||
.remove = slirp_remove,
|
||||
};
|
||||
|
||||
/* Generate build rules */
|
||||
LINUX_ROM ( "slirp", "libslirp NIC" );
|
||||
@ -259,3 +259,6 @@ struct linux_driver tap_driver __linux_driver = {
|
||||
.probe = tap_probe,
|
||||
.remove = tap_remove,
|
||||
};
|
||||
|
||||
/* Generate build rules */
|
||||
LINUX_ROM ( "tap", "Linux TUN/TAP NIC" );
|
||||
@ -1046,6 +1046,9 @@ struct xen_driver netfront_driver __xen_driver = {
|
||||
.remove = netfront_remove,
|
||||
};
|
||||
|
||||
/* Generate build rules */
|
||||
XEN_ROM ( "netfront", "Xen netfront virtual NIC" );
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* Emulated PCI device inhibitor
|
||||
|
||||
@ -894,3 +894,6 @@ struct vmbus_driver netvsc_driver __vmbus_driver = {
|
||||
.reset = netvsc_reset,
|
||||
.remove = netvsc_remove,
|
||||
};
|
||||
|
||||
/* Generate build rules */
|
||||
VMBUS_ROM ( "netvsc", "Hyper-V NetVSC RNDIS virtual NIC" );
|
||||
|
||||
@ -75,6 +75,9 @@ struct efi_driver {
|
||||
#define EFI_DRIVER_SNP 04 /**< SNP protocol drivers */
|
||||
#define EFI_DRIVER_MNP 05 /**< MNP protocol drivers */
|
||||
|
||||
/** Define build rules for an EFI driver */
|
||||
#define EFI_ROM( _name, _desc )
|
||||
|
||||
/**
|
||||
* Set EFI driver-private data
|
||||
*
|
||||
|
||||
@ -66,6 +66,9 @@ struct linux_driver {
|
||||
/** Declare a Linux driver */
|
||||
#define __linux_driver __table_entry(LINUX_DRIVERS, 01)
|
||||
|
||||
/** Define build rules for a Linux driver */
|
||||
#define LINUX_ROM( _name, _desc )
|
||||
|
||||
/**
|
||||
* Set linux device driver-private data
|
||||
*
|
||||
|
||||
@ -547,6 +547,9 @@ struct vmbus_driver {
|
||||
/** Declare a VMBus device driver */
|
||||
#define __vmbus_driver __table_entry ( VMBUS_DRIVERS, 01 )
|
||||
|
||||
/** Define build rules for a VMBus device driver */
|
||||
#define VMBUS_ROM( _name, _desc )
|
||||
|
||||
/**
|
||||
* Set VMBus device driver-private data
|
||||
*
|
||||
|
||||
@ -58,6 +58,9 @@ struct xen_driver {
|
||||
/** Declare a Xen device driver */
|
||||
#define __xen_driver __table_entry ( XEN_DRIVERS, 01 )
|
||||
|
||||
/** Define build rules for a Xen device driver */
|
||||
#define XEN_ROM( _name, _desc )
|
||||
|
||||
/**
|
||||
* Set Xen device driver-private data
|
||||
*
|
||||
|
||||
@ -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 ) = @_;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user