Package init
This commit is contained in:
commit
d3df0c1ea8
6
0001-build-customize-configuration.patch
Normal file
6
0001-build-customize-configuration.patch
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
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,2 @@
|
||||||
|
+/* Enable IPv6. */
|
||||||
|
+#define NET_PROTO_IPV6
|
||||||
98
0002-Use-spec-compliant-timeouts.patch
Normal file
98
0002-Use-spec-compliant-timeouts.patch
Normal file
@ -0,0 +1,98 @@
|
|||||||
|
From bc252caa54fcfb2e9fd0ddb01ebaa50192e85c38 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Alex Williamson <alex.williamson@redhat.com>
|
||||||
|
Date: Wed, 21 Oct 2015 11:18:40 +0200
|
||||||
|
Subject: Use spec compliant timeouts
|
||||||
|
|
||||||
|
Message-id: <20150428212403.31299.29391.stgit@gimli.home>
|
||||||
|
Patchwork-id: 64951
|
||||||
|
O-Subject: [RHEL7.2 ipxe PATCH 2/2] [dhcp][RHEL-only] Use spec compliant timeouts
|
||||||
|
Bugzilla: 1196352
|
||||||
|
RH-Acked-by: Miroslav Rezanina <mrezanin@redhat.com>
|
||||||
|
RH-Acked-by: Gerd Hoffmann <kraxel@redhat.com>
|
||||||
|
RH-Acked-by: Laszlo Ersek <lersek@redhat.com>
|
||||||
|
|
||||||
|
Use local config to override iPXE's abbreviated DHCP timeouts using
|
||||||
|
the recommended values for spec compliance. This matches the state
|
||||||
|
of RHEL6 gPXE DHCP timeouts after bz968474 + bz1206042
|
||||||
|
|
||||||
|
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
|
||||||
|
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
|
||||||
|
(cherry picked from commit 7038f41c0131d263de5165b416500009acdbf550)
|
||||||
|
---
|
||||||
|
src/config/local/.gitignore | 1 -
|
||||||
|
src/config/local/dhcp.h | 62 +++++++++++++++++++++++++++++++++++++++++++++
|
||||||
|
2 files changed, 62 insertions(+), 1 deletion(-)
|
||||||
|
delete mode 100644 src/config/local/.gitignore
|
||||||
|
create mode 100644 src/config/local/dhcp.h
|
||||||
|
|
||||||
|
diff --git a/src/config/local/dhcp.h b/src/config/local/dhcp.h
|
||||||
|
new file mode 100644
|
||||||
|
index 0000000..83df5b8
|
||||||
|
--- /dev/null
|
||||||
|
+++ b/src/config/local/dhcp.h
|
||||||
|
@@ -0,0 +1,62 @@
|
||||||
|
+/*
|
||||||
|
+ * Downstream localization
|
||||||
|
+ *
|
||||||
|
+ * For RHEL, use spec compliant DHCP timeouts (bz1196352)
|
||||||
|
+ */
|
||||||
|
+
|
||||||
|
+/*
|
||||||
|
+ * PXE spec defines timeouts of 4, 8, 16, 32 seconds
|
||||||
|
+ */
|
||||||
|
+#undef DHCP_DISC_START_TIMEOUT_SEC
|
||||||
|
+#define DHCP_DISC_START_TIMEOUT_SEC 4
|
||||||
|
+#undef DHCP_DISC_END_TIMEOUT_SEC
|
||||||
|
+#define DHCP_DISC_END_TIMEOUT_SEC 32
|
||||||
|
+
|
||||||
|
+/*
|
||||||
|
+ * Elapsed time used for early break waiting for ProxyDHCP, this therefore
|
||||||
|
+ * needs to be less than the cumulative time for the first 2 timeouts.
|
||||||
|
+ */
|
||||||
|
+#undef DHCP_DISC_PROXY_TIMEOUT_SEC
|
||||||
|
+#define DHCP_DISC_PROXY_TIMEOUT_SEC 11
|
||||||
|
+
|
||||||
|
+/*
|
||||||
|
+ * Approximate PXE spec requirement using minimum timeout (0.25s) for
|
||||||
|
+ * timeouts of 0.25, 0.5, 1, 2, 4
|
||||||
|
+ */
|
||||||
|
+#undef DHCP_REQ_START_TIMEOUT_SEC
|
||||||
|
+#define DHCP_REQ_START_TIMEOUT_SEC 0
|
||||||
|
+#undef DHCP_REQ_END_TIMEOUT_SEC
|
||||||
|
+#define DHCP_REQ_END_TIMEOUT_SEC 4
|
||||||
|
+
|
||||||
|
+/*
|
||||||
|
+ * Same as normal request phase, except non-fatal, so we extend the timer
|
||||||
|
+ * to 8 and set the early timeout to an elapsed time value that causes a
|
||||||
|
+ * break after the 4 second timeout. At least that's what we'd like to do,
|
||||||
|
+ * but our timer operates at 18Hz and has a minimum resolution of 7 cycles.
|
||||||
|
+ * Therefore the above quarter-second starting timeout looks more like
|
||||||
|
+ * 0.39s, 0.78s, 1.56s, 3.11s, 6.22s. If we had an ideal timer, we could
|
||||||
|
+ * set the timeout to 7s (0.25 + 0.5 + 1 + 2 + 4 = 7.75s) and exit without
|
||||||
|
+ * failure when the timer rolls over to 8s. With our timer, we get 0.39 +
|
||||||
|
+ * 0.78 + 1.56 + 3.11 = 5.84s. The next timeout would take us to 12.06s
|
||||||
|
+ * (+6.22). That seems like a long time to wait for an optional reply, so
|
||||||
|
+ * we reduce the early timeout to 5s to exit before the timer exceeds the
|
||||||
|
+ * max and causes a failure. This still adds one extra cycle vs the
|
||||||
|
+ * upstream defaults.
|
||||||
|
+ */
|
||||||
|
+#undef DHCP_PROXY_START_TIMEOUT_SEC
|
||||||
|
+#define DHCP_PROXY_START_TIMEOUT_SEC 0
|
||||||
|
+#undef DHCP_PROXY_END_TIMEOUT_SEC
|
||||||
|
+#define DHCP_PROXY_END_TIMEOUT_SEC 8
|
||||||
|
+#undef DHCP_REQ_PROXY_TIMEOUT_SEC
|
||||||
|
+#define DHCP_REQ_PROXY_TIMEOUT_SEC 5
|
||||||
|
+
|
||||||
|
+/*
|
||||||
|
+ * Same as above, retry each server using our approximation of standard
|
||||||
|
+ * timeouts and exit before timer induced failure.
|
||||||
|
+ */
|
||||||
|
+#undef PXEBS_START_TIMEOUT_SEC
|
||||||
|
+#define PXEBS_START_TIMEOUT_SEC 0
|
||||||
|
+#undef PXEBS_END_TIMEOUT_SEC
|
||||||
|
+#define PXEBS_END_TIMEOUT_SEC 8
|
||||||
|
+#undef PXEBS_MAX_TIMEOUT_SEC
|
||||||
|
+#define PXEBS_MAX_TIMEOUT_SEC 5
|
||||||
|
--
|
||||||
|
1.8.3.1
|
||||||
|
|
||||||
BIN
ipxe-20190125-git36a4c85f.tar.xz
Normal file
BIN
ipxe-20190125-git36a4c85f.tar.xz
Normal file
Binary file not shown.
127
ipxe.spec
Normal file
127
ipxe.spec
Normal file
@ -0,0 +1,127 @@
|
|||||||
|
%global formats rom
|
||||||
|
%global qemuroms 10222000 10ec8029 8086100e 10ec8139 1af41000 80861209 808610d3 15ad07b0
|
||||||
|
%global buildarches %{ix86} x86_64
|
||||||
|
%global debug_package %{nil}
|
||||||
|
%global hash 36a4c85f
|
||||||
|
|
||||||
|
Name: ipxe
|
||||||
|
Version: 20190125
|
||||||
|
Release: 1
|
||||||
|
Summary: A network boot loader
|
||||||
|
|
||||||
|
License: GPLv2 with additional permissions and BSD
|
||||||
|
URL: http://ipxe.org/
|
||||||
|
Source0: %{name}-%{version}-git%{hash}.tar.xz
|
||||||
|
Patch0001: 0001-build-customize-configuration.patch
|
||||||
|
Patch0002: 0002-Use-spec-compliant-timeouts.patch
|
||||||
|
|
||||||
|
%ifarch %{buildarches}
|
||||||
|
BuildRequires: perl-interpreter perl-Getopt-Long syslinux mtools genisoimage edk2-tools
|
||||||
|
BuildRequires: xz-devel gcc binutils-devel binutils-x86_64-linux-gnu gcc-x86_64-linux-gnu
|
||||||
|
Obsoletes: gpxe-bootimgs gpxe-roms gpxe-roms-qem
|
||||||
|
Provides: %{name}-bootimgs %{name}-roms %{name}-roms-qemu
|
||||||
|
Obsoletes: %{name}-bootimgs %{name}-roms %{name}-roms-qemu
|
||||||
|
%endif
|
||||||
|
Obsoletes: gpxe <= 1.0.1
|
||||||
|
|
||||||
|
%description
|
||||||
|
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.
|
||||||
|
|
||||||
|
%prep
|
||||||
|
%setup -q -n %{name}-%{version}-git%{hash}
|
||||||
|
%autopatch -p1
|
||||||
|
|
||||||
|
|
||||||
|
%build
|
||||||
|
%ifarch %{buildarches}
|
||||||
|
cd src
|
||||||
|
|
||||||
|
rm -rf drivers/net/ath/ath9k
|
||||||
|
|
||||||
|
make_ipxe() {
|
||||||
|
make %{?_smp_mflags} \
|
||||||
|
NO_WERROR=1 V=1 \
|
||||||
|
GITVERSION=%{hash} \
|
||||||
|
CROSS_COMPILE=x86_64-linux-gnu- \
|
||||||
|
"$@"
|
||||||
|
}
|
||||||
|
|
||||||
|
make_ipxe bin-i386-efi/ipxe.efi bin-x86_64-efi/ipxe.efi
|
||||||
|
|
||||||
|
make_ipxe ISOLINUX_BIN=/usr/share/syslinux/isolinux.bin \
|
||||||
|
bin/undionly.kpxe bin/ipxe.{dsk,iso,usb,lkrn} \
|
||||||
|
allroms
|
||||||
|
|
||||||
|
mkdir bin-combined
|
||||||
|
for rom in %{qemuroms}; do
|
||||||
|
make_ipxe CONFIG=qemu bin/${rom}.rom
|
||||||
|
make_ipxe CONFIG=qemu bin-i386-efi/${rom}.efidrv
|
||||||
|
make_ipxe CONFIG=qemu bin-x86_64-efi/${rom}.efidrv
|
||||||
|
vid="0x${rom%%????}"
|
||||||
|
did="0x${rom#????}"
|
||||||
|
EfiRom -f "$vid" -i "$did" --pci23 \
|
||||||
|
-b bin/${rom}.rom \
|
||||||
|
-ec bin-i386-efi/${rom}.efidrv \
|
||||||
|
-ec bin-x86_64-efi/${rom}.efidrv \
|
||||||
|
-o bin-combined/${rom}.rom
|
||||||
|
EfiRom -d bin-combined/${rom}.rom
|
||||||
|
truncate -s \>256K bin-combined/${rom}.rom
|
||||||
|
test $(stat -c '%s' bin-combined/${rom}.rom) -le $((256 * 1024))
|
||||||
|
done
|
||||||
|
|
||||||
|
%endif
|
||||||
|
|
||||||
|
%install
|
||||||
|
%ifarch %{buildarches}
|
||||||
|
mkdir -p %{buildroot}/%{_datadir}/%{name}/
|
||||||
|
mkdir -p %{buildroot}/%{_datadir}/%{name}.efi/
|
||||||
|
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
|
||||||
|
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
|
||||||
|
|
||||||
|
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/
|
||||||
|
done
|
||||||
|
%endif
|
||||||
|
|
||||||
|
%ifarch %{buildarches}
|
||||||
|
%files -f rom.list
|
||||||
|
%defattr(-,root,root)
|
||||||
|
%doc COPYING COPYING.GPLv2 COPYING.UBDL
|
||||||
|
%dir %{_datadir}/%{name}
|
||||||
|
%dir %{_datadir}/%{name}.efi
|
||||||
|
%{_datadir}/%{name}/ipxe.iso
|
||||||
|
%{_datadir}/%{name}/ipxe.usb
|
||||||
|
%{_datadir}/%{name}/ipxe.dsk
|
||||||
|
%{_datadir}/%{name}/ipxe.lkrn
|
||||||
|
%{_datadir}/%{name}/ipxe-i386.efi
|
||||||
|
%{_datadir}/%{name}/ipxe-x86_64.efi
|
||||||
|
%{_datadir}/%{name}/undionly.kpxe
|
||||||
|
%{_datadir}/%{name}.efi/*.rom
|
||||||
|
%endif
|
||||||
|
|
||||||
|
%changelog
|
||||||
|
* Thu Sep 19 2019 openEuler Buildteam <buildteam@openeuler.org> - 20190125-1
|
||||||
|
- Package init
|
||||||
|
|
||||||
Loading…
x
Reference in New Issue
Block a user