diff options
Diffstat (limited to 'ipxe.spec')
-rw-r--r-- | ipxe.spec | 337 |
1 files changed, 196 insertions, 141 deletions
@@ -1,40 +1,89 @@ -%global formats rom -%global qemuroms 10222000 10ec8029 8086100e 10ec8139 1af41000 80861209 808610d3 15ad07b0 -%global buildarches x86_64 +# ROMS we want for QEMU with format PCIID:QEMUNAME +%global qemuroms \\\ + 8086100e:e1000 \\\ + 10ec8139:rtl8139 \\\ + 1af41000:virtio \\\ + 808610d3:e1000e + +%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 +# to use the binary ROMs. +%global buildarches x86_64 aarch64 + +# debugging firmwares does not go the same way as a normal program. +# moreover, all architectures providing debuginfo for a single noarch +# package is currently clashing in koji, so don't bother. %global debug_package %{nil} -%global enable_i386 0 - -Name: ipxe -Version: 1.21.1 -Release: 5 -Summary: A network boot loader -Epoch: 1 -License: GPLv2 with additional permissions and BSD -URL: http://ipxe.org/ -Source0: https://github.com/ipxe/ipxe/archive/v%{version}.tar.gz -Patch0001: 0001-build-customize-configuration.patch -Patch0002: 0002-Use-spec-compliant-timeouts.patch -Patch0003: 0003-librm-Use-explicit-operand-size-when-pushing-a-label.patch - -Patch6000: backport-avoid-infinite-loop-on-allocation-failure-in.patch -Patch6001: backport-ensure-that-pci_read_config-initialises-all-fields.patch -Patch6002: backport-do-not-clear-current-working-url-when-executing-embedded-image.patch -Patch6003: backport-retain-original-encodings-for-path-query-and-fragment-fields.patch -Patch6004: backport-allow-for-relative-uris-that-include-colons-within-the-path.patch + +# Upstream don't do "releases" :-( So we're going to use the date +# as the version, and a GIT hash as the release. Generate new GIT +# snapshots using the folowing commands: +# +# $ hash=`git log -1 --format='%h'` +# $ date=`git log -1 --format='%cd' --date=short | tr -d -` +# $ git archive --prefix ipxe-${date}-git${hash}/ ${hash} | xz -7e > ipxe-${date}-git${hash}.tar.xz +# +# And then change these two: + +%global hash de8a0821 +%global date 20240119 + +Name: ipxe +Version: %{date} +Release: 2.git%{hash}%{?dist} +Summary: A network boot loader + +License: BSD-2-Clause AND BSD-3-Clause AND GPL-2.0-only AND (GPL-2.0-only OR MPL-1.1) AND GPL-2.0-or-later AND GPL-2.0-or-later WITH UBDL-exception AND ISC AND MIT +URL: http://ipxe.org/ + +Source0: %{name}-%{version}-git%{hash}.tar.xz + +# Enable IPv6 for qemu's config +# 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 %ifarch %{buildarches} -BuildRequires: perl-interpreter perl-Getopt-Long syslinux mtools genisoimage edk2-devel -BuildRequires: xz-devel gcc binutils-devel +BuildRequires: perl-interpreter +BuildRequires: perl-Getopt-Long +%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-devel +BuildRequires: xz-devel +BuildRequires: gcc +BuildRequires: binutils-devel +BuildRequires: make + Obsoletes: gpxe <= 1.0.1 +%endif -%package bootimgs -Summary: Network boot loader images in bootable USB, CD, floppy and GRUB formats +%ifarch x86_64 +%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 < 20200823-9.git4bd064de Obsoletes: gpxe-bootimgs <= 1.0.1 %package roms Summary: Network boot loader roms in .rom format -Requires: %{name}-roms-qemu = %{epoch}:%{version}-%{release} +Requires: %{name}-roms-qemu = %{version}-%{release} BuildArch: noarch Obsoletes: gpxe-roms <= 1.0.1 @@ -43,7 +92,7 @@ Summary: Network boot loader roms supported by QEMU, .rom format BuildArch: noarch Obsoletes: gpxe-roms-qemu <= 1.0.1 -%description bootimgs +%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 DNS, HTTP, iSCSI, etc. @@ -68,108 +117,133 @@ This package contains the iPXE ROMs for devices emulated by QEMU, in .rom format. %endif +%ifarch aarch64 +%package bootimgs-aarch64 +Summary: ARM Network boot loader images in bootable USB and GRUB formats +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 ARM 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 DNS, HTTP, iSCSI, etc. %prep -%setup -q -n %{name}-%{version} +%setup -q -n %{name}-%{version}-git%{hash} %autopatch -p1 - +# ath9k drivers are too big for an Option ROM, and ipxe devs say it doesn't +# make sense anyways +# http://lists.ipxe.org/pipermail/ipxe-devel/2012-March/001290.html +rm -rf src/drivers/net/ath/ath9k %build -%ifarch %{buildarches} cd src -rm -rf drivers/net/ath/ath9k - make_ipxe() { make %{?_smp_mflags} \ NO_WERROR=1 V=1 \ - GITVERSION=%{hash} \ "$@" } -make_ipxe bin-i386-efi/ipxe.efi bin-x86_64-efi/ipxe.efi bin-x86_64-linux/tests.linux \ - %if 0%{?enable i386} - bin-i386-linux/tests.linux - %endif +%ifarch x86_64 + +make_ipxe bin-i386-efi/ipxe.efi bin-x86_64-efi/ipxe.efi \ + bin-x86_64-efi/snponly.efi make_ipxe ISOLINUX_BIN=/usr/share/syslinux/isolinux.bin \ bin/undionly.kpxe bin/ipxe.{dsk,iso,usb,lkrn} \ allroms +# 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 -%if 0%{?enable_i386} - make_ipxe CONFIG=qemu bin-i386-efi/${rom}.efidrv -%endif 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 \ -%if 0%{?enable_i386} - -ec bin-i386-efi/${rom}.efidrv \ -%endif -ec bin-x86_64-efi/${rom}.efidrv \ - -o bin-combined/${rom}.rom + -o bin-combined/${rom}.eficrom + util/catrom.pl \ + bin/${rom}.rom \ + bin-combined/${rom}.eficrom \ + > bin-combined/${rom}.rom EfiRom -d bin-combined/${rom}.rom + # truncate to at least 256KiB truncate -s \>256K bin-combined/${rom}.rom + # verify rom fits in 256KiB test $(stat -c '%s' bin-combined/${rom}.rom) -le $((256 * 1024)) done %endif +%ifarch aarch64 +make_ipxe bin-arm64-efi/snponly.efi +%if 0%{?fedora} +make_ipxe bin-arm64-efi/ipxe.efi +%endif +%endif + %install -%ifarch %{buildarches} +%ifarch x86_64 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 +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/snponly.efi %{buildroot}/%{_datadir}/%{name}/ipxe-snponly-x86_64.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 -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 -%check -%ifarch %{buildarches} -cd ~/rpmbuild/BUILD/%{name}-%{version}/src/bin-x86_64-linux/ -./tests.linux -%if 0%{?enable_i386} -cd ~/rpmbuild/BUILD/%{name}-%{version}/src/bin-i386-linux/ -./tests.linux +%ifarch aarch64 +mkdir -p %{buildroot}/%{_datadir}/%{name}/arm64-efi +cp -a src/bin-arm64-efi/snponly.efi %{buildroot}/%{_datadir}/%{name}/arm64-efi/snponly.efi +%if 0%{?fedora} +cp -a src/bin-arm64-efi/ipxe.efi %{buildroot}/%{_datadir}/%{name}/arm64-efi/ipxe.efi %endif %endif -%ifarch %{buildarches} -%files bootimgs -%defattr(-,root,root) -%license COPYING COPYING.GPLv2 COPYING.UBDL +%ifarch x86_64 +%files bootimgs-x86 %dir %{_datadir}/%{name} %{_datadir}/%{name}/ipxe.iso %{_datadir}/%{name}/ipxe.usb @@ -178,82 +252,63 @@ cd ~/rpmbuild/BUILD/%{name}-%{version}/src/bin-i386-linux/ %{_datadir}/%{name}/ipxe-i386.efi %{_datadir}/%{name}/ipxe-x86_64.efi %{_datadir}/%{name}/undionly.kpxe +%{_datadir}/%{name}/ipxe-snponly-x86_64.efi +%doc COPYING COPYING.GPLv2 COPYING.UBDL %files roms -f rom.list -%defattr(-,root,root) -%license COPYING COPYING.GPLv2 COPYING.UBDL %dir %{_datadir}/%{name} +%doc COPYING COPYING.GPLv2 COPYING.UBDL %files roms-qemu -f qemu.rom.list -%defattr(-,root,root) -%license COPYING COPYING.GPLv2 COPYING.UBDL %dir %{_datadir}/%{name} %dir %{_datadir}/%{name}.efi +%{_datadir}/%{name}/qemu +%doc COPYING COPYING.GPLv2 COPYING.UBDL +%endif + +%ifarch aarch64 +%files bootimgs-aarch64 +%dir %{_datadir}/%{name} +%dir %{_datadir}/%{name}/arm64-efi +%if 0%{?fedora} +%{_datadir}/%{name}/arm64-efi/ipxe.efi +%endif +%{_datadir}/%{name}/arm64-efi/snponly.efi %endif %changelog -* Fri Mar 15 2024 herengui <herengui@kylinsec.com.cn> - 1:1.21.1-5 -- Type:bugfix -- CVE:NA -- SUG:NA -- DESC: fix errors when compiling with binutils-2.41 - -* Wed Nov 23 2022 zhangqiumiao <zhangqiumiao1@huawei.com> - 1:1.21.1-4 -- Type:bugfix -- CVE:NA -- SUG:NA -- DESC:[pci] Ensure that pci_read_config() initialises all fields - [image] Do not clear current working URI when executing embedded image - [uri] Retain original encodings for path, query, and fragment fields - [uri] Allow for relative URIs that include colons within the path - -* Sat Mar 26 2022 wangkerong <wangkerong@h-partners.com> - 1.21.1-3 -- enable test - -* Wed Jun 09 2021 wangkerong <wangkerong@huawei.com> - 1.21.1-2 -- Type:bugfix -- Id:NA -- SUG:NA -- DESC: round commmunity patch fix Avoid infinite loop on allocation failure - -* Wed Feb 03 2021 gaihuiying <gaihuiying1@huawei.com> - 1.21.1-1 -- Type:requirement -- Id:NA -- SUG:NA -- DESC: update ipxe to 1.21.1 - -* Thu Sep 03 2020 zhouyihang <zhouyihang3@huawei.com> - 1.20.1-2 -- Type:bugfix -- Id:NA -- SUG:NA -- DESC: add epoch for roms-qemu when required by roms - -* Tue Jun 23 2020 zhujunhao <zhujunhao8@huawei.com> - 1.20.1-1 -- update to 1.20.1 - -* Mon Jan 13 2020 openEuler Buildteam <buildteam@openeuler.org> - 20190125-5 -- Type:bugfix -- Id:NA -- SUG:NA -- DESC: add bootimgs roms roms-qemu subpackages - -* Fri Nov 29 2019 openEuler Buildteam <buildteam@openeuler.org> - 20190125-4 -- Type:bugfix -- Id:NA -- SUG:NA -- DESC: fix build error on x86_64 - -* Sat Oct 19 2019 openEuler Buildteam <buildteam@openeuler.org> - 20190125-3 -- Type:bugfix -- Id:NA -- SUG:NA -- DESC:change the directory of the license files - -* Thu Oct 10 2019 openEuler Buildteam <buildteam@openeuler.org> - 20190125-2 -- Type:enhancement -- ID:NA -- SUG:NA -- DESC:add requires - -* Thu Sep 19 2019 openEuler Buildteam <buildteam@openeuler.org> - 20190125-1 -- Package init +* Thu Jul 18 2024 Fedora Release Engineering <releng@fedoraproject.org> - 20240119-2.gitde8a0821 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild + +* Tue Jan 30 2024 Daniel P. Berrangé <berrange@redhat.com> - 20240119-1.gitde8a0821 +- Update to latest git snapshot + +* Thu Jan 25 2024 Stid Official <stidofficiel@gmail.com> - 20220210-8.git64113751 +- Add support of NFS protocol + +* Wed Jan 24 2024 Fedora Release Engineering <releng@fedoraproject.org> - 20220210-7.git64113751 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild + +* Sat Jan 20 2024 Fedora Release Engineering <releng@fedoraproject.org> - 20220210-6.git64113751 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild + +* Tue Dec 19 2023 Yaakov Selkowitz <yselkowi@redhat.com> - 20220210-5.git64113751 +- Fix build with binutils 2.41 + +* Thu Jul 20 2023 Fedora Release Engineering <releng@fedoraproject.org> - 20220210-4.git64113751 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild + +* Thu Jan 19 2023 Fedora Release Engineering <releng@fedoraproject.org> - 20220210-3.git64113751 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild + +* Thu Jul 21 2022 Fedora Release Engineering <releng@fedoraproject.org> - 20220210-2.git64113751 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild + +* Sun Apr 10 2022 Cole Robinson <crobinso@redhat.com> - 20220210-1.git64113751 +- Update to newer git snapshot + +* Tue Mar 01 2022 Yaakov Selkowitz <yselkowi@redhat.com> - 20200823-9.git4bd064de +- Add aarch64 EFI artifacts (bz 2058680) + +* Thu Jan 20 2022 Fedora Release Engineering <releng@fedoraproject.org> - 20200823-8.git4bd064de +- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild |