1 # Copyright 1999-2019 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
6 inherit toolchain-funcs eutils savedconfig
8 GIT_REV="a4f8c6e31f6c62522cfc633bbbffa81b22f9d6f3"
9 GIT_SHORT=${GIT_REV:0:7}
11 DESCRIPTION="Open source network boot (PXE) firmware"
12 HOMEPAGE="http://ipxe.org/"
14 !binary? ( https://git.ipxe.org/ipxe.git/snapshot/${GIT_REV}.tar.bz2 -> ${P}-${GIT_SHORT}.tar.bz2 )
15 binary? ( https://dev.gentoo.org/~tamiko/distfiles/${P}-${GIT_SHORT}-bin.tar.xz )"
19 KEYWORDS="~alpha amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 x86"
20 IUSE="+binary efi ipv6 iso lkrn +qemu undi usb vmware"
22 REQUIRED_USE="!amd64? ( !x86? ( binary ) )"
24 SOURCE_DEPEND="app-arch/xz-utils
33 amd64? ( ${SOURCE_DEPEND} )
34 x86? ( ${SOURCE_DEPEND} )
38 S="${WORKDIR}/ipxe-${GIT_SHORT}/src"
43 cat <<-EOF > "${S}"/config/local/general.h
45 #define BANNER_TIMEOUT 0
48 use ipv6 && echo "#define NET_PROTO_IPV6" >> "${S}"/config/local/general.h
51 cat <<-EOF >> "${S}"/config/local/general.h
52 #define VMWARE_SETTINGS
53 #define CONSOLE_VMWARE
57 restore_config config/local/general.h
63 # Q='' makes the build verbose since that's what everyone loves now
70 OBJCOPY="$(tc-getOBJCOPY)" \
71 RANLIB="$(tc-getRANLIB)" \
72 OBJDUMP="$(tc-getOBJDUMP)" \
73 HOST_CC="$(tc-getBUILD_CC)" \
82 ipxemake bin/808610de.rom # pxe-e1000.rom (old)
83 ipxemake bin/8086100e.rom # pxe-e1000.rom
84 ipxemake bin/80861209.rom # pxe-eepro100.rom
85 ipxemake bin/10500940.rom # pxe-ne2k_pci.rom
86 ipxemake bin/10222000.rom # pxe-pcnet.rom
87 ipxemake bin/10ec8139.rom # pxe-rtl8139.rom
88 ipxemake bin/1af41000.rom # pxe-virtio.rom
92 ipxemake bin/8086100f.mrom # e1000
93 ipxemake bin/808610d3.mrom # e1000e
94 ipxemake bin/10222000.mrom # vlance
95 ipxemake bin/15ad07b0.rom # vmxnet3
98 use efi && ipxemake PLATFORM=efi BIN=bin-efi bin-efi/ipxe.efi
99 use iso && ipxemake bin/ipxe.iso
100 use undi && ipxemake bin/undionly.kpxe
101 use usb && ipxemake bin/ipxe.usb
102 use lkrn && ipxemake bin/ipxe.lkrn
106 insinto /usr/share/ipxe/
108 if use qemu || use vmware; then
111 use vmware && doins bin/*.mrom
112 use efi && doins bin-efi/*.efi
113 use iso && doins bin/*.iso
114 use undi && doins bin/*.kpxe
115 use usb && doins bin/*.usb
116 use lkrn && doins bin/*.lkrn
118 save_config config/local/general.h