commit: 992921ba1f815d18cf2e968a5558b51cbfe8d07f parent bda85bd518370d2e6559242e96cc766d7fc23417 Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me> Date: Wed, 16 Aug 2023 01:39:54 +0200 sys-firmware/ipxe: new package, add 1.21.1_p20230601-r1Diffstat:
A | sys-firmware/ipxe/Manifest | 1 | + |
A | sys-firmware/ipxe/ipxe-1.21.1_p20230601-r1.ebuild | 135 | +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
A | sys-firmware/ipxe/metadata.xml | 19 | +++++++++++++++++++ |
3 files changed, 155 insertions(+), 0 deletions(-)diff --git a/sys-firmware/ipxe/Manifest b/sys-firmware/ipxe/Manifest
@@ -0,0 +1 @@ +DIST ipxe-1.21.1_p20230601.gh.tar.gz 4137586 BLAKE2B 51d8e0f5c95e77707d934a0d8c16104c0d7c500ca33f408c2d94b77244d4b198e7a4b40ee091eb059a55bc0f780572bee8d3556de28f9fdae498206c24139276 SHA512 3fbb803bd679adbeb805c7d3a8ac952e14ff41fdbb7b0c30d8ccb196e39da346faf4c3e2588466bc82400b9f113f08aa8a8056d4ed2393d1aa0fee0d22b67111diff --git a/sys-firmware/ipxe/ipxe-1.21.1_p20230601-r1.ebuild b/sys-firmware/ipxe/ipxe-1.21.1_p20230601-r1.ebuild
@@ -0,0 +1,135 @@ +# Copyright 1999-2023 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit savedconfig toolchain-funcs + +# for 1.21.1_p20230601 +COMMIT_SHA1="4fa4052c7ebb59e4d4aa396f1563c89118623ec7" + +DESCRIPTION="Open source network boot (PXE) firmware" +HOMEPAGE="https://ipxe.org/" +SRC_URI="https://github.com/${PN}/${PN}/archive/${COMMIT_SHA1}.tar.gz -> ${P}.gh.tar.gz" +S="${WORKDIR}/${PN}-${COMMIT_SHA1}/src" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~amd64 ~x86" +IUSE="efi efi64 ipv6 iso lkrn +qemu undi usb vmware" + +BDEPEND=" + app-arch/xz-utils + dev-lang/perl + qemu? ( efi64? ( sys-firmware/edk2-tools ) ) + iso? ( + app-cdr/cdrtools + sys-boot/syslinux + ) +" + +src_configure() { + cat > config/local/general.h <<-EOF || die + #undef BANNER_TIMEOUT + #define BANNER_TIMEOUT 0 + EOF + + if use ipv6; then + cat >> config/local/general.h <<-EOF || die + #define NET_PROTO_IPV6 + EOF + fi + + if use vmware; then + cat >> config/local/general.h <<-EOF || die + #define VMWARE_SETTINGS + #define CONSOLE_VMWARE + EOF + fi + + restore_config config/local/general.h + + tc-ld-disable-gold +} + +ipxemake() { + # Q='' makes the build verbose since that's what everyone loves now + emake Q='' \ + CC="$(tc-getCC)" \ + LD="$(tc-getLD)" \ + AS="$(tc-getAS)" \ + AR="$(tc-getAR)" \ + NM="$(tc-getNM)" \ + OBJCOPY="$(tc-getOBJCOPY)" \ + RANLIB="$(tc-getRANLIB)" \ + OBJDUMP="$(tc-getOBJDUMP)" \ + HOST_CC="$(tc-getBUILD_CC)" \ + "$@" +} + +src_compile() { + # (name, VID, DID) taken from qemu roms/Makefile + local qemuroms=( + 'e1000 8086 100e' + 'e1000e 8086 10d3' + 'eepro100 8086 1209' + 'ne2k_pci 1050 0940' + 'pcnet 1022 2000' + 'rtl8139 10ec 8139' + 'virtio 1af4 1000' + 'vmxnet3 15ad 07b0' + ) + + export NO_WERROR=1 + if use qemu; then + for rom in "${qemuroms[@]}"; do + IFS=' ' read name vid did <<< "${rom}" + ipxemake CONFIG=qemu bin/"${vid}${did}".rom + + if use efi64; then + ipxemake CONFIG=qemu bin-x86_64-efi/"${vid}${did}".efidrv + + EfiRom -f "0x${vid}" -i "0x${did}" -l 0x02 \ + -b "bin/${vid}${did}.rom" \ + -ec "bin-x86_64-efi/${vid}${did}.efidrv" \ + -o "bin/efi-${name}.rom" || die + fi + done + fi + + if use vmware; then + ipxemake bin/8086100f.mrom # e1000 + ipxemake bin/808610d3.mrom # e1000e + ipxemake bin/10222000.mrom # vlance + ipxemake bin/15ad07b0.rom # vmxnet3 + fi + + use efi && ipxemake PLATFORM=efi BIN=bin-i386-efi bin-i386-efi/ipxe.efi + use efi64 && ipxemake PLATFORM=efi BIN=bin-x86_64-efi bin-x86_64-efi/ipxe.efi + use iso && ipxemake bin/ipxe.iso + use undi && ipxemake bin/undionly.kpxe + use usb && ipxemake bin/ipxe.usb + use lkrn && ipxemake bin/ipxe.lkrn +} + +src_install() { + insinto /usr/share/ipxe/ + + if use qemu || use vmware; then + doins bin/*.rom + fi + use vmware && doins bin/*.mrom + use efi && newins bin-i386-efi/ipxe.efi ipxe-i386.efi + use efi64 && newins bin-x86_64-efi/ipxe.efi ipxe-x86_64.efi + # Add a symlink for backwards compatiblity, in case both variants are + # enabled the x86_64 bit variant takes presedence. + use efi && dosym ipxe-i386.efi /usr/share/ipxe/ipxe.efi + use efi64 && dosym ipxe-x86_64.efi /usr/share/ipxe/ipxe.efi + + use iso && doins bin/*.iso + use undi && doins bin/*.kpxe + use usb && doins bin/*.usb + use lkrn && doins bin/*.lkrn + + save_config config/local/general.h +}diff --git a/sys-firmware/ipxe/metadata.xml b/sys-firmware/ipxe/metadata.xml
@@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> + <use> + <flag name="binary">Use pre-built binaries</flag> + <flag name="efi">Build a 32bit EFI program for using PXE</flag> + <flag name="efi64">Build a 64bit EFI program for using PXE</flag> + <flag name="iso">Build a bootable ISO for using PXE</flag> + <flag name="lkrn">Build a linux kernel bootable file for using with grub/etc...</flag> + <flag name="usb">Build a bootable USB image for using PXE</flag> + <flag name="undi">Build a Universal Network Device Interface driver + chainloading your existing PXE NIC into iPXE</flag> + <flag name="qemu">Build the required PXE ROM images for <pkg>app-emulation/qemu</pkg></flag> + <flag name="vmware">Build the PXE ROM images that VMWare uses</flag> + </use> + <upstream> + <remote-id type="github">ipxe/ipxe</remote-id> + </upstream> +</pkgmetadata>