Blame SPECS/ipxe.spec

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