Blame SPECS/ipxe.spec

07334b
%if 0%{?fedora}
07334b
%global cross 1
07334b
%endif
07334b
07334b
# Resulting binary formats we want from iPXE
07334b
%global formats rom
07334b
07334b
# PCI IDs (vendor,product) of the ROMS we want for QEMU
07334b
#
07334b
#    pcnet32: 0x1022 0x2000
07334b
#   ne2k_pci: 0x10ec 0x8029
07334b
#      e1000: 0x8086 0x100e
07334b
#    rtl8139: 0x10ec 0x8139
07334b
# virtio-net: 0x1af4 0x1000
07334b
#   eepro100: 0x8086 0x1209
07334b
#     e1000e: 0x8086 0x10d3
07334b
#    vmxnet3: 0x15ad 0x07b0
07334b
%global qemuroms 10222000 10ec8029 8086100e 10ec8139 1af41000 80861209 808610d3 15ad07b0
07334b
07334b
# We only build the ROMs if on an x86 build host. The resulting
07334b
# binary RPM will be noarch, so other archs will still be able
07334b
# to use the binary ROMs.
07334b
#
07334b
# We do cross-compilation for 32->64-bit, but not for other arches
07334b
# because EDK II does not support big-endian hosts.
07334b
%if 0%{?cross}
07334b
%global buildarches %{ix86} x86_64
07334b
%else
07334b
%global buildarches x86_64
07334b
%endif
07334b
07334b
# debugging firmwares does not go the same way as a normal program.
07334b
# moreover, all architectures providing debuginfo for a single noarch
07334b
# package is currently clashing in koji, so don't bother.
07334b
%global debug_package %{nil}
07334b
07334b
# Upstream don't do "releases" :-( So we're going to use the date
07334b
# as the version, and a GIT hash as the release. Generate new GIT
07334b
# snapshots using the folowing commands:
07334b
#
07334b
# $ hash=`git log -1 --format='%h'`
07334b
# $ date=`git log -1 --format='%cd' --date=short | tr -d -`
07334b
# $ git archive --prefix ipxe-${date}-git${hash}/ ${hash} | xz -7e > ipxe-${date}-git${hash}.tar.xz
07334b
#
07334b
# And then change these two:
07334b
07334b
%global hash 133f4c47
07334b
%global date 20181214
07334b
07334b
Name:    ipxe
07334b
Version: %{date}
3556c9
Release: 8.git%{hash}%{?dist}
07334b
Summary: A network boot loader
07334b
07334b
Group:   System Environment/Base
07334b
License: GPLv2 with additional permissions and BSD
07334b
URL:     http://ipxe.org/
07334b
07334b
Source0: %{name}-%{version}-git%{hash}.tar.xz
07334b
Source1: script.ipxe
07334b
07334b
# Enable IPv6 for qemu's config
07334b
# Sent upstream: http://lists.ipxe.org/pipermail/ipxe-devel/2015-November/004494.html
07334b
Patch0001: 0001-build-customize-configuration.patch
07334b
Patch0002: 0002-Use-spec-compliant-timeouts.patch
07334b
Patch0003: 0003-Strip-802.1Q-VLAN-0-priority-tags.patch
07334b
Patch0004: ipxe-vlan-cmds.patch
b25a0c
Patch0005: 0001-efi-perform-cable-detection-at-NII-initialization-on-HPE-557SFP.patch
23ca6b
Patch0006: ipxe-ping-cmd.patch
07334b
07334b
%ifarch %{buildarches}
07334b
BuildRequires: perl-interpreter
07334b
BuildRequires: perl-Getopt-Long
07334b
BuildRequires: syslinux
07334b
BuildRequires: mtools
07334b
BuildRequires: mkisofs
07334b
BuildRequires: edk2-tools
07334b
BuildRequires: xz-devel
07334b
07334b
BuildRequires: binutils-devel
07334b
%if 0%{?cross}
07334b
BuildRequires: binutils-x86_64-linux-gnu gcc-x86_64-linux-gnu
07334b
%endif
07334b
07334b
Obsoletes: gpxe <= 1.0.1
07334b
07334b
%package rhcert
07334b
Summary: Redhat hwcert custom ipxe image
07334b
Group: Development/Tools
07334b
BuildArch: noarch
07334b
07334b
%package bootimgs
07334b
Summary: Network boot loader images in bootable USB, CD, floppy and GRUB formats
07334b
Group:   Development/Tools
07334b
BuildArch: noarch
07334b
Obsoletes: gpxe-bootimgs <= 1.0.1
07334b
07334b
%package roms
07334b
Summary: Network boot loader roms in .rom format
07334b
Group:  Development/Tools
07334b
Requires: %{name}-roms-qemu = %{version}-%{release}
07334b
BuildArch: noarch
07334b
Obsoletes: gpxe-roms <= 1.0.1
07334b
07334b
%package roms-qemu
07334b
Summary: Network boot loader roms supported by QEMU, .rom format
07334b
Group:  Development/Tools
07334b
BuildArch: noarch
07334b
Obsoletes: gpxe-roms-qemu <= 1.0.1
07334b
07334b
%description rhcert
07334b
Custom ipxe image for use in hardware certification and validation
07334b
07334b
%description bootimgs
07334b
iPXE is an open source network bootloader. It provides a direct
07334b
replacement for proprietary PXE ROMs, with many extra features such as
07334b
DNS, HTTP, iSCSI, etc.
07334b
07334b
This package contains the iPXE boot images in USB, CD, floppy, and PXE
07334b
UNDI formats.
07334b
07334b
%description roms
07334b
iPXE is an open source network bootloader. It provides a direct
07334b
replacement for proprietary PXE ROMs, with many extra features such as
07334b
DNS, HTTP, iSCSI, etc.
07334b
07334b
This package contains the iPXE roms in .rom format.
07334b
07334b
07334b
%description roms-qemu
07334b
iPXE is an open source network bootloader. It provides a direct
07334b
replacement for proprietary PXE ROMs, with many extra features such as
07334b
DNS, HTTP, iSCSI, etc.
07334b
07334b
This package contains the iPXE ROMs for devices emulated by QEMU, in
07334b
.rom format.
07334b
%endif
07334b
07334b
%description
07334b
iPXE is an open source network bootloader. It provides a direct
07334b
replacement for proprietary PXE ROMs, with many extra features such as
07334b
DNS, HTTP, iSCSI, etc.
07334b
07334b
%prep
07334b
%setup -q -n %{name}-%{version}-git%{hash}
07334b
%autopatch -p1
07334b
07334b
07334b
%build
07334b
%ifarch %{buildarches}
07334b
cd src
07334b
07334b
# ath9k drivers are too big for an Option ROM, and ipxe devs say it doesn't
07334b
# make sense anyways
07334b
# http://lists.ipxe.org/pipermail/ipxe-devel/2012-March/001290.html
07334b
rm -rf drivers/net/ath/ath9k
07334b
07334b
make_ipxe() {
07334b
    make %{?_smp_mflags} \
07334b
        NO_WERROR=1 V=1 \
07334b
        GITVERSION=%{hash} \
07334b
%if 0%{?cross}
07334b
        CROSS_COMPILE=x86_64-linux-gnu- \
07334b
%endif
07334b
        "$@"
07334b
}
07334b
07334b
cp %{SOURCE1} .
07334b
make_ipxe bin-x86_64-efi/ipxe.efi EMBED=script.ipxe
07334b
mv bin-x86_64-efi/ipxe.efi bin-x86_64-efi/ipxe-rhcert.efi
07334b
07334b
make_ipxe bin-i386-efi/ipxe.efi bin-x86_64-efi/ipxe.efi \
07334b
    bin-x86_64-efi/snponly.efi
07334b
07334b
make_ipxe ISOLINUX_BIN=/usr/share/syslinux/isolinux.bin \
07334b
    bin/undionly.kpxe bin/ipxe.{dsk,iso,usb,lkrn} \
07334b
    allroms
07334b
07334b
# build roms with efi support for qemu
07334b
mkdir bin-combined
07334b
for rom in %{qemuroms}; do
07334b
  make_ipxe CONFIG=qemu bin/${rom}.rom
07334b
  make_ipxe CONFIG=qemu bin-x86_64-efi/${rom}.efidrv
07334b
  vid="0x${rom%%????}"
07334b
  did="0x${rom#????}"
07334b
  EfiRom -f "$vid" -i "$did" --pci23 \
07334b
         -ec bin-x86_64-efi/${rom}.efidrv \
3556c9
         -o  bin-combined/${rom}.eficrom
3556c9
  util/catrom.pl \
3556c9
      bin/${rom}.rom \
3556c9
      bin-combined/${rom}.eficrom \
3556c9
      > bin-combined/${rom}.rom
07334b
  EfiRom -d  bin-combined/${rom}.rom
07334b
  # truncate to at least 256KiB
07334b
  truncate -s \>256K bin-combined/${rom}.rom
07334b
  # verify rom fits in 256KiB
07334b
  test $(stat -c '%s' bin-combined/${rom}.rom) -le $((256 * 1024))
07334b
done
07334b
07334b
%endif
07334b
07334b
%install
07334b
%ifarch %{buildarches}
07334b
mkdir -p %{buildroot}/%{_datadir}/%{name}/
07334b
mkdir -p %{buildroot}/%{_datadir}/%{name}.efi/
07334b
pushd src/bin/
07334b
07334b
cp -a undionly.kpxe ipxe.{iso,usb,dsk,lkrn} %{buildroot}/%{_datadir}/%{name}/
07334b
07334b
for fmt in %{formats};do
07334b
 for img in *.${fmt};do
07334b
      if [ -e $img ]; then
07334b
   cp -a $img %{buildroot}/%{_datadir}/%{name}/
07334b
   echo %{_datadir}/%{name}/$img >> ../../${fmt}.list
07334b
  fi
07334b
 done
07334b
done
07334b
popd
07334b
07334b
cp -a src/bin-i386-efi/ipxe.efi %{buildroot}/%{_datadir}/%{name}/ipxe-i386.efi
07334b
cp -a src/bin-x86_64-efi/ipxe.efi %{buildroot}/%{_datadir}/%{name}/ipxe-x86_64.efi
07334b
cp -a src/bin-x86_64-efi/ipxe-rhcert.efi %{buildroot}/%{_datadir}/%{name}/ipxe-x86_64-rhcert.efi
07334b
cp -a src/bin-x86_64-efi/snponly.efi %{buildroot}/%{_datadir}/%{name}/ipxe-snponly-x86_64.efi
07334b
07334b
# the roms supported by qemu will be packaged separatedly
07334b
# remove from the main rom list and add them to qemu.list
07334b
for fmt in rom ;do
07334b
 for rom in %{qemuroms} ; do
07334b
  sed -i -e "/\/${rom}.${fmt}/d" ${fmt}.list
07334b
  echo %{_datadir}/%{name}/${rom}.${fmt} >> qemu.${fmt}.list
07334b
 done
07334b
done
07334b
for rom in %{qemuroms}; do
07334b
  cp src/bin-combined/${rom}.rom %{buildroot}/%{_datadir}/%{name}.efi/
07334b
  echo %{_datadir}/%{name}.efi/${rom}.rom >> qemu.rom.list
07334b
done
07334b
%endif
07334b
07334b
%ifarch %{buildarches}
07334b
%files bootimgs
07334b
%dir %{_datadir}/%{name}
07334b
%{_datadir}/%{name}/ipxe.iso
07334b
%{_datadir}/%{name}/ipxe.usb
07334b
%{_datadir}/%{name}/ipxe.dsk
07334b
%{_datadir}/%{name}/ipxe.lkrn
07334b
%{_datadir}/%{name}/ipxe-i386.efi
07334b
%{_datadir}/%{name}/ipxe-x86_64.efi
07334b
%{_datadir}/%{name}/undionly.kpxe
07334b
%{_datadir}/%{name}/ipxe-snponly-x86_64.efi
07334b
%doc COPYING COPYING.GPLv2 COPYING.UBDL
07334b
07334b
%files roms -f rom.list
07334b
%dir %{_datadir}/%{name}
07334b
%doc COPYING COPYING.GPLv2 COPYING.UBDL
07334b
07334b
%files roms-qemu -f qemu.rom.list
07334b
%dir %{_datadir}/%{name}
07334b
%dir %{_datadir}/%{name}.efi
07334b
%doc COPYING COPYING.GPLv2 COPYING.UBDL
07334b
07334b
%files rhcert
07334b
%dir %{_datadir}/%{name}
07334b
%{_datadir}/%{name}/ipxe-x86_64-rhcert.efi
07334b
%endif
07334b
07334b
%changelog
3556c9
* Fri Feb 19 2021 Jarod Wilson <jarod@redhat.com> - 20181210-8.git133f4c47
3556c9
- combine BIOS and EFI roms using utils/catrom.pl [lersek] (bz 1926561)
3556c9
23ca6b
* Tue Jan 26 2021 Jarod Wilson <jarod@redhat.com> - 20181210-7.git133f4c47
23ca6b
- Build ping command (bz 1913719)
23ca6b
b25a0c
* Mon Jul 27 2020 Neil Horman <nhorman@redhat.com> - 20181210-6.git133f4c47
b25a0c
- Add quirk for link detect on HP 557SFP cards (bz 1740827)
b25a0c
07334b
* Tue Jan 7 2020 Neil Horman <nhorman@redhat.com> - 20181210-5.git133f4c47
07334b
- Add rhcert subpackage (bz 1756012)
07334b
07334b
* Fri Dec 13 2019 Neil Horman <nhorman@redhat.com> - 20181210-4.git133f4c47
07334b
- Add snponly.efi image (bz 1776929)
07334b
07334b
* Tue Aug 13 2019 Danilo de Paula <ddepaula@redhat.com> - 20181210-3.git133f4c47
07334b
- Release bump
07334b
07334b
* Thu Jul 25 2019 Danilo de Paula <ddepaula@redhat.com> - 20181210-2.git133f4c47
07334b
- Resolves rhbz#1723702
07334b
  (virtio rom near 256k boundary)
07334b
07334b
* Fri Dec 14 2018 Neil Horman <nhorman@redhat.com> - 20181210-1.git133f4c47
07334b
- Update to latest upstream
07334b
- Add vlan cmds
07334b
07334b
* Fri Nov 16 2018 Danilo C. L. de Paula <ddepaula@redhat.com> - 20170710-6.git0600d3ae
07334b
- rebuilt
07334b
07334b
* Thu Jul 12 2018 Danilo - 20170710-5.git0600d3ae
07334b
- Bumping release number and rebuilding ipxe for RHEL-8.0
07334b
07334b
* Wed Feb 07 2018 Fedora Release Engineering <releng@fedoraproject.org> - 20170710-3.git0600d3ae
07334b
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
07334b
07334b
* Tue Nov 21 2017 Paolo Bonzini <pbonzini@redhat.com> - ipxe-20170710-2.git0600d3ae
07334b
- Include bugfix and configuration patches from RHEL
07334b
- Disable cross compilation on RHEL
07334b
07334b
* Thu Aug 03 2017 Cole Robinson <crobinso@redhat.com> - ipxe-20170710-1.git0600d3ae
07334b
- Update to ipxe 0600d3ae for qemu-2.10.0
07334b
07334b
* Wed Aug 02 2017 Fedora Release Engineering <releng@fedoraproject.org> - 20161108-4.gitb991c67
07334b
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
07334b
07334b
* Wed Jul 26 2017 Fedora Release Engineering <releng@fedoraproject.org> - 20161108-3.gitb991c67
07334b
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
07334b
07334b
* Fri Feb 10 2017 Fedora Release Engineering <releng@fedoraproject.org> - 20161108-2.gitb991c67
07334b
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
07334b
07334b
* Sun Dec 04 2016 Cole Robinson <crobinso@redhat.com> - 20161108-1.gitb991c67
07334b
- Rebase to version shipped with qemu 2.8
07334b
07334b
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 20150821-3.git4e03af8
07334b
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
07334b
07334b
* Tue Jan 26 2016 Cole Robinson <crobinso@redhat.com> 20150821-2.git4e03af8
07334b
- Build ipxe.efi (bug 1300865)
07334b
- Build eepro100 rom for qemu
07334b
07334b
* Tue Nov 17 2015 Cole Robinson <crobinso@redhat.com> - 20150821-1.git4e03af8
07334b
- Update to commit 4e03af8 for qemu 2.5
07334b
- Enable IPv6 (bug 1280318)
07334b
07334b
* Wed Jun 17 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 20150407-3.gitdc795b9f
07334b
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
07334b
07334b
* Thu Apr 16 2015 Paolo Bonzini <pbonzini@redhat.com> - 20150407-2.gitdc795b9f
07334b
- Fix virtio bug with UEFI driver
07334b
07334b
* Thu Apr 16 2015 Paolo Bonzini <pbonzini@redhat.com> - 20150407-1.gitdc795b9f
07334b
- Update to latest upstream snapshot
07334b
- Switch source to .tar.xz
07334b
- Include patches from QEMU submodule
07334b
- Use config file for configuration
07334b
- Distribute additional permissions on top of GPLv2 ("UBDL")
07334b
07334b
* Sat Aug 16 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 20140303-3.gitff1e7fc7
07334b
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild
07334b
07334b
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 20140303-2.gitff1e7fc7
07334b
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
07334b
07334b
* Mon Mar 03 2014 Cole Robinson <crobinso@redhat.com> - 20140303-1.gitff1e7fc7
07334b
- Allow access to ipxe prompt if VM is set to pxe boot (bz #842932)
07334b
- Enable PNG support (bz #1058176)
07334b
07334b
* Sat Aug 03 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 20130517-3.gitc4bce43
07334b
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
07334b
07334b
* Mon May 20 2013 Paolo Bonzini <pbonzini@redhat.com> - 20130103-3.git717279a
07334b
- Fix BuildRequires, use cross-compiler when building on 32-bit i686
07334b
- Build UEFI drivers for QEMU and include them (patch from Gerd Hoffmann.
07334b
  BZ#958875)
07334b
07334b
* Fri May 17 2013 Daniel P. Berrange <berrange@redhat.com> - 20130517-1.gitc4bce43
07334b
- Update to latest upstream snapshot
07334b
07334b
* Fri May 17 2013 Daniel P. Berrange <berrange@redhat.com> - 20130103-3.git717279a
07334b
- Fix build with GCC 4.8 (rhbz #914091)
07334b
07334b
* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 20130103-2.git717279a
07334b
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
07334b
07334b
* Thu Jan  3 2013 Daniel P. Berrange <berrange@redhat.com> - 20130103-1.git717279a
07334b
- Updated to latest GIT snapshot
07334b
07334b
* Thu Jul 19 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 20120328-2.gitaac9718
07334b
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
07334b
07334b
* Wed Mar 28 2012 Daniel P. Berrange <berrange@redhat.com> - 20120328-1.gitaac9718
07334b
- Update to newer upstream
07334b
07334b
* Fri Mar 23 2012 Daniel P. Berrange <berrange@redhat.com> - 20120319-3.git0b2c788
07334b
- Remove more defattr statements
07334b
07334b
* Tue Mar 20 2012 Daniel P. Berrange <berrange@redhat.com> - 20120319-2.git0b2c788
07334b
- Remove BuildRoot & rm -rf of it in install/clean sections
07334b
- Remove defattr in file section
07334b
- Switch to use global, instead of define for macros
07334b
- Add note about Patch1 not going upstream
07334b
- Split BRs across lines for easier readability
07334b
07334b
* Mon Feb 27 2012 Daniel P. Berrange <berrange@redhat.com> - 20120319-1.git0b2c788
07334b
- Initial package based on gPXE
07334b
07334b
* Fri Jan 13 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0.1-5
07334b
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
07334b
07334b
* Mon Feb 21 2011 Matt Domsch <mdomsch@fedoraproject.org> - 1.0.1-4
07334b
- don't use -Werror, it flags a failure that is not a failure for gPXE
07334b
07334b
* Mon Feb 21 2011 Matt Domsch <mdomsch@fedoraproject.org> - 1.0.1-3
07334b
- Fix virtio-net ethernet frame length (patch by cra), fixes BZ678789
07334b
07334b
* Tue Feb 08 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0.1-2
07334b
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
07334b
07334b
* Thu Aug  5 2010 Matt Domsch <mdomsch@fedoraproject.org> - 1.0.1-1
07334b
- New drivers: Intel e1000, e1000e, igb, EFI snpnet, JMicron jme,
07334b
  Neterion X3100, vxge, pcnet32.
07334b
- Bug fixes and improvements to drivers, wireless, DHCP, iSCSI,
07334b
  COMBOOT, and EFI.
07334b
* Tue Feb  2 2010 Matt Domsch <mdomsch@fedoraproject.org> - 1.0.0-1
07334b
- bugfix release, also adds wireless card support
07334b
- bnx2 builds again
07334b
- drop our one patch
07334b
07334b
* Tue Oct 27 2009 Matt Domsch <mdomsch@fedoraproject.org> - 0.9.9-1
07334b
- new upstream version 0.9.9
07334b
-- plus patches from git up to 20090818 which fix build errors and
07334b
   other release-critical bugs.
07334b
-- 0.9.9: added Attansic L1E and sis190/191 ethernet drivers.  Fixes
07334b
   and updates to e1000 and 3c90x drivers.
07334b
-- 0.9.8: new commands: time, sleep, md5sum, sha1sum. 802.11 wireless
07334b
   support with Realtek 8180/8185 and non-802.11n Atheros drivers.
07334b
   New Marvell Yukon-II gigabet Ethernet driver.  HTTP redirection
07334b
   support.  SYSLINUX floppy image type (.sdsk) with usable file
07334b
   system.  Rewrites, fixes, and updates to 3c90x, forcedeth, pcnet32,
07334b
   e1000, and hermon drivers.
07334b
07334b
* Mon Oct  5 2009 Matt Domsch <mdomsch@fedoraproject.org> - 0.9.7-6
07334b
- move rtl8029 from -roms to -roms-qemu for qemu ne2k_pci NIC (BZ 526776)
07334b
07334b
* Fri Jul 24 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.9.7-5
07334b
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
07334b
07334b
* Tue May 19 2009 Matt Domsch <mdomsch@fedoraproject.org> - 0.9.7-4
07334b
- add undionly.kpxe to -bootimgs
07334b
07334b
* Tue May 12 2009 Matt Domsch <mdomsch@fedoraproject.org> - 0.9.7-3
07334b
- handle isolinux changing paths
07334b
07334b
* Sat May  9 2009 Matt Domsch <mdomsch@fedoraproject.org> - 0.9.7-2
07334b
- add dist tag
07334b
07334b
* Thu Mar 26 2009 Matt Domsch <mdomsch@fedoraproject.org> - 0.9.7-1
07334b
- Initial release based on etherboot spec