Compare commits

...

No commits in common. "c8" and "c9" have entirely different histories.
c8 ... c9

13 changed files with 360 additions and 428 deletions

2
.gitignore vendored
View File

@ -1 +1 @@
SOURCES/ipxe-20181214-git133f4c47.tar.xz
SOURCES/ipxe-20200823-git4bd064de.tar.xz

View File

@ -1 +1 @@
a79e649fbb476761a9e5a165f3467d783c0a5fe9 SOURCES/ipxe-20181214-git133f4c47.tar.xz
0441a1fc97256eb89f1e0dccb2067bde8e9cf2a2 SOURCES/ipxe-20200823-git4bd064de.tar.xz

View File

@ -1,129 +0,0 @@
From c2226b3d1a4d9fc1daeb8dc6b9034d1fb46c1308 Mon Sep 17 00:00:00 2001
From: Michael Brown <mcb30@ipxe.org>
Date: Sun, 14 Jul 2019 15:27:01 +0100
Subject: [PATCH] [arm] Provide dummy implementations for {in,out}[s]{b,w,l}
It is currently not possible to build the all-drivers iPXE binaries
for ARM, since there is no implementation for inb(), outb(), etc.
There is no common standard for accessing I/O space on ARM platforms,
and there are almost no ARM-compatible peripherals that actually
require I/O space accesses.
Provide dummy implementations that behave as though no device is
present (i.e. ignore writes, return all bits high for reads). This is
sufficient to allow the all-drivers binaries to link, and should cause
drivers to behave as though no I/O space peripherals are present in
the system.
Signed-off-by: Michael Brown <mcb30@ipxe.org>
---
src/arch/arm/include/ipxe/arm_io.h | 77 +++++++++++++++++++++++-------
1 file changed, 59 insertions(+), 18 deletions(-)
diff --git a/src/arch/arm/include/ipxe/arm_io.h b/src/arch/arm/include/ipxe/arm_io.h
index f8765af752..105f22bfbf 100644
--- a/src/arch/arm/include/ipxe/arm_io.h
+++ b/src/arch/arm/include/ipxe/arm_io.h
@@ -43,42 +43,83 @@ IOAPI_INLINE ( arm, bus_to_phys ) ( unsigned long bus_addr ) {
*
*/
-#define ARM_READX( _api_func, _type, _insn_suffix, _reg_prefix ) \
+#define ARM_READX( _suffix, _type, _insn_suffix, _reg_prefix ) \
static inline __always_inline _type \
-IOAPI_INLINE ( arm, _api_func ) ( volatile _type *io_addr ) { \
+IOAPI_INLINE ( arm, read ## _suffix ) ( volatile _type *io_addr ) { \
_type data; \
__asm__ __volatile__ ( "ldr" _insn_suffix " %" _reg_prefix "0, %1" \
: "=r" ( data ) : "Qo" ( *io_addr ) ); \
return data; \
}
#ifdef __aarch64__
-ARM_READX ( readb, uint8_t, "b", "w" );
-ARM_READX ( readw, uint16_t, "h", "w" );
-ARM_READX ( readl, uint32_t, "", "w" );
-ARM_READX ( readq, uint64_t, "", "" );
+ARM_READX ( b, uint8_t, "b", "w" );
+ARM_READX ( w, uint16_t, "h", "w" );
+ARM_READX ( l, uint32_t, "", "w" );
+ARM_READX ( q, uint64_t, "", "" );
#else
-ARM_READX ( readb, uint8_t, "b", "" );
-ARM_READX ( readw, uint16_t, "h", "" );
-ARM_READX ( readl, uint32_t, "", "" );
+ARM_READX ( b, uint8_t, "b", "" );
+ARM_READX ( w, uint16_t, "h", "" );
+ARM_READX ( l, uint32_t, "", "" );
#endif
-#define ARM_WRITEX( _api_func, _type, _insn_suffix, _reg_prefix ) \
+#define ARM_WRITEX( _suffix, _type, _insn_suffix, _reg_prefix ) \
static inline __always_inline void \
-IOAPI_INLINE ( arm, _api_func ) ( _type data, volatile _type *io_addr ) { \
+IOAPI_INLINE ( arm, write ## _suffix ) ( _type data, \
+ volatile _type *io_addr ) { \
__asm__ __volatile__ ( "str" _insn_suffix " %" _reg_prefix "0, %1" \
: : "r" ( data ), "Qo" ( *io_addr ) ); \
}
#ifdef __aarch64__
-ARM_WRITEX ( writeb, uint8_t, "b", "w" );
-ARM_WRITEX ( writew, uint16_t, "h", "w" );
-ARM_WRITEX ( writel, uint32_t, "", "w" );
-ARM_WRITEX ( writeq, uint64_t, "", "" );
+ARM_WRITEX ( b, uint8_t, "b", "w" );
+ARM_WRITEX ( w, uint16_t, "h", "w" );
+ARM_WRITEX ( l, uint32_t, "", "w" );
+ARM_WRITEX ( q, uint64_t, "", "" );
#else
-ARM_WRITEX ( writeb, uint8_t, "b", "" );
-ARM_WRITEX ( writew, uint16_t, "h", "" );
-ARM_WRITEX ( writel, uint32_t, "", "" );
+ARM_WRITEX ( b, uint8_t, "b", "" );
+ARM_WRITEX ( w, uint16_t, "h", "" );
+ARM_WRITEX ( l, uint32_t, "", "" );
#endif
+/*
+ * Dummy PIO reads and writes up to 32 bits
+ *
+ * There is no common standard for I/O-space access for ARM, and
+ * non-MMIO peripherals are vanishingly rare. Provide dummy
+ * implementations that will allow code to link and should cause
+ * drivers to simply fail to detect hardware at runtime.
+ *
+ */
+
+#define ARM_INX( _suffix, _type ) \
+static inline __always_inline _type \
+IOAPI_INLINE ( arm, in ## _suffix ) ( volatile _type *io_addr __unused) { \
+ return ~( (_type) 0 ); \
+} \
+static inline __always_inline void \
+IOAPI_INLINE ( arm, ins ## _suffix ) ( volatile _type *io_addr __unused, \
+ _type *data, unsigned int count ) { \
+ memset ( data, 0xff, count * sizeof ( *data ) ); \
+}
+ARM_INX ( b, uint8_t );
+ARM_INX ( w, uint16_t );
+ARM_INX ( l, uint32_t );
+
+#define ARM_OUTX( _suffix, _type ) \
+static inline __always_inline void \
+IOAPI_INLINE ( arm, out ## _suffix ) ( _type data __unused, \
+ volatile _type *io_addr __unused ) { \
+ /* Do nothing */ \
+} \
+static inline __always_inline void \
+IOAPI_INLINE ( arm, outs ## _suffix ) ( volatile _type *io_addr __unused, \
+ const _type *data __unused, \
+ unsigned int count __unused ) { \
+ /* Do nothing */ \
+}
+ARM_OUTX ( b, uint8_t );
+ARM_OUTX ( w, uint16_t );
+ARM_OUTX ( l, uint32_t );
+
/*
* Slow down I/O
*

View File

@ -1,17 +1,8 @@
From: Paolo Bonzini <pbonzini@redhat.com>
Date: Tue, 17 Nov 2015 11:56:06 -0500
Subject: [PATCH ipxe] build: customize configuration
diff --git a/src/config/local/general.h b/src/config/local/general.h
index 5814511..47d0e1a 100644
--- a/src/config/local/general.h
+++ b/src/config/local/general.h
@@ -0,0 +1,5 @@
+#undef ROM_BANNER_TIMEOUT
+#define ROM_BANNER_TIMEOUT 0
+
diff -rupN ipxe-20190125-git36a4c85f/src/config/local/general.h ipxe-20190125-git36a4c85f.new/src/config/local/general.h
--- ipxe-20190125-git36a4c85f/src/config/local/general.h 1970-01-01 01:00:00.000000000 +0100
+++ ipxe-20190125-git36a4c85f.new/src/config/local/general.h 2019-02-01 16:40:42.725293033 +0000
@@ -0,0 +1,4 @@
+/* Enable IPv6. */
+#define NET_PROTO_IPV6
--
2.9.3
+/* Enable HTTPS */
+#define DOWNLOAD_PROTO_HTTPS

View File

@ -1,119 +0,0 @@
From 2de005e9ac399f7064968a2611f266dc86a96700 Mon Sep 17 00:00:00 2001
From: Laszlo Ersek <lersek@redhat.com>
Date: Fri, 24 Jul 2020 19:15:28 +0200
Subject: [PATCH] [efi] perform cable detection at NII initialization on HPE
557SFP+
Commit c0b61bad99ba ("[efi] Work around bugs in Emulex NII driver",
2015-08-17) added PXE_OPFLAGS_INITIALIZE_DETECT_CABLE to nii_open() for
working around Emulex NII driver bugs.
That broke some Mellanox drivers, so commit 6324227dcaa8 ("[efi] Skip
cable detection at initialisation where possible", 2017-03-19) predicated
PXE_OPFLAGS_INITIALIZE_DETECT_CABLE on the NII driver's *inability* to
report link status.
This in turn breaks the NII driver on (some?) HPE 557SFP+ cards, as those
drivers are capable of reporting link status, but they still need cable
detection.
So check for this card (through PCI vendor / device / subsys vendor /
subsys device identifiers), and opt for cable detection regardless of link
status reporting.
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1740827
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
---
src/drivers/net/efi/nii.c | 43 ++++++++++++++++++++++++++++++++++++---
1 file changed, 40 insertions(+), 3 deletions(-)
diff --git a/src/drivers/net/efi/nii.c b/src/drivers/net/efi/nii.c
index 2d87e0c63f14..0cf065e0818f 100644
--- a/src/drivers/net/efi/nii.c
+++ b/src/drivers/net/efi/nii.c
@@ -193,6 +193,9 @@ struct nii_nic {
/** Mapping list */
struct list_head mappings;
+
+ /** quirk needed for HPE 557SFP+ */
+ int quirk_hpe557sfpp;
};
/** Maximum number of received packets per poll */
@@ -219,6 +222,7 @@ static int nii_pci_open ( struct nii_nic *nii ) {
int bar;
EFI_STATUS efirc;
int rc;
+ uint16_t vid, did, subsys_vid, subsys_did;
/* Locate PCI I/O protocol */
if ( ( rc = efi_locate_device ( device, &efi_pci_io_protocol_guid,
@@ -255,7 +259,7 @@ static int nii_pci_open ( struct nii_nic *nii ) {
rc = -EEFI ( efirc );
DBGC ( nii, "NII %s could not get BAR %d attributes: "
"%s\n", nii->dev.name, bar, strerror ( rc ) );
- goto err_get_bar_attributes;
+ goto err_pci;
}
if ( desc.acpi->ResType == ACPI_ADDRESS_SPACE_TYPE_MEM ) {
nii->mem_bar = bar;
@@ -276,9 +280,36 @@ static int nii_pci_open ( struct nii_nic *nii ) {
DBGC ( nii, "no I/O BAR\n" );
}
+ /* Check if HPE 557SFP+ quirk is needed */
+ if ( ( efirc = nii->pci_io->Pci.Read ( nii->pci_io,
+ EfiPciIoWidthUint16,
+ PCI_VENDOR_ID, 1,
+ &vid ) ) != 0 ||
+ ( efirc = nii->pci_io->Pci.Read ( nii->pci_io,
+ EfiPciIoWidthUint16,
+ PCI_DEVICE_ID, 1,
+ &did ) ) != 0 ||
+ ( efirc = nii->pci_io->Pci.Read ( nii->pci_io,
+ EfiPciIoWidthUint16,
+ PCI_SUBSYSTEM_VENDOR_ID, 1,
+ &subsys_vid ) ) != 0 ||
+ ( efirc = nii->pci_io->Pci.Read ( nii->pci_io,
+ EfiPciIoWidthUint16,
+ PCI_SUBSYSTEM_ID, 1,
+ &subsys_did ) ) != 0 ) {
+ rc = -EEFI ( efirc );
+ DBGC ( nii, "NII %s could not read PCI config space: %s\n",
+ nii->dev.name, strerror ( rc ) );
+ goto err_pci;
+ }
+
+ nii->quirk_hpe557sfpp = ( vid == 0x10df &&
+ did == 0x0720 &&
+ subsys_vid == 0x103c &&
+ subsys_did == 0x803f );
return 0;
- err_get_bar_attributes:
+ err_pci:
bs->CloseProtocol ( pci_device, &efi_pci_io_protocol_guid,
efi_image_handle, device );
err_open:
@@ -1144,8 +1175,14 @@ static int nii_open ( struct net_device *netdev ) {
* cable detection at this point if any only if the driver is
* not capable of reporting link status changes at runtime via
* PXE_OPCODE_GET_STATUS.
+ *
+ * HPE 557SFP+ seems to break with
+ * PXE_OPFLAGS_INITIALIZE_DO_NOT_DETECT_CABLE, but works with
+ * PXE_OPFLAGS_INITIALIZE_DETECT_CABLE, so ignore link status reporting
+ * for that NIC, and always request cable detection.
*/
- flags = ( nii->media ? PXE_OPFLAGS_INITIALIZE_DO_NOT_DETECT_CABLE
+ flags = ( ( ! nii->quirk_hpe557sfpp ) && nii->media
+ ? PXE_OPFLAGS_INITIALIZE_DO_NOT_DETECT_CABLE
: PXE_OPFLAGS_INITIALIZE_DETECT_CABLE );
if ( ( rc = nii_initialise_flags ( nii, flags ) ) != 0 )
goto err_initialise;
base-commit: b76052335788d0ad2c4b0bded116c3b02dd4bbc2
--
2.19.1.3.g30247aa5d201

View File

@ -0,0 +1,34 @@
From 2a9170ed88dc55d601a70d34f2d93157dc30e307 Mon Sep 17 00:00:00 2001
From: Miroslav Rezanina <mrezanin@redhat.com>
Date: Mon, 2 Aug 2021 08:33:47 -0400
Subject: [PATCH 2/5] Add VLAN tagging support
RH-Author: Miroslav Rezanina <mrezanin@redhat.com>
RH-MergeRequest: 6: Forwardport missing RHEL 8 downsteream changes
RH-Commit: [2/5] 3359f0d96c8743abefdf1b81857c84f4e7312f9d (mrezanin/centos-src-ipxe)
RH-Bugzilla: 1985658
RHEL 8 added support for VLAN tagging. We need to add it to RHEL 9
so we are not regressing.
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
---
src/config/general.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/config/general.h b/src/config/general.h
index 5adf6a35..a6df71b5 100644
--- a/src/config/general.h
+++ b/src/config/general.h
@@ -140,7 +140,7 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
//#define TIME_CMD /* Time commands */
//#define DIGEST_CMD /* Image crypto digest commands */
//#define LOTEST_CMD /* Loopback testing commands */
-//#define VLAN_CMD /* VLAN commands */
+#define VLAN_CMD /* VLAN commands */
//#define PXE_CMD /* PXE commands */
//#define REBOOT_CMD /* Reboot command */
//#define POWEROFF_CMD /* Power off command */
--
2.27.0

View File

@ -0,0 +1,36 @@
From 4d004e6a535c4f102c7b91c2f4d259cebaf1fb69 Mon Sep 17 00:00:00 2001
From: Miroslav Rezanina <mrezanin@redhat.com>
Date: Mon, 2 Aug 2021 08:11:12 -0400
Subject: [PATCH 1/5] Add ping command support
RH-Author: Miroslav Rezanina <mrezanin@redhat.com>
RH-MergeRequest: 6: Forwardport missing RHEL 8 downsteream changes
RH-Commit: [1/5] f95713f55d7af7970d39462c94b866f833eedca1 (mrezanin/centos-src-ipxe)
RH-Bugzilla: 1985658
To allow trouble shooting ipxe issues, ping command were added to
RHEL 8 (see BZ 1913719).
Adding this command to RHEL 9 to prevent regression from RHEL 8 functionality.
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
---
src/config/general.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/config/general.h b/src/config/general.h
index 3c14a2cd..5adf6a35 100644
--- a/src/config/general.h
+++ b/src/config/general.h
@@ -148,7 +148,7 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
//#define PCI_CMD /* PCI commands */
//#define PARAM_CMD /* Form parameter commands */
//#define NEIGHBOUR_CMD /* Neighbour management commands */
-//#define PING_CMD /* Ping command */
+#define PING_CMD /* Ping command */
//#define CONSOLE_CMD /* Console command */
//#define IPSTAT_CMD /* IP statistics commands */
//#define PROFSTAT_CMD /* Profiling commands */
--
2.27.0

View File

@ -0,0 +1,33 @@
From e50ff50417dca26223b771d2a93cf57d4f627104 Mon Sep 17 00:00:00 2001
From: Gerd Hoffmann <kraxel@redhat.com>
Date: Thu, 22 Jul 2021 15:49:51 +0200
Subject: [PATCH 1/4] Disable SHA-1
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
RH-Author: Gerd Hoffmann <kraxel@redhat.com>
RH-MergeRequest: 5: Disable SHA-1
RH-Commit: [1/1] 23f1cca1f3ac86958088c41e0f8122dde74c72cf (kraxel/ipxe)
RH-Bugzilla: 1935932
RH-Acked-by: Daniel P. Berrangé <berrange@redhat.com>
RH-Acked-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
---
src/config/local/crypto.h | 2 ++
1 file changed, 2 insertions(+)
create mode 100644 src/config/local/crypto.h
diff --git a/src/config/local/crypto.h b/src/config/local/crypto.h
new file mode 100644
index 00000000..ff4a5b7f
--- /dev/null
+++ b/src/config/local/crypto.h
@@ -0,0 +1,2 @@
+/** disable SHA-1 digest algorithm */
+#undef CRYPTO_DIGEST_SHA1
--
2.27.0

View File

@ -1,16 +1,12 @@
From 1a921ececb22bbc41d1fda34576564e84d124a83 Mon Sep 17 00:00:00 2001
From: Ladi Prosek <lprosek@redhat.com>
Date: Mon, 11 Jul 2016 14:17:36 +0200
Subject: Strip 802.1Q VLAN 0 priority tags
From ff3a5af3d7f78577899626b2f8b612369e051916 Mon Sep 17 00:00:00 2001
From: Miroslav Rezanina <mrezanin@redhat.com>
Date: Mon, 2 Aug 2021 08:32:33 -0400
Subject: [PATCH 3/5] [netdevice] Strip 802.Q VLAN 0 priority tags
RH-Author: Ladi Prosek <lprosek@redhat.com>
Message-id: <1468246656-15560-1-git-send-email-lprosek@redhat.com>
Patchwork-id: 71112
O-Subject: [RHEL7.3 ipxe PATCH] [netdevice] Strip 802.Q VLAN 0 priority tags
Bugzilla: 1316329
RH-Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
RH-Acked-by: Laszlo Ersek <lersek@redhat.com>
RH-Acked-by: Xiao Wang <jasowang@redhat.com>
RH-Author: Miroslav Rezanina <mrezanin@redhat.com>
RH-MergeRequest: 6: Forwardport missing RHEL 8 downsteream changes
RH-Commit: [3/5] 440560659da2028f365a71b4ed4991955022dce5 (mrezanin/centos-src-ipxe)
RH-Bugzilla: 1985658
iPXE was unable to receive priority tagged packets specified in
the 802.1Q standard and supported by all major networking stacks.
@ -22,21 +18,24 @@ headers.
Upstream patch:
http://lists.ipxe.org/pipermail/ipxe-devel/2016-July/005099.html
There is a difference between the upstream patch and this patch in the
path prefix of "interface/pxe/pxe_undi.c" because we don't have upstream
commit f468f12b1eca.
Downstream changes:
Upstream commit fe680c822856 made vlan_find static. This prevents
it's usage int this patch. Reverting changes adding static for
vlan_find.
Signed-off-by: Ladi Prosek <lprosek@redhat.com>
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
---
src/arch/x86/interface/pxe/pxe_undi.c | 6 +++++
src/include/ipxe/netdevice.h | 2 ++
src/interface/efi/efi_snp.c | 7 ++++++
src/net/netdevice.c | 44 +++++++++++++++++++++++++++++++++++
4 files changed, 59 insertions(+)
src/arch/x86/interface/pxe/pxe_undi.c | 6 +++
src/include/ipxe/netdevice.h | 2 +
src/include/ipxe/vlan.h | 2 +
src/interface/efi/efi_snp.c | 7 ++++
src/net/netdevice.c | 57 +++++++++++++++++++++++++++
src/net/vlan.c | 2 +-
6 files changed, 75 insertions(+), 1 deletion(-)
diff --git a/src/arch/x86/interface/pxe/pxe_undi.c b/src/arch/x86/interface/pxe/pxe_undi.c
index 2eb6817..2ea1451 100644
index 2eb68178..2ea14515 100644
--- a/src/arch/x86/interface/pxe/pxe_undi.c
+++ b/src/arch/x86/interface/pxe/pxe_undi.c
@@ -976,6 +976,12 @@ static PXENV_EXIT_t pxenv_undi_isr ( struct s_PXENV_UNDI_ISR *undi_isr ) {
@ -53,10 +52,10 @@ index 2eb6817..2ea1451 100644
switch ( net_proto ) {
case htons ( ETH_P_IP ):
diff --git a/src/include/ipxe/netdevice.h b/src/include/ipxe/netdevice.h
index a1d207f..cea87f7 100644
index d498ab69..27dda45d 100644
--- a/src/include/ipxe/netdevice.h
+++ b/src/include/ipxe/netdevice.h
@@ -719,6 +719,8 @@ extern int net_tx ( struct io_buffer *iobuf, struct net_device *netdev,
@@ -726,6 +726,8 @@ extern int net_tx ( struct io_buffer *iobuf, struct net_device *netdev,
extern int net_rx ( struct io_buffer *iobuf, struct net_device *netdev,
uint16_t net_proto, const void *ll_dest,
const void *ll_source, unsigned int flags );
@ -65,11 +64,24 @@ index a1d207f..cea87f7 100644
extern void net_poll ( void );
extern struct net_device_configurator *
find_netdev_configurator ( const char *name );
diff --git a/src/include/ipxe/vlan.h b/src/include/ipxe/vlan.h
index 7f93439b..b82f3806 100644
--- a/src/include/ipxe/vlan.h
+++ b/src/include/ipxe/vlan.h
@@ -61,6 +61,8 @@ struct vlan_header {
*/
#define VLAN_PRIORITY_IS_VALID( priority ) ( (priority) <= 7 )
+extern struct net_device * vlan_find ( struct net_device *trunk,
+ unsigned int tag );
extern unsigned int vlan_tag ( struct net_device *netdev );
extern int vlan_can_be_trunk ( struct net_device *trunk );
extern int vlan_create ( struct net_device *trunk, unsigned int tag,
diff --git a/src/interface/efi/efi_snp.c b/src/interface/efi/efi_snp.c
index e6388bf..d1a1a44 100644
index d648700f..a8f2ac8e 100644
--- a/src/interface/efi/efi_snp.c
+++ b/src/interface/efi/efi_snp.c
@@ -745,6 +745,13 @@ efi_snp_receive ( EFI_SIMPLE_NETWORK_PROTOCOL *snp,
@@ -813,6 +813,13 @@ efi_snp_receive ( EFI_SIMPLE_NETWORK_PROTOCOL *snp,
goto out_bad_ll_header;
}
@ -84,13 +96,15 @@ index e6388bf..d1a1a44 100644
if ( ll_header_len )
*ll_header_len = ll_protocol->ll_header_len;
diff --git a/src/net/netdevice.c b/src/net/netdevice.c
index 9df2119..c53d5e3 100644
index 3b02e64b..95803f26 100644
--- a/src/net/netdevice.c
+++ b/src/net/netdevice.c
@@ -1028,6 +1028,44 @@ int net_rx ( struct io_buffer *iobuf, struct net_device *netdev,
@@ -1043,6 +1043,45 @@ int net_rx ( struct io_buffer *iobuf, struct net_device *netdev,
return -ENOTSUP;
}
/**
+
+/**
+ * Strip extra link-layer-independent tags from a received packet
+ *
+ * @v iobuf I/O buffer
@ -128,11 +142,10 @@ index 9df2119..c53d5e3 100644
+ return 0;
+}
+
+/**
/**
* Poll the network stack
*
* This polls all interfaces for received packets, and processes
@@ -1078,6 +1116,12 @@ void net_poll ( void ) {
@@ -1094,6 +1133,12 @@ void net_poll ( void ) {
continue;
}
@ -145,6 +158,38 @@ index 9df2119..c53d5e3 100644
/* Hand packet to network layer */
if ( ( rc = net_rx ( iob_disown ( iobuf ), netdev,
net_proto, ll_dest,
@@ -1125,6 +1170,18 @@ __weak unsigned int vlan_tag ( struct net_device *netdev __unused ) {
return 0;
}
+/**
+ * Identify VLAN device (when VLAN support is not present)
+ *
+ * @v netdev Network device
+ * @v tag VLAN tag, or zero
+ * @v iobuf I/O buffer
+ */
+__weak struct net_device * vlan_find ( struct net_device *trunk __unused,
+ unsigned int tag __unused ) {
+ return NULL;
+}
+
/**
* Add VLAN tag-stripped packet to queue (when VLAN support is not present)
*
diff --git a/src/net/vlan.c b/src/net/vlan.c
index 90f2934d..0f234ea5 100644
--- a/src/net/vlan.c
+++ b/src/net/vlan.c
@@ -199,7 +199,7 @@ static void vlan_sync ( struct net_device *netdev ) {
* @v tag VLAN tag
* @ret netdev VLAN device, if any
*/
-static struct net_device * vlan_find ( struct net_device *trunk,
+struct net_device * vlan_find ( struct net_device *trunk,
unsigned int tag ) {
struct net_device *netdev;
struct vlan_device *vlan;
--
1.8.3.1
2.27.0

View File

@ -1,11 +0,0 @@
--- ./src/config/general.h.orig 2021-01-26 19:47:08.940559209 -0500
+++ ./src/config/general.h 2021-01-26 19:47:15.739526567 -0500
@@ -148,7 +148,7 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
//#define PCI_CMD /* PCI commands */
//#define PARAM_CMD /* Form parameter commands */
//#define NEIGHBOUR_CMD /* Neighbour management commands */
-//#define PING_CMD /* Ping command */
+#define PING_CMD /* Ping command */
//#define CONSOLE_CMD /* Console command */
//#define IPSTAT_CMD /* IP statistics commands */
//#define PROFSTAT_CMD /* Profiling commands */

View File

@ -1,12 +0,0 @@
diff -up ./src/config/general.h.vlan ./src/config/general.h
--- ./src/config/general.h.vlan 2018-10-09 13:11:42.940904753 -0400
+++ ./src/config/general.h 2018-10-09 13:12:03.258821711 -0400
@@ -140,7 +140,7 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
//#define TIME_CMD /* Time commands */
//#define DIGEST_CMD /* Image crypto digest commands */
//#define LOTEST_CMD /* Loopback testing commands */
-//#define VLAN_CMD /* VLAN commands */
+#define VLAN_CMD /* VLAN commands */
//#define PXE_CMD /* PXE commands */
//#define REBOOT_CMD /* Reboot command */
//#define POWEROFF_CMD /* Power off command */

0
SOURCES/script.ipxe Executable file → Normal file
View File

View File

@ -1,17 +1,18 @@
# Resulting binary formats we want from iPXE
%global formats rom
# ROMS we want for QEMU with format PCIID:QEMUNAME
%global qemuroms \\\
8086100e:e1000 \\\
10ec8139:rtl8139 \\\
1af41000:virtio \\\
808610d3:e1000e
# PCI IDs (vendor,product) of the ROMS we want for QEMU
#
# pcnet32: 0x1022 0x2000
# ne2k_pci: 0x10ec 0x8029
# e1000: 0x8086 0x100e
# rtl8139: 0x10ec 0x8139
# virtio-net: 0x1af4 0x1000
# eepro100: 0x8086 0x1209
# e1000e: 0x8086 0x10d3
# vmxnet3: 0x15ad 0x07b0
%global qemuroms 10222000 10ec8029 8086100e 10ec8139 1af41000 80861209 808610d3 15ad07b0
%if 0%{?fedora}
# Fedora specific roms
%global qemuroms %{qemuroms} \\\
10222000:pcnet \\\
10ec8029:ne2k_pci \\\
80861209:eepro100 \\\
15ad07b0:vmxnet3
%endif
# We only build the ROMs if on an EFI build host. The resulting
# binary RPM will be noarch, so other archs will still be able
@ -33,15 +34,14 @@
#
# And then change these two:
%global hash 133f4c47
%global date 20181214
%global hash 4bd064de
%global date 20200823
Name: ipxe
Version: %{date}
Release: 11.git%{hash}%{?dist}
Release: 9.git%{hash}%{?dist}
Summary: A network boot loader
Group: System Environment/Base
License: GPLv2 with additional permissions and BSD
URL: http://ipxe.org/
@ -52,57 +52,53 @@ Source1: script.ipxe
# Sent upstream: http://lists.ipxe.org/pipermail/ipxe-devel/2015-November/004494.html
Patch0001: 0001-build-customize-configuration.patch
Patch0002: 0002-Use-spec-compliant-timeouts.patch
Patch0003: 0003-Strip-802.1Q-VLAN-0-priority-tags.patch
Patch0004: ipxe-vlan-cmds.patch
Patch0005: 0001-efi-perform-cable-detection-at-NII-initialization-on-HPE-557SFP.patch
Patch0006: ipxe-ping-cmd.patch
Patch0007: 0001-arm-Provide-dummy-implementation-for-in-out-s-b-w-l.patch
# For bz#1935932 - ipxe implements and/or uses the deprecated SHA-1 algorithm by default (
Patch3: ipxe-Disable-SHA-1.patch
# For bz#1985658 - carry forward rhel8 ipxe packaging changes
Patch4: ipxe-Add-ping-command-support.patch
# For bz#1985658 - carry forward rhel8 ipxe packaging changes
Patch5: ipxe-Add-VLAN-tagging-support.patch
# For bz#1985658 - carry forward rhel8 ipxe packaging changes
Patch6: ipxe-netdevice-Strip-802.Q-VLAN-0-priority-tags.patch
# Source-git patches
%ifarch %{buildarches}
BuildRequires: perl-interpreter
BuildRequires: perl-Getopt-Long
BuildRequires: mtools
BuildRequires: mkisofs
BuildRequires: edk2-tools
BuildRequires: xz-devel
BuildRequires: binutils-devel
%if 0%{?fedora} >= 33 || 0%{?rhel} >= 9
BuildRequires: perl-FindBin
BuildRequires: perl-lib
%endif
%ifarch x86_64
BuildRequires: syslinux
%endif
BuildRequires: mtools
BuildRequires: xorriso
BuildRequires: edk2-tools
BuildRequires: xz-devel
BuildRequires: gcc
BuildRequires: binutils-devel
BuildRequires: make
Obsoletes: gpxe <= 1.0.1
%ifarch x86_64
%package rhcert
Summary: Redhat hwcert custom ipxe image
Group: Development/Tools
BuildArch: noarch
%package bootimgs-x86
Summary: X86 Network boot loader images in bootable USB, CD, floppy and GRUB formats
Group: Development/Tools
BuildArch: noarch
Provides: %{name}-bootimgs = %{version}-%{release}
Obsoletes: %{name}-bootimgs < 20181214-9.git133f4c47
Obsoletes: gpxe-bootimgs <= 1.0.1
%package roms
Summary: Network boot loader roms in .rom format
Group: Development/Tools
Requires: %{name}-roms-qemu = %{version}-%{release}
BuildArch: noarch
Obsoletes: gpxe-roms <= 1.0.1
%package roms-qemu
Summary: Network boot loader roms supported by QEMU, .rom format
Group: Development/Tools
BuildArch: noarch
Obsoletes: gpxe-roms-qemu <= 1.0.1
%description rhcert
Custom ipxe image for use in hardware certification and validation
%package bootimgs-x86
Summary: X86 Network boot loader images in bootable USB, CD, floppy and GRUB formats
BuildArch: noarch
Provides: %{name}-bootimgs = %{version}-%{release}
Obsoletes: %{name}-bootimgs < %{version}-%{release}
Obsoletes: gpxe-bootimgs <= 1.0.1
%description bootimgs-x86
iPXE is an open source network bootloader. It provides a direct
replacement for proprietary PXE ROMs, with many extra features such as
@ -110,6 +106,32 @@ DNS, HTTP, iSCSI, etc.
This package contains the iPXE boot images in USB, CD, floppy, and PXE
UNDI formats.
%endif
%ifarch aarch64
%package bootimgs-aarch64
Summary: AArch64 Network boot loader images in bootable USB and GRUB formats
Group: Development/Tools
BuildArch: noarch
%description bootimgs-aarch64
iPXE is an open source network bootloader. It provides a direct
replacement for proprietary PXE ROMs, with many extra features such as
DNS, HTTP, iSCSI, etc.
This package contains the iPXE ARM64 boot images in USB and GRUB formats.
%endif
%package roms
Summary: Network boot loader roms in .rom format
Requires: %{name}-roms-qemu = %{version}-%{release}
BuildArch: noarch
Obsoletes: gpxe-roms <= 1.0.1
%package roms-qemu
Summary: Network boot loader roms supported by QEMU, .rom format
BuildArch: noarch
Obsoletes: gpxe-roms-qemu <= 1.0.1
%description roms
iPXE is an open source network bootloader. It provides a direct
@ -127,20 +149,6 @@ This package contains the iPXE ROMs for devices emulated by QEMU, in
.rom format.
%endif
%ifarch aarch64
%package bootimgs-aarch64
Summary: AArch64 Network boot loader images in bootable USB and GRUB formats
Group: Development/Tools
BuildArch: noarch
%description bootimgs-aarch64
iPXE is an open source network bootloader. It provides a direct
replacement for proprietary PXE ROMs, with many extra features such as
DNS, HTTP, iSCSI, etc.
This package contains the iPXE ARM64 boot images in USB and GRUB formats.
%endif
%description
iPXE is an open source network bootloader. It provides a direct
replacement for proprietary PXE ROMs, with many extra features such as
@ -149,6 +157,7 @@ DNS, HTTP, iSCSI, etc.
%prep
%setup -q -n %{name}-%{version}-git%{hash}
%autopatch -p1
pushd src
# ath9k drivers are too big for an Option ROM, and ipxe devs say it doesn't
# make sense anyways
@ -183,7 +192,9 @@ make_ipxe ISOLINUX_BIN=/usr/share/syslinux/isolinux.bin \
# build roms with efi support for qemu
mkdir bin-combined
for rom in %{qemuroms}; do
for romstr in %{qemuroms}; do
rom=$(echo "$romstr" | cut -d ":" -f 1)
make_ipxe CONFIG=qemu bin/${rom}.rom
make_ipxe CONFIG=qemu bin-x86_64-efi/${rom}.efidrv
vid="0x${rom%%????}"
@ -219,35 +230,41 @@ pushd src/bin/
cp -a undionly.kpxe ipxe.{iso,usb,dsk,lkrn} %{buildroot}/%{_datadir}/%{name}/
for fmt in %{formats};do
for img in *.${fmt};do
if [ -e $img ]; then
cp -a $img %{buildroot}/%{_datadir}/%{name}/
echo %{_datadir}/%{name}/$img >> ../../${fmt}.list
for img in *.rom; do
if [ -e $img ]; then
cp -a $img %{buildroot}/%{_datadir}/%{name}/
echo %{_datadir}/%{name}/$img >> ../../rom.list
fi
done
done
popd
cp -a src/bin-i386-efi/ipxe.efi %{buildroot}/%{_datadir}/%{name}/ipxe-i386.efi
cp -a src/bin-x86_64-efi/ipxe.efi %{buildroot}/%{_datadir}/%{name}/ipxe-x86_64.efi
cp -a src/bin-x86_64-efi/ipxe-rhcert.efi %{buildroot}/%{_datadir}/%{name}/ipxe-x86_64-rhcert.efi
cp -a src/bin-x86_64-efi/snponly.efi %{buildroot}/%{_datadir}/%{name}/ipxe-snponly-x86_64.efi
cp -a src/bin-x86_64-efi/ipxe-rhcert.efi %{buildroot}/%{_datadir}/%{name}/ipxe-x86_64-rhcert.efi
mkdir -p %{buildroot}%{_datadir}/%{name}/qemu/
for romstr in %{qemuroms}; do
# the roms supported by qemu will be packaged separatedly
# remove from the main rom list and add them to qemu.list
rom=$(echo "$romstr" | cut -d ":" -f 1)
qemuname=$(echo "$romstr" | cut -d ":" -f 2)
sed -i -e "/\/${rom}.rom/d" rom.list
echo %{_datadir}/%{name}/${rom}.rom >> qemu.rom.list
# the roms supported by qemu will be packaged separatedly
# remove from the main rom list and add them to qemu.list
for fmt in rom ;do
for rom in %{qemuroms} ; do
sed -i -e "/\/${rom}.${fmt}/d" ${fmt}.list
echo %{_datadir}/%{name}/${rom}.${fmt} >> qemu.${fmt}.list
done
done
for rom in %{qemuroms}; do
cp src/bin-combined/${rom}.rom %{buildroot}/%{_datadir}/%{name}.efi/
echo %{_datadir}/%{name}.efi/${rom}.rom >> qemu.rom.list
# Set up symlinks with expected qemu firmware names
ln -s ../../ipxe/${rom}.rom %{buildroot}%{_datadir}/%{name}/qemu/pxe-${qemuname}.rom
ln -s ../../ipxe.efi/${rom}.rom %{buildroot}%{_datadir}/%{name}/qemu/efi-${qemuname}.rom
done
# endif x86_64
%endif
%ifarch aarch64
mkdir -p %{buildroot}/%{_datadir}/%{name}/arm64-efi
cp -a src/bin-arm64-efi/snponly.efi %{buildroot}/%{_datadir}/%{name}/arm64-efi/snponly.efi
@ -276,6 +293,7 @@ cp -a src/bin-arm64-efi/ipxe.efi %{buildroot}/%{_datadir}/%{name}/arm64-efi/ipxe
%files roms-qemu -f qemu.rom.list
%dir %{_datadir}/%{name}
%dir %{_datadir}/%{name}.efi
%{_datadir}/%{name}/qemu
%doc COPYING COPYING.GPLv2 COPYING.UBDL
%files rhcert
@ -294,46 +312,92 @@ cp -a src/bin-arm64-efi/ipxe.efi %{buildroot}/%{_datadir}/%{name}/arm64-efi/ipxe
%endif
%changelog
* Thu Sep 29 2022 Jarod Wilson <jarod@redhat.com> - 20181214-11.git133f4c47
- Revert LACP flood issue fix due to regressions is causes elsewhere
* Tue Apr 05 2022 Jarod Wilson <jarod@redhat.com> - 20200823-9.git4bd064de
- Fix Obsoletes: and changelog versioning
* Wed Jul 27 2022 Jarod Wilson <jarod@redhat.com> - 20181214-10.git133f4c47
- Fix LACP flood issue in ipxe-bootimgs (bz 2098761)
* Thu Mar 31 2022 Jarod Wilson <jarod@redhat.com> - 20200823-8.git4bd064de
- Add ARM 64 EFI artifacts [yselkowi] (bz 2059349)
* Tue Mar 01 2022 Yaakov Selkowitz <yselkowi@redhat.com> - 20181214-9.git133f4c47
- Add ARM 64 EFI artifacts (bz 2059350)
* Mon Aug 09 2021 Mohan Boddu <mboddu@redhat.com> - 20200823-7.git4bd064de
- Rebuilt for IMA sigs, glibc 2.34, aarch64 flags
Related: rhbz#1991688
* Fri Feb 19 2021 Jarod Wilson <jarod@redhat.com> - 20181210-8.git133f4c47
- combine BIOS and EFI roms using utils/catrom.pl [lersek] (bz 1926561)
* Sat Aug 07 2021 Miroslav Rezanina <mrezanin@redhat.com> - 20200823-6.git4bd064de
- ipxe-Add-ping-command-support.patch [bz#1985658]
- ipxe-Add-VLAN-tagging-support.patch [bz#1985658]
- ipxe-netdevice-Strip-802.Q-VLAN-0-priority-tags.patch [bz#1985658]
- ipxe-Provide-snponly.efi-rom.patch [bz#1985658]
- ipxe-Build-hwcert-subpackage.patch [bz#1985658]
- Resolves: bz#1985658
(carry forward rhel8 ipxe packaging changes)
* Tue Jan 26 2021 Jarod Wilson <jarod@redhat.com> - 20181210-7.git133f4c47
- Build ping command (bz 1913719)
* Mon Jul 26 2021 Miroslav Rezanina <mrezanin@redhat.com> - 20200823-5.git4bd064de
- ipxe-Disable-SHA-1.patch [bz#1935932]
- ipxe-Replace-genisoimage-with-xorriso.patch [bz#1971981]
- ipxe-spec-Drop-disabled-efi-ia32-build-infrastructure.patch [bz#1980138]
- ipxe-spec-Generate-qemu-compatible-rom-filenames.patch [bz#1980138]
- Resolves: bz#1935932
(ipxe implements and/or uses the deprecated SHA-1 algorithm by default ()
- Resolves: bz#1971981
(Please replace genisoimage with xorriso)
- Resolves: bz#1980138
(install qemu rom symlinks so qemu doesn't have to)
* Mon Jul 27 2020 Neil Horman <nhorman@redhat.com> - 20181210-6.git133f4c47
- Add quirk for link detect on HP 557SFP cards (bz 1740827)
* Tue Jun 08 2021 Miroslav Rezanina <mrezanin@redhat.com> - 20200823-4.git4bd064de
- ipxe-Skip-some-QEMU-ROMs-when-building-for-RHEL.patch [bz#1956931]
- ipxe-spec-combine-BIOS-and-EFI-roms-using-util-catrom.pl.patch [bz#1957246]
- Resolves: bz#1956931
(ipxe-roms-qemu list: Clean out old ROMs)
- Resolves: bz#1957246
(boot vm from pxe failed)
* Tue Jan 7 2020 Neil Horman <nhorman@redhat.com> - 20181210-5.git133f4c47
- Add rhcert subpackage (bz 1756012)
* Fri Apr 16 2021 Mohan Boddu <mboddu@redhat.com> - 20200823-3.git4bd064de
- Rebuilt for RHEL 9 BETA on Apr 15th 2021. Related: rhbz#1947937
* Fri Dec 13 2019 Neil Horman <nhorman@redhat.com> - 20181210-4.git133f4c47
- Add snponly.efi image (bz 1776929)
* Tue Jan 26 2021 Fedora Release Engineering <releng@fedoraproject.org> - 20200823-2.git4bd064de
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
* Tue Aug 13 2019 Danilo de Paula <ddepaula@redhat.com> - 20181210-3.git133f4c47
- Release bump
* Tue Sep 15 2020 Cole Robinson <aintdiscole@gmail.com> - 20200823-1.git4bd064de.git
- Update to newer git snapshot, synced with qemu.git
- Re-enable HTTPS support, with edk2 fix included (bz 1820836)
* Thu Jul 25 2019 Danilo de Paula <ddepaula@redhat.com> - 20181210-2.git133f4c47
- Resolves rhbz#1723702
(virtio rom near 256k boundary)
* Fri Sep 04 2020 Merlin Mathesius <mmathesi@redhat.com> - 20190125-9.git36a4c85f
- Workaound fatal GCC 9 compilation/link errors
- Fix conditionals for perl BuildRequires
* Fri Dec 14 2018 Neil Horman <nhorman@redhat.com> - 20181210-1.git133f4c47
- Update to latest upstream
- Add vlan cmds
* Mon Aug 17 2020 Cole Robinson <aintdiscole@gmail.com> - 20190125-8.git36a4c85f
- Revert HTTPS support, causes boot hangs with UEFI (bz 1869102)
* Fri Nov 16 2018 Danilo C. L. de Paula <ddepaula@redhat.com> - 20170710-6.git0600d3ae
- rebuilt
* Tue Aug 11 2020 Cole Robinson <aintdiscole@gmail.com> - 20190125-7.git36a4c85f
- Enable HTTPS support (bug 1820836)
* Thu Jul 12 2018 Danilo - 20170710-5.git0600d3ae
- Bumping release number and rebuilding ipxe for RHEL-8.0
* Wed Jul 29 2020 Richard W.M. Jones <rjones@redhat.com> - 20190125-6.git36a4c85f
- Explicitly BR perl-FindBin and perl-lib.
* Tue Jul 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 20190125-5.git36a4c85f
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
* Wed Jan 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 20190125-4.git36a4c85f
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
* Thu Jul 25 2019 Fedora Release Engineering <releng@fedoraproject.org> - 20190125-3.git36a4c85f
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
* Tue Jul 16 2019 Paolo Bonzini <pbonxini@redhat.com> - 20190125-2.git36a4c85f
- Allow removing IA32 EFI images from combined oproms
- Check that the ROMs fit in 256K and pad them
* Tue Feb 12 2019 Daniel P. Berrangé <berrange@redhat.com> - 20190125-1.git36a4c85f
- Update to latest git snapshot
* Fri Feb 01 2019 Fedora Release Engineering <releng@fedoraproject.org> - 20170710-6.git0600d3ae
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
* Mon Jul 23 2018 Daniel P. Berrangé <berrange@redhat.com> - 20170710-5.git0600d3ae
- mkisofs tool moved to genisoimage RPM
* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 20170710-4.git0600d3ae
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
* Wed Feb 07 2018 Fedora Release Engineering <releng@fedoraproject.org> - 20170710-3.git0600d3ae
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild