1
0
mirror of https://github.com/moparisthebest/arch-ppa synced 2024-12-21 22:18:48 -05:00

Add ipxe-netboot

This commit is contained in:
Travis Burtrum 2019-11-20 16:35:27 -05:00
parent 4d6e03da28
commit d25a9c244d
6 changed files with 185 additions and 0 deletions

66
src/ipxe-netboot/PKGBUILD Normal file
View File

@ -0,0 +1,66 @@
# Maintainer: Lily Wilson <hotaru@thinkindifferent.net>
# Contributor: Thomas Bächler <thomas@archlinux.org>
pkgname=ipxe-netboot
pkgver=r5925.3fe683eb
pkgrel=1
pkgdesc="iPXE build for Arch Linux netboot"
arch=('i686' 'x86_64')
url="http://ipxe.org"
license=('GPL')
makedepends=('git'
'gcc'
'binutils'
'make'
'perl'
'xz'
'zlib')
options=(!strip)
source=('ipxe::git+https://git.ipxe.org/ipxe.git#branch=master'
arch.ipxe
codesigning_thomas_archlinux.pem
codesigning_pierre_archlinux.pem
dst_x1.pem
test-netboot)
sha256sums=('SKIP'
'f789c81cade88537b4dc0acd1ce1beb26d1c1e63b837423a14a7c096b31b0230'
'3ba0cf390975bb07bf1d3c7ff802d6977bdf901c94883ea2de44c16d444252e5'
'64d021f345a0b4633de17ba43d816295076adc8a378eaa54e6796e8c0e95d6d0'
'139a5e4a4e0fa505378c72c5f700934ce8333f4e6b1b508886c4b0eb14f4be99'
'63cdadea20fd5ba0f1a632d1ebd34e7b3d91f08b88a3b43508cc825bb42e55a4')
pkgver() {
cd "$srcdir/ipxe"
printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}
prepare() {
cd "$srcdir/ipxe/src"
mkdir -p config/local
: > config/local/general.h
echo '#define NET_PROTO_IPV6' >> config/local/general.h
echo '#define DOWNLOAD_PROTO_HTTPS' >> config/local/general.h
echo '#define IMAGE_TRUST_CMD' >> config/local/general.h
}
build() {
cd "$srcdir/ipxe/src"
NO_WERROR=1
export NO_WERROR
make \
CERT="$srcdir/codesigning_pierre_archlinux.pem","$srcdir/codesigning_thomas_archlinux.pem","$srcdir/dst_x1.pem" \
TRUST="$srcdir/codesigning_pierre_archlinux.pem","$srcdir/codesigning_thomas_archlinux.pem","$srcdir/dst_x1.pem" \
bin/ipxe.lkrn \
bin/ipxe.pxe \
bin-x86_64-efi/ipxe.efi
}
package() {
cd "$srcdir/ipxe/src"
install -d -m755 "$pkgdir"/usr/share/ipxe-netboot
install -m644 bin/ipxe.lkrn "$pkgdir"/usr/share/ipxe-netboot/
install -m644 bin/ipxe.pxe "$pkgdir"/usr/share/ipxe-netboot/
install -m644 bin-x86_64-efi/ipxe.efi "$pkgdir"/usr/share/ipxe-netboot/
install -D -m755 "$srcdir"/test-netboot "$pkgdir"/usr/bin/test-netboot
}

View File

@ -0,0 +1,3 @@
#!ipxe
ifconf
chain https://www.archlinux.org/releng/netboot/archlinux.ipxe || shell

View File

@ -0,0 +1,30 @@
-----BEGIN CERTIFICATE-----
MIIFOzCCAyOgAwIBAgIJAM/ujMJZQq3IMA0GCSqGSIb3DQEBCwUAMEoxCzAJBgNV
BAYTAkRFMRcwFQYDVQQDDA5QaWVycmUgU2NobWl0ejEiMCAGCSqGSIb3DQEJARYT
cGllcnJlQGFyY2hsaW51eC5kZTAeFw0xNjA2MDExNjQxNTZaFw0yNjA1MzAxNjQx
NTZaMEoxCzAJBgNVBAYTAkRFMRcwFQYDVQQDDA5QaWVycmUgU2NobWl0ejEiMCAG
CSqGSIb3DQEJARYTcGllcnJlQGFyY2hsaW51eC5kZTCCAiIwDQYJKoZIhvcNAQEB
BQADggIPADCCAgoCggIBAMybf9uwe6O+FPUYR4ycBDcBJp0QOsUDSSw9c5EJsTJJ
/0HDk+cFW9OdhxnRsxOPCYyrqE/FEusMyAyyyrZ1DVqprTegcqwqgZSmLNwBp+gP
Dt10JuNQM7IFIs0p3CE6JyuLWJWjn+ZJuVa1Qwfg80wOv/CLkQEWP5ols3o4VroF
CzJAKd4nVRf8JSyk+4Hka1udtqw4zEyDtaomZ661ZxBH3+PAoE2N+VcMPC3yTOBS
4RuabUU4PotfF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gzMB4XDTAwMDkzMDIxMTIxOVoXDTIxMDkzMDE0MDExNVow
PzEkMCIGA1UEChMbRGlnaXRhbCBTaWduYXR1cmUgVHJ1c3QgQ28uMRcwFQYDVQQD
Ew5EU1QgUm9vdCBDQSBYMzCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEB
AN+v6ZdQCINXtMxiZfaQguzH0yxrMMpb7NnDfcdAwRgUi+DoM3ZJKuM/IUmTrE4O
rz5Iy2Xu/NMhD2XSKtkyj4zl93ewEnu1lcCJo6m67XMuegwGMoOifooUMM0RoOEq
OLl5CjH9UL2AZd+3UWODyOKIYepLYYHsUmu5ouJLGiifSKOeDNoJjj4XLh7dIN9b
xiqKqy69cK3FCxolkHRyxXtqqzTWMIn/5WgTe1QLyNau7Fqckh49ZLOMxt+/yUFw
7BZy1SbsOFU5Q9D8/RhcQPGX69Wam40dutolucbY38EVAjqr2m7xPi71XAicPNaD
aeQQmxkqtilX4+U9m5/wAl0CAwEAAaNCMEAwDwYDVR0TAQH/BAUwAwEB/zAOBgNV
HQ8BAf8EBAMCAQYwHQYDVR0OBBYEFMSnsaR7LHH62+FLkHX/xBVghYkQMA0GCSqG
SIb3DQEBBQUAA4IBAQCjGiybFwBcqR7uKGY3Or+Dxz9LwwmglSBd49lZRNI+DT69
ikugdB/OEIKcdBodfpga3csTS7MgROSR6cz8faXbauX+5v3gTt23ADq1cEmv8uXr
AvHRAosZy5Q6XkjEGB5YGV8eAlrwDPGxrancWYaLbumR9YbK+rlmM6pZW87ipxZz
R8srzJmwN0jP41ZL9c8PDHIyh8bwRLtTcm1D9SZImlJnt1ir/md2cXjbDaJWFBM5
JDGFoqgCWjBH4d1QB7wCCZAA62RjYJsWvIjJEubSfZGL+T0yjWW06XyxV3bqxbYo
Ob8VZRzI9neWagqNdwvYkQsEjgfbKbYK7p2CNTUQ
-----END CERTIFICATE-----

36
src/ipxe-netboot/test-netboot Executable file
View File

@ -0,0 +1,36 @@
#!/bin/bash
set -euo pipefail
OVMFDIR=/usr/share/ovmf
OVMF_CODE=${OVMFDIR}/x64/OVMF_CODE.fd
OVMF_VARS=${OVMFDIR}/x64/OVMF_VARS.fd
IPXE_IMAGE=/usr/share/ipxe-netboot/ipxe.efi
if [[ ! -f ${OVMF_CODE} ]]; then
echo "ERROR: ${OVMF_CODE} is missing, install the ovmf package." >&2
exit 1
fi
if [[ ! -f ${OVMF_VARS} ]]; then
echo "ERROR: ${OVMF_VARS} is missing, install the ovmf package." >&2
exit 1
fi
if [[ ! -f ${IPXE_IMAGE} ]]; then
echo "ERROR: ${IPXE_IMAGE} is missing." >&2
exit 1
fi
WORKDIR=$(mktemp -d --tmpdir netboot.XXXXXX)
cd "${WORKDIR}"
cp "${OVMF_VARS}" efivars
mkdir -p ./fat/EFI/Boot/
cp "${IPXE_IMAGE}" ./fat/EFI/Boot/bootx64.efi
exec qemu-system-x86_64 \
-enable-kvm \
-device virtio-net-pci,netdev=n -netdev user,ipv4,id=n \
-m 2G \
-drive if=pflash,format=raw,readonly,file="${OVMF_CODE}" \
-drive if=pflash,format=raw,file=efivars \
-usb -usbdevice disk:format=raw:fat:./fat \
"$@"