diff --git a/src/ipxe_local/credits.txt b/src/ipxe_local/credits.txt new file mode 100644 index 0000000..5a53731 --- /dev/null +++ b/src/ipxe_local/credits.txt @@ -0,0 +1,8 @@ +Thanks to "eworm" for his work on the AUR iPXE-git package: +https://aur.archlinux.org/packages/ipxe-git/ + +and specifically the following patches: +http://www.eworm.de/download/linux/ipxe-0001-git-version.patch +http://www.eworm.de/download/linux/ipxe-0002-banner.patch +http://www.eworm.de/download/linux/ipxe-0003-iso-efi.patch +http://www.eworm.de/download/linux/ipxe-0004-fix-no-pie-workaround.patch diff --git a/src/ipxe_local/ipxe-efi b/src/ipxe_local/ipxe-efi deleted file mode 100644 index 9f356c5..0000000 --- a/src/ipxe_local/ipxe-efi +++ /dev/null @@ -1,14 +0,0 @@ -http://ipxe.org/download#efi - -" - -iPXE supports the EFI and UEFI environments, as well as the standard PC BIOS. You can build an EFI driver ROM using the .efirom image format. For example: - - make bin-i386-efi/808610de.efirom # 32-bit driver ROM - make bin-x86_64-efi/808610de.efirom # 64-bit driver ROM - -" - - - -http://ipxe.org/efi/vision diff --git a/src/ipxe_local/patches/ipxe-0001-git-version.patch b/src/ipxe_local/patches/ipxe-0001-git-version.patch new file mode 100644 index 0000000..8f89dd2 --- /dev/null +++ b/src/ipxe_local/patches/ipxe-0001-git-version.patch @@ -0,0 +1,32 @@ +From 4c139ece028b5dd6c4e5f46ce2bf8134c390de90 Mon Sep 17 00:00:00 2001 +From: Christian Hesse +Date: Thu, 12 Feb 2015 08:59:37 +0100 +Subject: [PATCH] git version + +Signed-off-by: Christian Hesse +--- + 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 + diff --git a/src/ipxe_local/patches/ipxe-0002-banner.patch b/src/ipxe_local/patches/ipxe-0002-banner.patch new file mode 100644 index 0000000..d457eec --- /dev/null +++ b/src/ipxe_local/patches/ipxe-0002-banner.patch @@ -0,0 +1,41 @@ +From 4ec31ece6757e19be455faa383886562b8793db9 Mon Sep 17 00:00:00 2001 +From: Christian Hesse +Date: Thu, 12 Feb 2015 09:06:41 +0100 +Subject: [PATCH] banner + +Signed-off-by: Christian Hesse +--- + 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 + diff --git a/src/ipxe_local/patches/ipxe-0003-iso-efi.patch b/src/ipxe_local/patches/ipxe-0003-iso-efi.patch new file mode 100644 index 0000000..401b61b --- /dev/null +++ b/src/ipxe_local/patches/ipxe-0003-iso-efi.patch @@ -0,0 +1,128 @@ +From ddf6f6ac945654b00121ab899fb0bbb63293e51e Mon Sep 17 00:00:00 2001 +From: Christian Hesse +Date: Tue, 7 Apr 2015 16:04:31 +0200 +Subject: [PATCH 1/2] [build] allow to build ISO image with EFI support + (ipxe.eiso) + +Signed-off-by: Christian Hesse +--- + src/arch/i386/Makefile.pcbios | 6 ++++++ + src/util/geniso | 39 ++++++++++++++++++++++++++++++--------- + 2 files changed, 36 insertions(+), 9 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..998370d 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,23 +42,24 @@ if [ -z "${OUT}" ]; then + exit 1 + fi + +-# There should either be mkisofs or the compatible genisoimage program +-for command in genisoimage mkisofs; do ++# We require xorriso (from libisoburn) for EFI support ++# genisoimage and mkisofs are missing some features ++for command in xorriso; do + if ${command} --version >/dev/null 2>/dev/null; then +- mkisofs=(${command}) ++ xorriso=(${command}) + break + fi + done + +-if [ -z "${mkisofs}" ]; then +- echo "${0}: mkisofs or genisoimage not found, please install or set PATH" >&2 ++if [ -z "${xorriso}" ]; then ++ echo "${0}: xorriso not found, please install or set PATH" >&2 + exit 1 + fi + + dir=$(mktemp -d bin/iso.dir.XXXXXX) + cfg=${dir}/isolinux.cfg + +-mkisofs+=(-quiet -l -volid "iPXE" -preparer "iPXE build system" ++xorriso+=(-as mkisofs -quiet -l -volid "iPXE" -preparer "iPXE build system" + -appid "iPXE ${VERSION} - Open Source Network Boot Firmware" + -publisher "http://ipxe.org/" -c boot.cat) + +@@ -116,12 +122,27 @@ case "${LEGACY}" in + fi + + # generate the iso image +- "${mkisofs[@]}" -b boot.img -output ${OUT} ${dir} ++ "${xorriso[@]}" -b boot.img -output ${OUT} ${dir} + ;; + 0) + # copy isolinux bootloader + cp ${ISOLINUX_BIN} ${dir} + ++ xorriso+=(-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" ++ ++ xorriso+=(-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 +150,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} ++ "${xorriso[@]}" -output ${OUT} ${dir} + + # isohybrid will be used if available + if isohybrid --version >/dev/null 2>/dev/null; then +-- +2.3.5 + diff --git a/src/ipxe_local/patches/ipxe-0004-fix-no-pie-workaround.patch b/src/ipxe_local/patches/ipxe-0004-fix-no-pie-workaround.patch new file mode 100644 index 0000000..6d76601 --- /dev/null +++ b/src/ipxe_local/patches/ipxe-0004-fix-no-pie-workaround.patch @@ -0,0 +1,34 @@ +From a4f7e3ba395af4cd0a706df635309d4ef837ecf8 Mon Sep 17 00:00:00 2001 +From: Christian Hesse +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 +--- + 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 +