Author: ward
Date: 2007-11-30 22:04:36 +0100 (Fri, 30 Nov 2007)
New Revision: 70
Added:
buildrom-devel/packages/gpxe/
buildrom-devel/packages/gpxe/conf/
buildrom-devel/packages/gpxe/conf/Config.i386
buildrom-devel/packages/gpxe/conf/Config.main
buildrom-devel/packages/gpxe/gpxe.mk
Modified:
buildrom-devel/Config.in
buildrom-devel/bin/fetchgit.sh
buildrom-devel/config/payloads/Config.in
buildrom-devel/config/payloads/payloads.conf
Log:
This patch adds preliminary gPXE support to buildrom. gPXE is the successor
of etherboot. It is currently undergoing some major work and does not have
LinuxBIOS support, so this is not useful yet. Peter and I talked to the
friendly folks at #etherboot, and they were interested in re-adding LinuxBIOS
support, but are a bit short of time. If someone wants to help out that
would be great.
The patch updates the fetchgit.sh script to bring it up to date with current
git tools, and pulls in gPXE from the git 'head'. gPXE will only show up in
kconfig when EXPERIMENTAL is enabled.
Signed-off-by: Ward Vandewege <ward(a)gnu.org>
Acked-by: Jordan Crouse <jordan.crouse(a)amd.com>
Modified: buildrom-devel/Config.in
===================================================================
--- buildrom-devel/Config.in 2007-11-30 20:27:25 UTC (rev 69)
+++ buildrom-devel/Config.in 2007-11-30 21:04:36 UTC (rev 70)
@@ -19,6 +19,16 @@
help
Allow yourself to do advanced developer things
+config EXPERIMENTAL
+ bool "Enable experimental features"
+ default n
+ help
+ Experimental features are not yet ready for prime time and/or
+ completely broken. The features revealed by this setting are likely to be
+ only useful if you are a developer and want to hack on buildrom.
+
+ If you are not sure, say no.
+
menu "LinuxBIOS configuration"
config USE_LZMA
Modified: buildrom-devel/bin/fetchgit.sh
===================================================================
--- buildrom-devel/bin/fetchgit.sh 2007-11-30 20:27:25 UTC (rev 69)
+++ buildrom-devel/bin/fetchgit.sh 2007-11-30 21:04:36 UTC (rev 70)
@@ -5,12 +5,13 @@
DIR=$2
TAG=$3
TARBALL=$4
+NAME=$5
# If the base git directory doesn't exist, then we need to clone it
-if [ ! -d $DIR/git ]; then
+if [ ! -d $DIR/.git ]; then
echo "Cloning $URL..."
- git-clone --bare $URL $DIR/git
+ git-clone $URL $DIR
if [ $? -ne 0 ]; then
echo "Couldn't clone $URL."
exit 1
@@ -19,7 +20,7 @@
# Fetch the latest and greatest bits
-export GIT_DIR=$DIR/git
+export GIT_DIR=$DIR/.git
git-fetch $URL
git-fetch --tags $URL
@@ -27,4 +28,4 @@
git-pack-redundant --all | xargs -r rm
# Make the tarball
-git-tar-tree $TAG git | gzip > $TARBALL
+git-tar-tree $TAG $NAME-$TAG | bzip2 > $TARBALL
Modified: buildrom-devel/config/payloads/Config.in
===================================================================
--- buildrom-devel/config/payloads/Config.in 2007-11-30 20:27:25 UTC (rev 69)
+++ buildrom-devel/config/payloads/Config.in 2007-11-30 21:04:36 UTC (rev 70)
@@ -12,6 +12,11 @@
config PAYLOAD_CUSTOM
bool "Custom Payload"
+config PAYLOAD_GPXE
+ depends EXPERIMENTAL
+ bool "GPXE"
+ select PAYLOAD
+
config PAYLOAD_ETHERBOOT
depends !PLATFORM_M57SLI
depends !PLATFORM_TYAN_S2891
@@ -127,4 +132,19 @@
Etherboot project for more details
endmenu
+
+menu "GPXE Configuration"
+depends PAYLOAD_GPXE
+depends EXPERIMENTAL
+
+config GPXE_DRIVER
+ string "GPXE NIC driver to support"
+ default "rtl8139"
+ help
+ Specify the GPXE NIC driver to build a ROM for. See the
+ GPXE project for more details
+
endmenu
+
+
+endmenu
Modified: buildrom-devel/config/payloads/payloads.conf
===================================================================
--- buildrom-devel/config/payloads/payloads.conf 2007-11-30 20:27:25 UTC (rev 69)
+++ buildrom-devel/config/payloads/payloads.conf 2007-11-30 21:04:36 UTC (rev 70)
@@ -18,6 +18,7 @@
PCONF-y=
PCONF-$(CONFIG_PAYLOAD_LAB) = lab.conf
PCONF-$(CONFIG_PAYLOAD_ETHERBOOT) = etherboot.conf
+PCONF-$(CONFIG_PAYLOAD_GPXE) = gpxe.conf
PCONF-$(CONFIG_PAYLOAD_FILO) = filo.conf
#PCONF-$(CONFIG_PAYLOAD_OFW) = ofw.conf
PCONF-$(CONFIG_PAYLOAD_MEMTEST) = memtest.conf
Added: buildrom-devel/packages/gpxe/conf/Config.i386
===================================================================
--- buildrom-devel/packages/gpxe/conf/Config.i386 (rev 0)
+++ buildrom-devel/packages/gpxe/conf/Config.i386 2007-11-30 21:04:36 UTC (rev 70)
@@ -0,0 +1,66 @@
+
+CFLAGS+= -DLINUXBIOS -DCONFIG_TSC_CURRTICKS -DCONSOLE_SERIAL -DCOMCONSOLE=0x3f8 -DCOMPRESERVE -DCONFIG_PCI_DIRECT -DELF_IMAGE
+
+CFLAGS+= -fstrength-reduce -fomit-frame-pointer -march=i386
+GCC_VERSION = $(subst ., ,$(shell $(CC) -dumpversion))
+GCC_MAJORVERSION = $(firstword $(GCC_VERSION))
+ifeq ($(GCC_MAJORVERSION),2)
+CFLAGS+= -malign-jumps=1 -malign-loops=1 -malign-functions=1
+else
+CFLAGS+= -falign-jumps=1 -falign-loops=1 -falign-functions=1
+endif
+GCC_MINORVERSION = $(word 2, $(GCC_VERSION))
+ifneq ($(GCC_MINORVERSION),4)
+CFLAGS+= -march=i386
+endif
+
+LDFLAGS+= -N
+
+ifeq "$(shell uname -s)" "FreeBSD"
+CFLAGS+= -DIMAGE_FREEBSD -DELF_IMAGE -DAOUT_IMAGE
+endif
+
+
+CFLAGS+= -DLINUXBIOS -DCONFIG_TSC_CURRTICKS -DCONSOLE_SERIAL -DCOMCONSOLE=0x3f8 -DCOMPRESERVE -DCONFIG_PCI_DIRECT -DELF_IMAGE
+
+CFLAGS+= -fstrength-reduce -fomit-frame-pointer -march=i386
+GCC_VERSION = $(subst ., ,$(shell $(CC) -dumpversion))
+GCC_MAJORVERSION = $(firstword $(GCC_VERSION))
+ifeq ($(GCC_MAJORVERSION),2)
+CFLAGS+= -malign-jumps=1 -malign-loops=1 -malign-functions=1
+else
+CFLAGS+= -falign-jumps=1 -falign-loops=1 -falign-functions=1
+endif
+GCC_MINORVERSION = $(word 2, $(GCC_VERSION))
+ifneq ($(GCC_MINORVERSION),4)
+CFLAGS+= -march=i386
+endif
+
+LDFLAGS+= -N
+
+ifeq "$(shell uname -s)" "FreeBSD"
+CFLAGS+= -DIMAGE_FREEBSD -DELF_IMAGE -DAOUT_IMAGE
+endif
+
+
+CFLAGS+= -DLINUXBIOS -DCONFIG_TSC_CURRTICKS -DCONSOLE_SERIAL -DCOMCONSOLE=0x3f8 -DCOMPRESERVE -DCONFIG_PCI_DIRECT -DELF_IMAGE
+
+CFLAGS+= -fstrength-reduce -fomit-frame-pointer -march=i386
+GCC_VERSION = $(subst ., ,$(shell $(CC) -dumpversion))
+GCC_MAJORVERSION = $(firstword $(GCC_VERSION))
+ifeq ($(GCC_MAJORVERSION),2)
+CFLAGS+= -malign-jumps=1 -malign-loops=1 -malign-functions=1
+else
+CFLAGS+= -falign-jumps=1 -falign-loops=1 -falign-functions=1
+endif
+GCC_MINORVERSION = $(word 2, $(GCC_VERSION))
+ifneq ($(GCC_MINORVERSION),4)
+CFLAGS+= -march=i386
+endif
+
+LDFLAGS+= -N
+
+ifeq "$(shell uname -s)" "FreeBSD"
+CFLAGS+= -DIMAGE_FREEBSD -DELF_IMAGE -DAOUT_IMAGE
+endif
+
Added: buildrom-devel/packages/gpxe/conf/Config.main
===================================================================
--- buildrom-devel/packages/gpxe/conf/Config.main (rev 0)
+++ buildrom-devel/packages/gpxe/conf/Config.main 2007-11-30 21:04:36 UTC (rev 70)
@@ -0,0 +1,96 @@
+CFLAGS+= -DCONFIG_PCI -DCONFIG_ISA
+CFLAGS+= -DASK_BOOT=3 -DBOOT_FIRST=BOOT_NIC
+
+ifdef INCLUDE_FILO
+CFLAGS+= -DCONFIG_FILO
+endif
+
+CFLAGS+= -DALLOW_ONLY_ENCAPSULATED
+CFLAGS+= -DBACKOFF_LIMIT=7 -DCONGESTED
+CFLAGS+= -DTAGGED_IMAGE -DELF_IMAGE
+CFLAGS+= -DDOWNLOAD_PROTO_TFTP
+
+HOST_CC= gcc
+CPP= gcc -E -Wp,-Wall
+RM= rm -f
+TOUCH= touch
+PERL= /usr/bin/perl
+CC= gcc
+AS= as
+LD= ld
+SIZE= size
+AR= ar
+RANLIB= ranlib
+OBJCOPY= objcopy
+
+CFLAGS+= -Os -ffreestanding
+CFLAGS+= -Wall -W -Wno-format
+CFLAGS+= $(EXTRA_CFLAGS)
+ASFLAGS+= $(EXTRA_ASFLAGS)
+LDFLAGS+= $(EXTRA_LDFLAGS)
+
+BIN=bin
+CFLAGS+= -DCONFIG_PCI -DCONFIG_ISA
+CFLAGS+= -DASK_BOOT=3 -DBOOT_FIRST=BOOT_NIC
+
+ifdef INCLUDE_FILO
+CFLAGS+= -DCONFIG_FILO
+endif
+
+CFLAGS+= -DALLOW_ONLY_ENCAPSULATED
+CFLAGS+= -DBACKOFF_LIMIT=7 -DCONGESTED
+CFLAGS+= -DTAGGED_IMAGE -DELF_IMAGE
+CFLAGS+= -DDOWNLOAD_PROTO_TFTP
+
+HOST_CC= gcc
+CPP= gcc -E -Wp,-Wall
+RM= rm -f
+TOUCH= touch
+PERL= /usr/bin/perl
+CC= gcc
+AS= as
+LD= ld
+SIZE= size
+AR= ar
+RANLIB= ranlib
+OBJCOPY= objcopy
+
+CFLAGS+= -Os -ffreestanding
+CFLAGS+= -Wall -W -Wno-format
+CFLAGS+= $(EXTRA_CFLAGS)
+ASFLAGS+= $(EXTRA_ASFLAGS)
+LDFLAGS+= $(EXTRA_LDFLAGS)
+
+BIN=bin
+CFLAGS+= -DCONFIG_PCI -DCONFIG_ISA
+CFLAGS+= -DASK_BOOT=3 -DBOOT_FIRST=BOOT_NIC
+
+ifdef INCLUDE_FILO
+CFLAGS+= -DCONFIG_FILO
+endif
+
+CFLAGS+= -DALLOW_ONLY_ENCAPSULATED
+CFLAGS+= -DBACKOFF_LIMIT=7 -DCONGESTED
+CFLAGS+= -DTAGGED_IMAGE -DELF_IMAGE
+CFLAGS+= -DDOWNLOAD_PROTO_TFTP
+
+HOST_CC= gcc
+CPP= gcc -E -Wp,-Wall
+RM= rm -f
+TOUCH= touch
+PERL= /usr/bin/perl
+CC= gcc
+AS= as
+LD= ld
+SIZE= size
+AR= ar
+RANLIB= ranlib
+OBJCOPY= objcopy
+
+CFLAGS+= -Os -ffreestanding
+CFLAGS+= -Wall -W -Wno-format
+CFLAGS+= $(EXTRA_CFLAGS)
+ASFLAGS+= $(EXTRA_ASFLAGS)
+LDFLAGS+= $(EXTRA_LDFLAGS)
+
+BIN=bin
Added: buildrom-devel/packages/gpxe/gpxe.mk
===================================================================
--- buildrom-devel/packages/gpxe/gpxe.mk (rev 0)
+++ buildrom-devel/packages/gpxe/gpxe.mk 2007-11-30 21:04:36 UTC (rev 70)
@@ -0,0 +1,144 @@
+GPXE_URL=git://git.etherboot.org/scm/gpxe.git
+GPXE_DIR=$(BUILD_DIR)/gpxe
+GPXE_TAG=master
+GPXE_SRC_DIR=$(GPXE_DIR)/gpxe-$(GPXE_TAG)/src
+GPXE_SOURCE=gpxe-$(GPXE_TAG).tar.bz2
+GPXE_STAMP_DIR=$(GPXE_DIR)/stamps
+GPXE_LOG_DIR=$(GPXE_DIR)/logs
+
+ifeq ($(GPXE_ARCH),)
+GPXE_ARCH=i386
+endif
+
+GPXE_PATCHES =
+
+# Filter the quotes off the config string
+GPXE_DRIVER := $(shell echo $(CONFIG_GPXE_DRIVER) | sed -e s:\"::g)
+GPXE_OUTPUT=$(GPXE_SRC_DIR)/bin/$(GPXE_DRIVER).elf
+
+ifeq ($(CONFIG_VERBOSE),y)
+GPXE_FETCH_LOG=/dev/stdout
+GPXE_BUILD_LOG=/dev/stdout
+GPXE_INSTALL_LOG=/dev/stdout
+else
+GPXE_FETCH_LOG=$(GPXE_LOG_DIR)/fetch.log
+GPXE_BUILD_LOG=$(GPXE_LOG_DIR)/build.log
+GPXE_INSTALL_LOG=$(GPXE_LOG_DIR)/install.log
+endif
+
+$(SOURCE_DIR)/$(GPXE_SOURCE):
+ @ echo "Fetching the GPXE source..."
+ $(BIN_DIR)/fetchgit.sh $(GPXE_URL) $(SOURCE_DIR)/gpxe \
+ $(GPXE_TAG) $(SOURCE_DIR)/$(GPXE_SOURCE) gpxe \
+ > $(GPXE_FETCH_LOG) 2>&1
+
+$(GPXE_STAMP_DIR)/.unpacked: $(SOURCE_DIR)/$(GPXE_SOURCE)
+ @ echo "Unpacking GPXE..."
+ @ tar -C $(GPXE_DIR) -jxf $(SOURCE_DIR)/$(GPXE_SOURCE)
+ @ touch $@
+
+$(GPXE_STAMP_DIR)/.patched: $(GPXE_STAMP_DIR)/.unpacked
+ @ echo "Patching GPXE..."
+ @ $(BIN_DIR)/doquilt.sh $(GPXE_SRC_DIR)/.. $(GPXE_PATCHES)
+ @ touch $@
+
+$(GPXE_STAMP_DIR)/.configured: $(GPXE_STAMP_DIR)/.patched
+ @ cp $(PACKAGE_DIR)/gpxe/conf/Config.main \
+ $(GPXE_SRC_DIR)/Config
+ @ cp $(PACKAGE_DIR)/gpxe/conf/Config.$(GPXE_ARCH) \
+ $(GPXE_SRC_DIR)/arch/$(GPXE_ARCH)/Config
+ @ touch $@
+
+$(GPXE_OUTPUT): $(GPXE_STAMP_DIR)/.configured
+ @ echo "Building GPXE..."
+ @ ( unset CFLAGS; export EXTRA_CFLAGS="$(CFLAGS)"; \
+ unset ASFLAGS; export EXTRA_ASFLAGS="$(ASFLAGS)"; \
+ unset LDFLAGS; \
+ $(MAKE) -C $(GPXE_SRC_DIR) ARCH=$(GPXE_ARCH) \
+ bin/$(GPXE_DRIVER).elf > $(GPXE_BUILD_LOG) 2>&1)
+
+$(GPXE_STAMP_DIR) $(GPXE_LOG_DIR):
+ @ mkdir -p $@
+
+gpxe: $(GPXE_STAMP_DIR) $(GPXE_LOG_DIR) $(GPXE_OUTPUT)
+ @ mkdir -p $(OUTPUT_DIR)
+ @ cp $(GPXE_OUTPUT) $(PAYLOAD_ELF)
+
+gpxe-clean:
+ @ echo "Cleaning GPXE..."
+ @ $(MAKE) -C $(GPXE_SRC_DIR) clean > /dev/null 2>&1
+
+gpxe-distclean:
+ @ rm -rf $(GPXE_DIR)/*
+GPXE_URL=git://git.etherboot.org/scm/gpxe.git
+GPXE_DIR=$(BUILD_DIR)/gpxe
+GPXE_TAG=master
+GPXE_SRC_DIR=$(GPXE_DIR)/gpxe-$(GPXE_TAG)/src
+GPXE_SOURCE=gpxe-$(GPXE_TAG).tar.bz2
+GPXE_STAMP_DIR=$(GPXE_DIR)/stamps
+GPXE_LOG_DIR=$(GPXE_DIR)/logs
+
+ifeq ($(GPXE_ARCH),)
+GPXE_ARCH=i386
+endif
+
+GPXE_PATCHES =
+
+# Filter the quotes off the config string
+GPXE_DRIVER := $(shell echo $(CONFIG_GPXE_DRIVER) | sed -e s:\"::g)
+GPXE_OUTPUT=$(GPXE_SRC_DIR)/bin/$(GPXE_DRIVER).elf
+
+ifeq ($(CONFIG_VERBOSE),y)
+GPXE_FETCH_LOG=/dev/stdout
+GPXE_BUILD_LOG=/dev/stdout
+GPXE_INSTALL_LOG=/dev/stdout
+else
+GPXE_FETCH_LOG=$(GPXE_LOG_DIR)/fetch.log
+GPXE_BUILD_LOG=$(GPXE_LOG_DIR)/build.log
+GPXE_INSTALL_LOG=$(GPXE_LOG_DIR)/install.log
+endif
+
+$(SOURCE_DIR)/$(GPXE_SOURCE):
+ @ echo "Fetching the GPXE source..."
+ $(BIN_DIR)/fetchgit.sh $(GPXE_URL) $(SOURCE_DIR)/gpxe \
+ $(GPXE_TAG) $(SOURCE_DIR)/$(GPXE_SOURCE) gpxe \
+ > $(GPXE_FETCH_LOG) 2>&1
+
+$(GPXE_STAMP_DIR)/.unpacked: $(SOURCE_DIR)/$(GPXE_SOURCE)
+ @ echo "Unpacking GPXE..."
+ @ tar -C $(GPXE_DIR) -jxf $(SOURCE_DIR)/$(GPXE_SOURCE)
+ @ touch $@
+
+$(GPXE_STAMP_DIR)/.patched: $(GPXE_STAMP_DIR)/.unpacked
+ @ echo "Patching GPXE..."
+ @ $(BIN_DIR)/doquilt.sh $(GPXE_SRC_DIR)/.. $(GPXE_PATCHES)
+ @ touch $@
+
+$(GPXE_STAMP_DIR)/.configured: $(GPXE_STAMP_DIR)/.patched
+ @ cp $(PACKAGE_DIR)/gpxe/conf/Config.main \
+ $(GPXE_SRC_DIR)/Config
+ @ cp $(PACKAGE_DIR)/gpxe/conf/Config.$(GPXE_ARCH) \
+ $(GPXE_SRC_DIR)/arch/$(GPXE_ARCH)/Config
+ @ touch $@
+
+$(GPXE_OUTPUT): $(GPXE_STAMP_DIR)/.configured
+ @ echo "Building GPXE..."
+ @ ( unset CFLAGS; export EXTRA_CFLAGS="$(CFLAGS)"; \
+ unset ASFLAGS; export EXTRA_ASFLAGS="$(ASFLAGS)"; \
+ unset LDFLAGS; \
+ $(MAKE) -C $(GPXE_SRC_DIR) ARCH=$(GPXE_ARCH) \
+ bin/$(GPXE_DRIVER).elf > $(GPXE_BUILD_LOG) 2>&1)
+
+$(GPXE_STAMP_DIR) $(GPXE_LOG_DIR):
+ @ mkdir -p $@
+
+gpxe: $(GPXE_STAMP_DIR) $(GPXE_LOG_DIR) $(GPXE_OUTPUT)
+ @ mkdir -p $(OUTPUT_DIR)
+ @ cp $(GPXE_OUTPUT) $(PAYLOAD_ELF)
+
+gpxe-clean:
+ @ echo "Cleaning GPXE..."
+ @ $(MAKE) -C $(GPXE_SRC_DIR) clean > /dev/null 2>&1
+
+gpxe-distclean:
+ @ rm -rf $(GPXE_DIR)/*