checking in before test build and tag

This commit is contained in:
brent s. 2015-08-24 01:50:30 -04:00
parent cbde8105c1
commit bd11e3e9ec
11 changed files with 499 additions and 1 deletions

View File

@ -0,0 +1,35 @@
pkgbase = ipxe-git
pkgdesc = iPXE open source boot firmware - git checkout
pkgver = 1.0.0.r1979.g657dd5f
pkgrel = 1
url = http://www.ipxe.org/
install = ipxe.install
arch = any
license = GPL
makedepends = git
makedepends = syslinux
makedepends = libisoburn
makedepends = mtools
makedepends = xz
provides = ipxe
conflicts = ipxe
backup = etc/grub.d/20_ipxe
source = git://git.ipxe.org/ipxe.git
source = 0001-git-version.patch
source = 0002-banner.patch
source = 0003-allow-to-build-ISO-image-with-EFI-support.patch
source = 0004-fix-no-pie-workaround.patch
source = grub
source = chain-default.ipxe
source = chain-default-3928.ipxe
sha256sums = SKIP
sha256sums = a72ebfc3ab294cdf0d2a495597e84e87feba0fb48b618b504c1a8fc277b7366d
sha256sums = e60a4c6569e426a6ce7298a17c4f062d73391aa00aff5085694fee98a2618c8f
sha256sums = 337fe8b39ba5fd8f921e83f1d6611f3945cd1d8b2f8fd780fcbdc6fffdcc0276
sha256sums = bbf03ca532be2ec36cd45420acc34815a03e321ebd435950a30ba052e3e7a2cc
sha256sums = 808ff1b3ea54375d0b653b8dbe0992f7821329ef4b976a85a7ac7e5acc12a514
sha256sums = f7ec78e26671f4df90d89440d8b2a69473c15cb6b25dda32c773023378fec42a
sha256sums = e26a54b4e99816b34baebcb7a15d99d57c9395c9689ffbae2329cc675248f9b9

pkgname = ipxe-git

View File

@ -0,0 +1,32 @@
From 4c139ece028b5dd6c4e5f46ce2bf8134c390de90 Mon Sep 17 00:00:00 2001
From: Christian Hesse <mail@eworm.de>
Date: Thu, 12 Feb 2015 08:59:37 +0100
Subject: [PATCH] git version

Signed-off-by: Christian Hesse <mail@eworm.de>
---
src/Makefile | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/Makefile b/src/Makefile
index cf9cfd2..38ebb3d 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -194,10 +194,11 @@ VERSION_MINOR = 0
VERSION_PATCH = 0
EXTRAVERSION = +
MM_VERSION = $(VERSION_MAJOR).$(VERSION_MINOR)
-VERSION = $(MM_VERSION).$(VERSION_PATCH)$(EXTRAVERSION)
ifneq ($(wildcard ../.git),)
-GITVERSION := $(shell git describe --always --abbrev=1 --match "" 2>/dev/null)
-VERSION += ($(GITVERSION))
+GITVERSION := $(shell git describe --tags --long 2>/dev/null)
+VERSION = $(GITVERSION)
+else
+VERSION = $(MM_VERSION).$(VERSION_PATCH)$(EXTRAVERSION)
endif
version :
@$(ECHO) "$(VERSION)"
--
2.3.0

View File

@ -0,0 +1,41 @@
From 4ec31ece6757e19be455faa383886562b8793db9 Mon Sep 17 00:00:00 2001
From: Christian Hesse <mail@eworm.de>
Date: Thu, 12 Feb 2015 09:06:41 +0100
Subject: [PATCH] banner

Signed-off-by: Christian Hesse <mail@eworm.de>
---
src/usr/autoboot.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/src/usr/autoboot.c b/src/usr/autoboot.c
index 4bcb64d..74b5b77 100644
--- a/src/usr/autoboot.c
+++ b/src/usr/autoboot.c
@@ -67,6 +67,7 @@ static int ( * is_autoboot_device ) ( struct net_device *netdev );
#define NORMAL "\033[0m"
#define BOLD "\033[1m"
#define CYAN "\033[36m"
+#define BLUE "\033[34m"
/** The "scriptlet" setting */
const struct setting scriptlet_setting __setting ( SETTING_MISC, scriptlet ) = {
@@ -551,9 +552,13 @@ void ipxe ( struct net_device *netdev ) {
* do so.
*
*/
- printf ( NORMAL "\n\n" PRODUCT_NAME "\n" BOLD PRODUCT_SHORT_NAME " %s"
+ printf ( NORMAL "\n\n" PRODUCT_NAME "\n" BOLD PRODUCT_SHORT_NAME
NORMAL " -- " PRODUCT_TAG_LINE " -- "
- CYAN PRODUCT_URI NORMAL "\nFeatures:", product_version );
+ CYAN PRODUCT_URI NORMAL "\n"
+ BOLD "Arch" BLUE "Linux" NORMAL " -- make it simple and lightweight -- "
+ BOLD BLUE "http://archlinux.org" NORMAL "\n"
+ "Version %s compiled on " __DATE__ ", " __TIME__ "\n"
+ "Features:", product_version );
for_each_table_entry ( feature, FEATURES )
printf ( " %s", feature->name );
printf ( "\n" );
--
2.3.0

View File

@ -0,0 +1,125 @@
From d2092664b3cf866b2ab338fe056149d3266d0acc Mon Sep 17 00:00:00 2001
From: Christian Hesse <mail@eworm.de>
Date: Sun, 19 Apr 2015 13:16:09 +0200
Subject: [PATCH 1/1] allow to build ISO image with EFI support (ipxe.eiso)

Signed-off-by: Christian Hesse <mail@eworm.de>
---
src/arch/i386/Makefile.pcbios | 6 +++++
src/util/geniso | 52 +++++++++++++++++++++++++++++++++----------
2 files changed, 46 insertions(+), 12 deletions(-)

diff --git a/src/arch/i386/Makefile.pcbios b/src/arch/i386/Makefile.pcbios
index ff82373..c7a58eb 100644
--- a/src/arch/i386/Makefile.pcbios
+++ b/src/arch/i386/Makefile.pcbios
@@ -59,6 +59,12 @@ NON_AUTO_MEDIA += iso
$(QM)$(ECHO) " [GENISO] $@"
$(Q)ISOLINUX_BIN=$(ISOLINUX_BIN) VERSION="$(VERSION)" bash util/geniso -o $@ $<
+# rule to make a non-emulation ISO boot image with EFI support
+NON_AUTO_MEDIA += eiso
+%eiso: %lkrn bin-i386-efi/ipxe.efi bin-x86_64-efi/ipxe.efi util/geniso
+ $(QM)$(ECHO) " [GENISO] $@"
+ $(Q)ISOLINUX_BIN=$(ISOLINUX_BIN) VERSION="$(VERSION)" bash util/geniso -e -o $@ $<
+
# rule to make a floppy emulation ISO boot image
NON_AUTO_MEDIA += liso
%liso: %lkrn util/geniso
diff --git a/src/util/geniso b/src/util/geniso
index 521c929..9e8588c 100755
--- a/src/util/geniso
+++ b/src/util/geniso
@@ -6,16 +6,21 @@ function help() {
echo "usage: ${0} [OPTIONS] foo.lkrn [bar.lkrn,...]"
echo
echo "where OPTIONS are:"
+ echo " -e build image with EFI support"
echo " -h show this help"
echo " -l build legacy image with floppy emulation"
echo " -o FILE save iso image to file"
}
+EFI=0
LEGACY=0
FIRST=""
-while getopts "hlo:" opt; do
+while getopts "ehlo:" opt; do
case ${opt} in
+ e)
+ EFI=1
+ ;;
h)
help
exit 0
@@ -37,17 +42,25 @@ if [ -z "${OUT}" ]; then
exit 1
fi
-# There should either be mkisofs or the compatible genisoimage program
-for command in genisoimage mkisofs; do
- if ${command} --version >/dev/null 2>/dev/null; then
- mkisofs=(${command})
- break
- fi
-done
-
-if [ -z "${mkisofs}" ]; then
- echo "${0}: mkisofs or genisoimage not found, please install or set PATH" >&2
+# We need xorriso (from libisoburn) for EFI support, so try that first.
+if xorriso --version >/dev/null 2>/dev/null; then
+ mkisofs=(xorriso -as mkisofs)
+elif [ ${EFI} -eq 1 ]; then
+ echo "${0}: xorriso not found, but required for EFI support. Please install." >&2
exit 1
+else
+ # fall back to mkisofs or the compatible genisoimage program
+ for command in genisoimage mkisofs; do
+ if ${command} --version >/dev/null 2>/dev/null; then
+ mkisofs=(${command})
+ break
+ fi
+ done
+
+ if [ -z "${mkisofs}" ]; then
+ echo "${0}: mkisofs or genisoimage not found, please install or set PATH" >&2
+ exit 1
+ fi
fi
dir=$(mktemp -d bin/iso.dir.XXXXXX)
@@ -122,6 +135,21 @@ case "${LEGACY}" in
# copy isolinux bootloader
cp ${ISOLINUX_BIN} ${dir}
+ mkisofs+=(-b isolinux.bin -no-emul-boot -boot-load-size 4 -boot-info-table)
+
+ if [ "${EFI}" -eq 1 ]; then
+ # generate EFI image
+ img=${dir}/efiboot.img
+
+ mformat -f 2880 -C -i ${img} ::
+ mmd -i ${img} "::/EFI"
+ mmd -i ${img} "::/EFI/BOOT"
+ mcopy -m -i ${img} bin-x86_64-efi/ipxe.efi "::EFI/BOOT/BOOTX64.EFI"
+ mcopy -m -i ${img} bin-i386-efi/ipxe.efi "::EFI/BOOT/BOOTIA32.EFI"
+
+ mkisofs+=(-eltorito-alt-boot -e efiboot.img -isohybrid-gpt-basdat -no-emul-boot)
+ fi
+
# syslinux 6.x needs a file called ldlinux.c32
LDLINUX_C32=$(dirname ${ISOLINUX_BIN})/ldlinux.c32
if [ -s ${LDLINUX_C32} ]; then
@@ -129,7 +157,7 @@ case "${LEGACY}" in
fi
# generate the iso image
- "${mkisofs[@]}" -b isolinux.bin -no-emul-boot -boot-load-size 4 -boot-info-table -output ${OUT} ${dir}
+ "${mkisofs[@]}" -output ${OUT} ${dir}
# isohybrid will be used if available
if isohybrid --version >/dev/null 2>/dev/null; then
--
2.3.5

View File

@ -0,0 +1,34 @@
From a4f7e3ba395af4cd0a706df635309d4ef837ecf8 Mon Sep 17 00:00:00 2001
From: Christian Hesse <mail@eworm.de>
Date: Wed, 8 Apr 2015 09:51:41 +0200
Subject: [PATCH 2/2] Fix no-PIE workaround for i386 builds

This workaround did not work for my version of gcc (4.9.2 20150304) as
no option -nopie exists.

We take another way: Let's check whether or not the macro __PIE__ is defined
and add -fno-PIE if it is.

Signed-off-by: Christian Hesse <mail@eworm.de>
---
src/arch/i386/Makefile | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/arch/i386/Makefile b/src/arch/i386/Makefile
index 99f8753..897081b 100644
--- a/src/arch/i386/Makefile
+++ b/src/arch/i386/Makefile
@@ -75,8 +75,8 @@ CFLAGS += -Ui386
# output on stderr instead of checking the exit status.
#
ifeq ($(CCTYPE),gcc)
-PIE_TEST = [ -z "`$(CC) -fno-PIE -nopie -x c -c /dev/null -o /dev/null 2>&1`" ]
-PIE_FLAGS := $(shell $(PIE_TEST) && $(ECHO) '-fno-PIE -nopie')
+PIE_TEST = $(CC) -dM -E - < /dev/null | grep -q '__PIE__'
+PIE_FLAGS := $(shell $(PIE_TEST) && $(ECHO) '-fno-PIE')
WORKAROUND_CFLAGS += $(PIE_FLAGS)
endif
--
2.3.5

View File

@ -0,0 +1,146 @@
# Maintainer: Christian Hesse <mail@eworm.de>

pkgname=ipxe-git
pkgver=1.0.0.r1979.g657dd5f
pkgrel=1
pkgdesc='iPXE open source boot firmware - git checkout'
arch=('any')
url='http://www.ipxe.org/'
license=('GPL')
makedepends=('git' 'syslinux' 'libisoburn' 'mtools' 'xz')
provides=('ipxe')
conflicts=('ipxe')
install=ipxe.install
source=('git://git.ipxe.org/ipxe.git'
'0001-git-version.patch'
'0002-banner.patch'
'0003-allow-to-build-ISO-image-with-EFI-support.patch'
'0004-fix-no-pie-workaround.patch'
'grub'
'chain-default.ipxe'
'chain-default-3928.ipxe')
backup=('etc/grub.d/20_ipxe')

pkgver() {
cd ipxe/

if GITTAG="$(git describe --abbrev=0 --tags 2>/dev/null)"; then
printf '%s.r%s.g%s' \
"$(sed -e "s/^${pkgname%%-git}//" -e 's/^[-_/a-zA-Z]\+//' -e 's/[-_+]/./g' <<< ${GITTAG})" \
"$(git rev-list --count ${GITTAG}..)" \
"$(git log -1 --format='%h')"
else
printf '0.r%s.g%s' \
"$(git rev-list --count master)" \
"$(git log -1 --format='%h')"
fi
}

prepare() {
cd ipxe/src/

# git version
patch -Np2 < "${srcdir}/0001-git-version.patch"

# ArchLinux branding
patch -Np2 < "${srcdir}/0002-banner.patch"

# ISO image with EFI support
patch -Np2 < "${srcdir}/0003-allow-to-build-ISO-image-with-EFI-support.patch"

# build fix
patch -Np2 < "${srcdir}/0004-fix-no-pie-workaround.patch"

# read and set keymap
[ -s /etc/vconsole.conf ] && source /etc/vconsole.conf
if [ -n "${KEYMAP}" ]; then
sed -i "/^#define\tKEYBOARD_MAP/c #define KEYBOARD_MAP ${KEYMAP}" config/console.h
fi

# change menu colors
sed -i "/COLOR_[A-Z]*_BG/s/COLOR_BLUE/COLOR_BLACK/" config/colour.h

# enable neighbour command
sed -i "/NEIGHBOUR_CMD/c #define NEIGHBOUR_CMD" config/general.h

# enable ping command
sed -i "/PING_CMD/c #define PING_CMD" config/general.h

# enable reboot and poweroff
sed -i -e "/REBOOT_CMD/c #define REBOOT_CMD" \
-e "/POWEROFF_CMD/c #define POWEROFF_CMD" config/general.h

# disable WEP, WPA and WPA2
sed -i -e "/CRYPTO_80211_/s/^#define/#undef/" \
-e "/IWMGMT_CMD/c #undef IWMGMT_CMD" config/general.h
}

build() {
cd ipxe/src/

# default targets (ipxe.{lkrn,dsk,iso,usb})
make all

# UNDI-only - this is without drivers
make bin/undionly.kpxe

# this includes drivers, but is bigger
# build targets with embedded scripts first and rename
make bin/ipxe.pxe EMBED=${srcdir}/chain-default.ipxe
mv bin/ipxe.pxe bin/ipxe-default.pxe

make bin/ipxe.pxe EMBED=${srcdir}/chain-default-3928.ipxe
mv bin/ipxe.pxe bin/ipxe-default-3928.pxe

make bin/ipxe.pxe

# EFI
make bin-i386-efi/ipxe.efi bin-x86_64-efi/ipxe.efi

# ipxe.liso and ipxe.eiso
# build after EFI!
make bin/ipxe.liso bin/ipxe.eiso
}

package() {
cd ipxe/

install -D -m0755 ${srcdir}/grub ${pkgdir}/etc/grub.d/20_ipxe

install -D -m0644 COPYING ${pkgdir}/usr/share/licenses/ipxe/COPYING
install -D -m0644 COPYING.GPLv2 ${pkgdir}/usr/share/licenses/ipxe/COPYING.GPLv2
install -D -m0644 COPYING.UBDL ${pkgdir}/usr/share/licenses/ipxe/COPYING.UBDL

cd src/

# iPXE kernel bzImage
install -D -m0644 bin/ipxe.lkrn ${pkgdir}/boot/ipxe/ipxe.lkrn

# default targets, legacy and EFI ISO
install -D -m0644 bin/ipxe.dsk ${pkgdir}/usr/share/ipxe/ipxe.dsk
install -D -m0644 bin/ipxe.usb ${pkgdir}/usr/share/ipxe/ipxe.usb
install -D -m0644 bin/ipxe.iso ${pkgdir}/usr/share/ipxe/ipxe.iso
install -D -m0644 bin/ipxe.liso ${pkgdir}/usr/share/ipxe/ipxe-legacy.iso
install -D -m0644 bin/ipxe.eiso ${pkgdir}/usr/share/ipxe/ipxe-efi.iso

# iPXE UNDI-only targets
install -D -m0644 bin/undionly.kpxe ${pkgdir}/usr/lib/ipxe/undi.kpxe

# iPXE targets with full driver support
install -D -m0644 bin/ipxe.pxe ${pkgdir}/usr/lib/ipxe/ipxe.pxe
install -D -m0644 bin/ipxe-default.pxe ${pkgdir}/usr/lib/ipxe/ipxe-default.pxe
install -D -m0644 bin/ipxe-default-3928.pxe ${pkgdir}/usr/lib/ipxe/ipxe-default-3928.pxe

# iPXE EFI targets
install -D -m0644 bin-i386-efi/ipxe.efi ${pkgdir}/usr/lib/ipxe/efi-i386.efi
install -D -m0644 bin-x86_64-efi/ipxe.efi ${pkgdir}/usr/lib/ipxe/efi-x86_64.efi
}

sha256sums=('SKIP'
'a72ebfc3ab294cdf0d2a495597e84e87feba0fb48b618b504c1a8fc277b7366d'
'e60a4c6569e426a6ce7298a17c4f062d73391aa00aff5085694fee98a2618c8f'
'337fe8b39ba5fd8f921e83f1d6611f3945cd1d8b2f8fd780fcbdc6fffdcc0276'
'bbf03ca532be2ec36cd45420acc34815a03e321ebd435950a30ba052e3e7a2cc'
'808ff1b3ea54375d0b653b8dbe0992f7821329ef4b976a85a7ac7e5acc12a514'
'f7ec78e26671f4df90d89440d8b2a69473c15cb6b25dda32c773023378fec42a'
'e26a54b4e99816b34baebcb7a15d99d57c9395c9689ffbae2329cc675248f9b9')

View File

@ -0,0 +1,6 @@
#!ipxe

set next-server-port 3928

dhcp &&
chain http://${next-server}:${next-server-port}/default.ipxe

View File

@ -0,0 +1,6 @@
#!ipxe

set next-server-port 80

dhcp &&
chain http://${next-server}:${next-server-port}/default.ipxe

View File

@ -0,0 +1,43 @@
#! /bin/sh -e
########################################################
# This script generates an iPXE entry on grub.cfg #
# if ipxe is installed on the system. #
########################################################

prefix="/usr"
exec_prefix="${prefix}"

datarootdir="/usr/share"
datadir="${datarootdir}"

. "${datadir}/grub/grub-mkconfig_lib"

IPXE_BZIMAGE="/boot/ipxe/ipxe.lkrn"
case $(uname -m) in
x86_64) IPXE_EFI="/usr/lib/ipxe/efi-x86_64.efi";;
*) IPXE_EFI="/usr/lib/ipxe/efi-i386.efi";;
esac
IPXE_EFI_DEST="/boot/efi/EFI/ipxe/ipxe.efi"
CLASS="--class ipxe --class gnu --class tool"

if [ -d /sys/firmware/efi ]; then
if [ "$(stat -f --printf=%T /boot/efi/)" == "msdos" ] && [ -d /boot/efi/EFI ]; then
# EFI system
echo "Setting up iPXE for EFI chainloading" >&2
mkdir -p $(dirname ${IPXE_EFI_DEST})
cp ${IPXE_EFI} ${IPXE_EFI_DEST}
echo "menuentry "iPXE - Open Source Boot Firmware" ${CLASS} {"
prepare_grub_to_access_device $(${grub_probe} --target=device ${IPXE_EFI_DEST}) | sed -e "s/^/\t/"
echo -e "\tchainloader $(make_system_path_relative_to_its_root ${IPXE_EFI_DEST})"
echo "}"
fi
else
if [ -e ${IPXE_BZIMAGE} ] && is_path_readable_by_grub ${IPXE_BZIMAGE}; then
# image exists, create menu entry
echo "Found iPXE bzImage: ${IPXE_BZIMAGE}" >&2
echo "menuentry "iPXE - Open Source Boot Firmware" ${CLASS} {"
prepare_grub_to_access_device $(${grub_probe} --target=device ${IPXE_BZIMAGE}) | sed -e "s/^/\t/"
echo -e "\tlinux16 $(make_system_path_relative_to_its_root ${IPXE_BZIMAGE})"
echo "}"
fi
fi

View File

@ -0,0 +1,26 @@
post_install() {
# This text is taken from Makefile
cat <<EOF
> To create a bootable floppy, type
> cat bin/ipxe.dsk > /dev/fd0
> where /dev/fd0 is your floppy drive. This will erase any
> data already on the disk.
>
> To create a bootable USB key, type
> cat bin/ipxe.usb > /dev/sdX
> where /dev/sdX is your USB key, and is *not* a real hard
> disk on your system. This will erase any data already on
> the USB key.
>
> To create a bootable CD-ROM, burn the ISO image
> bin/ipxe.iso to a blank CD-ROM.
>
> These images contain drivers for all supported cards. You
> can build more customised images, and ROM images, using
> make bin/<rom-name>.<output-format>
EOF
if [ -x /usr/sbin/grub-mkconfig ] && [ -s /boot/grub/grub.cfg ]; then
echo " >"
echo " > You should run grub-mkconfig now."
fi
}

View File

@ -1,8 +1,12 @@
s/^#undef([[:space:]]*NET_PROTO_IPV6)/#define\1/g
s/^#undef([[:space:]]*DOWNLOAD_PROTO_HTTPS)/#define\1/g
## currently broken for EFI building
#s/^#undef([[:space:]]*DOWNLOAD_PROTO_HTTPS)/#define\1/g
s/^#undef([[:space:]]*DOWNLOAD_PROTO_FTP)/#define\1/g
s@^//(#define[[:space:]]*CONSOLE_CMD)@\1@g
# causing hangs? seems to cause linux kernels to crash
#s@^//(#define[[:space:]]*IMAGE_MULTIBOOT)@\1@g
# still have no idea what this does.
#s@^//(#define[[:space:]]*IMAGE_SCRIPT@\1@g
s@^//(#define[[:space:]]*IMAGE_PNG@\1@g
# save this for when we enable signed/trusted loading
#s@^//(#define[[:space:]]*IMAGE_TRUST_CMD@\1@g