This is my code to expand on what Myles has already done for v3 -
basically, we move to using a V3 only .mk for LinuxBIOS, and take
advantage of LAR to clean up the build considerably. Also, introduce
my new idea for option ROMs which totally cleans things up - if this
doesn't set off anybody's BS meter, I'll backport it to v2 as well.
(probably by appending a 01, 02, 03... to the front of the ROM and
prepending them in order). If that goes down, then we can kill
off the Geode .mk in the linuxbios/ directory, which would be great.
Generic make targets for the win.
Please let me know what you think.
--
Jordan Crouse
Systems Software Development Engineer
Advanced Micro Devices, Inc.
[BUILDROM] Expand linuxbiosv3 support
Add more generic support for LinuxBIOSv3 - add specialized package
for v3, and add support for using LAR to put it all together. Also
add expanded (and better) option ROM support, though we're not actually
using it right away.
Signed-off-by: Jordan Crouse
jordan.crouse@amd.com
Index: buildrom-devel/Config.in
===================================================================
--- buildrom-devel.orig/Config.in 2007-12-06 14:33:41.000000000 -0700
+++ buildrom-devel/Config.in 2007-12-06 14:35:17.000000000 -0700
@@ -47,12 +47,24 @@
menu "LinuxBIOS configuration"
+choice
+ prompt "LinuxBIOS Version"
+ default LINUXBIOS_V2
+
+config LINUXBIOS_V2
+ bool "LinuxBIOS v2"
+ help
+ Select this option to build a .rom based on the LinuxBIOS
+ v2 code. The v2 code is far more stable, and supports many
+ different platforms.
+
config LINUXBIOS_V3
- bool "Use LinuxBIOSv3"
- depends ADVANCED
- default n
+ bool "LinuxBIOS v3"
+ depends EXPERIMENTAL
help
- Use the v3 tree. LinuxBIOSv3 doesn't support all platforms yet.
+ Select this option to build a LinuxBIOS v3 based ROM. This
+ is experimental, and only supports a few platforms.
+endchoice
config LINUXBIOS_V3_LGDT_PATCH
bool "Avoid an error in stage0_i586 with some compilers"
@@ -73,7 +85,6 @@
Allow LZMA compression for the payload. This doesn't work
for FILO or OFW.
-
config LB_USE_BUILD
bool "Specify a LinuxBIOS build dir"
depends ADVANCED
Index: buildrom-devel/config/platforms/Config.in
===================================================================
--- buildrom-devel.orig/config/platforms/Config.in 2007-12-06 14:32:42.000000000 -0700
+++ buildrom-devel/config/platforms/Config.in 2007-12-06 14:35:17.000000000 -0700
@@ -41,49 +41,58 @@
config PLATFORM_NORWICH
bool "AMD Geode LX 'Norwich'"
depends VENDOR_AMD
+ depends LINXUBIOS_V2
select PLATFORM
config PLATFORM_DBE61
bool "Artec Group DBE61"
depends VENDOR_ARTEC_GROUP
+ depends LINUXBIOS_V2
select PLATFORM
config PLATFORM_ALIX1C
bool "PC Engines ALIX1.C"
depends VENDOR_PC_ENGINES
+ depends LINUXBIOS_V2
select PLATFORM
config PLATFORM_MSM800SEV
bool "Advanced Digital Logic MSM800SEV"
depends VENDOR_ADVANCED_DIGITAL_LOGIC
+ depends LINUXBIOS_V2
select PLATFORM
config PLATFORM_DB800
bool "AMD DB800"
depends VENDOR_AMD
+ depends LINUXBIOS_V2
select PLATFORM
config PLATFORM_GA_M57SLI_S4
bool "GIGABYTE GA-M57SLI-S4"
depends VENDOR_GIGABYTE
+ depends LINUXBIOS_V2
select PLATFORM
select PLATFORM_SUPPORT_64BIT
config PLATFORM_GA_2761GXDK
bool "GIGABYTE GA-2761GXDK"
depends VENDOR_GIGABYTE
+ depends LINUXBIOS_V2
select PLATFORM
select PLATFORM_SUPPORT_64BIT
config PLATFORM_TYAN_S2882
bool "Tyan S2882"
depends VENDOR_TYAN
+ depends LINUXBIOS_V2
select PLATFORM
select PLATFORM_SUPPORT_64BIT
config PLATFORM_TYAN_S2891
bool "Tyan S2891"
depends VENDOR_TYAN
+ depends LINUXBIOS_V2
select PLATFORM
select PLATFORM_SUPPORT_64BIT
@@ -95,12 +104,14 @@
config PLATFORM_SERENGETI_CHEETAH
bool "AMD Serengeti-Cheetah"
depends VENDOR_AMD
+ depends LINUXBIOS_V2
select PLATFORM
select PLATFORM_SUPPORT_64BIT
config PLATFORM_SUPERMICRO_H8DMR
bool "Supermicro H8DMR"
depends VENDOR_SUPERMICRO
+ depends LINUXBIOS_V2
select PLATFORM
select PLATFORM_SUPPORT_64BIT
Index: buildrom-devel/Makefile
===================================================================
--- buildrom-devel.orig/Makefile 2007-12-06 14:32:42.000000000 -0700
+++ buildrom-devel/Makefile 2007-12-06 14:35:17.000000000 -0700
@@ -12,6 +12,7 @@
OUTPUT_DIR=$(BASE_DIR)/deploy
PACKAGE_DIR=$(BASE_DIR)/packages
BIN_DIR=$(BASE_DIR)/bin
+ROM_DIR=$(OUTPUT_DIR)/roms
ifeq (.config, $(wildcard .config))
dot-config := 1
@@ -39,16 +40,43 @@
# Include the global settings and other checks
include $(SCRIPT_DIR)/Build.settings
+# TARGET_ROM is what we are ultimately building - this should be
+# specified by the platform files
+
+TARGET_ROM ?= linuxbios.rom
+TARGET_ROM_FILE=$(OUTPUT_DIR)/$(TARGET_ROM)
+
+# Choose the version of LinuxBIOS to build - this might be better
+# elsewhere, but what the heck - its easy.
+
+LINUXBIOS-$(CONFIG_LINUXBIOS_V2) = linuxbios
+LINUXBIOS-$(CONFIG_LINUXBIOS_V3) = linuxbiosv3 roms
+
# Construct the list of packages we will be building
-PKGLIST = linuxbios $(PAYLOAD-y) $(HOSTTOOLS-y)
+PKGLIST = $(LINUXBIOS-y) $(PAYLOAD-y) $(HOSTTOOLS-y)
# Construct the various targets
PKG_clean=$(patsubst %, %-clean, $(PKGLIST))
PKG_distclean=$(patsubst %, %-distclean, $(PKGLIST))
-all: $(HOSTTOOLS-y) payload linuxbios
+# This is the top level target - for v2, the final deliverable is built
+# by LinuxBIOS, for v3 it is built by us, so we have ifdef magic here
+
+ifeq ($(CONFIG_LINUXBIOS_V2),y)
+rom: $(HOSTTOOLS-y) payload $(LINUXBIOS-y)
+else
+
+# Add the payload, and then add everything in the deploy/rom directory
+
+rom: $(HOSTTOOLS-y) payload $(LINUXBIOS-y)
+ cp $(LBV3_OUTPUT) $(TARGET_ROM_FILE)
+ $(STAGING_DIR)/bin/lar -a $(TARGET_ROM_FILE) $(PAYLOAD_TARGET):normal/payload
+ for file in `ls $(ROM_DIR)`; do \
+ $(STAGING_DIR)/bin/lar -a $(TARGET_ROM_FILE) $(ROM_DIR)/$$file:$$file; \
+ done
+endif
payload: $(PAYLOAD_TARGET)
@@ -70,9 +98,15 @@
MKTARGETS:= $(shell ls $(PACKAGE_DIR)/*/*.mk)
-include $(filter-out $(PACKAGE_DIR)/kernel/% $(PACKAGE_DIR)/linuxbios/%,$(MKTARGETS))
+include $(filter-out $(PACKAGE_DIR)/kernel/% $(PACKAGE_DIR)/linuxbios/% $(PACKAGE_DIR)/linuxbiosv3/%,$(MKTARGETS))
-include $(KERNEL_MK) $(LINUXBIOS_MK)
+include $(KERNEL_MK)
+
+ifeq ($(CONFIG_LINUXBIOS_V2),y)
+include $(LINUXBIOS_MK)
+else
+include $(PACKAGE_DIR)/linuxbiosv3/linuxbiosv3.mk
+endif
endif
Index: buildrom-devel/packages/linuxbios/conf.v3/qemu.conf
===================================================================
--- buildrom-devel.orig/packages/linuxbios/conf.v3/qemu.conf 2007-12-06 14:32:42.000000000 -0700
+++ /dev/null 1970-01-01 00:00:00.000000000 +0000
@@ -1,89 +0,0 @@
-#
-# Automatically generated make config: don't edit
-# LinuxBIOS version: 3.0.0
-# Wed Dec 5 11:10:31 2007
-#
-
-#
-# General setup
-#
-# CONFIG_EXPERIMENTAL is not set
-# CONFIG_EXPERT is not set
-CONFIG_LOCALVERSION=""
-
-#
-# Mainboard
-#
-# CONFIG_VENDOR_ADL is not set
-# CONFIG_VENDOR_AMD is not set
-# CONFIG_VENDOR_ARTECGROUP is not set
-CONFIG_VENDOR_EMULATION=y
-# CONFIG_VENDOR_PCENGINES is not set
-CONFIG_MAINBOARD_NAME="emulation/qemu-x86"
-CONFIG_MAINBOARD_PCI_SUBSYSTEM_VENDOR_ID=0x15ad
-CONFIG_MAINBOARD_PCI_SUBSYSTEM_DEVICE_ID=0x1976
-CONFIG_BOARD_EMULATION_QEMU_X86=y
-# CONFIG_LINUXBIOS_ROMSIZE_KB_128 is not set
-# CONFIG_LINUXBIOS_ROMSIZE_KB_256 is not set
-# CONFIG_LINUXBIOS_ROMSIZE_KB_512 is not set
-# CONFIG_LINUXBIOS_ROMSIZE_KB_1024 is not set
-CONFIG_LINUXBIOS_ROMSIZE_KB_2048=y
-CONFIG_LINUXBIOS_ROMSIZE_KB=2048
-CONFIG_ARCH_X86=y
-CONFIG_ARCH="x86"
-CONFIG_CPU_I586=y
-CONFIG_OPTION_TABLE=y
-
-#
-# Compression
-#
-# CONFIG_COMPRESSION_LZMA is not set
-# CONFIG_COMPRESSION_NRV2B is not set
-# CONFIG_DEFAULT_COMPRESSION_LZMA is not set
-# CONFIG_DEFAULT_COMPRESSION_NRV2B is not set
-CONFIG_DEFAULT_COMPRESSION_NONE=y
-
-#
-# Console
-#
-CONFIG_CONSOLE=y
-CONFIG_CONSOLE_LOGLEVEL_8=y
-# CONFIG_CONSOLE_LOGLEVEL_7 is not set
-# CONFIG_CONSOLE_LOGLEVEL_6 is not set
-# CONFIG_CONSOLE_LOGLEVEL_5 is not set
-# CONFIG_CONSOLE_LOGLEVEL_4 is not set
-# CONFIG_CONSOLE_LOGLEVEL_3 is not set
-# CONFIG_CONSOLE_LOGLEVEL_2 is not set
-# CONFIG_CONSOLE_LOGLEVEL_1 is not set
-# CONFIG_CONSOLE_LOGLEVEL_0 is not set
-CONFIG_DEFAULT_CONSOLE_LOGLEVEL=8
-CONFIG_CONSOLE_SERIAL=y
-CONFIG_CONSOLE_SERIAL_COM1=y
-# CONFIG_CONSOLE_SERIAL_COM2 is not set
-CONFIG_CONSOLE_SERIAL_115200=y
-# CONFIG_CONSOLE_SERIAL_57600 is not set
-# CONFIG_CONSOLE_SERIAL_38400 is not set
-# CONFIG_CONSOLE_SERIAL_19200 is not set
-# CONFIG_CONSOLE_SERIAL_9600 is not set
-
-#
-# Devices
-#
-CONFIG_PCI_OPTION_ROM_RUN=y
-# CONFIG_PCI_OPTION_ROM_RUN_X86EMU is not set
-CONFIG_PCI_OPTION_ROM_RUN_VM86=y
-# CONFIG_PCI_OPTION_ROM_RUN_NONE is not set
-# CONFIG_MULTIPLE_VGA_INIT is not set
-# CONFIG_INITIALIZE_ONBOARD_VGA_FIRST is not set
-CONFIG_NORTHBRIDGE_INTEL_I440BXEMULATION=y
-CONFIG_SOUTHBRIDGE_INTEL_I82371EB=y
-CONFIG_SUPERIO_WINBOND_W83627HF=y
-CONFIG_NORTHBRIDGE_INTEL_I440BXEMULATION_RAMSIZE=32
-
-#
-# Payload
-#
-# CONFIG_PAYLOAD_PREPARSE_ELF is not set
-CONFIG_PAYLOAD_ELF=y
-# CONFIG_PAYLOAD_NONE is not set
-CONFIG_PAYLOAD_FILE="payload.elf"
Index: buildrom-devel/packages/linuxbios/patches/lgdt.patch
===================================================================
--- buildrom-devel.orig/packages/linuxbios/patches/lgdt.patch 2007-12-06 14:32:42.000000000 -0700
+++ /dev/null 1970-01-01 00:00:00.000000000 +0000
@@ -1,14 +0,0 @@
-Index: svn/arch/x86/stage0_i586.S
-===================================================================
---- svn/arch/x86/stage0_i586.S (revision 539)
-+++ svn/arch/x86/stage0_i586.S (working copy)
-@@ -56,7 +56,8 @@
- * the ld hackery and other things. So leave it as is with this comment.
- */
-
-- data32 lgdt %cs:gdtptr
-+ movl $gdtptr, %ebx
-+ lgdt %cs:(%bx)
-
- movl %cr0, %eax
- andl $0x7FFAFFD1, %eax /* PG,AM,WP,NE,TS,EM,MP = 0 */
Index: buildrom-devel/packages/linuxbiosv3/conf/qemu-i386-defconfig
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ buildrom-devel/packages/linuxbiosv3/conf/qemu-i386-defconfig 2007-12-06 14:35:17.000000000 -0700
@@ -0,0 +1,88 @@
+#
+# Automatically generated make config: don't edit
+# LinuxBIOS version: 3.0.0
+# Thu Dec 6 04:44:00 2007
+#
+
+#
+# General setup
+#
+# CONFIG_EXPERIMENTAL is not set
+# CONFIG_EXPERT is not set
+CONFIG_LOCALVERSION=""
+
+#
+# Mainboard
+#
+# CONFIG_VENDOR_ADL is not set
+# CONFIG_VENDOR_AMD is not set
+# CONFIG_VENDOR_ARTECGROUP is not set
+CONFIG_VENDOR_EMULATION=y
+# CONFIG_VENDOR_PCENGINES is not set
+CONFIG_MAINBOARD_NAME="emulation/qemu-x86"
+CONFIG_MAINBOARD_PCI_SUBSYSTEM_VENDOR_ID=0x15ad
+CONFIG_MAINBOARD_PCI_SUBSYSTEM_DEVICE_ID=0x1976
+CONFIG_BOARD_EMULATION_QEMU_X86=y
+# CONFIG_LINUXBIOS_ROMSIZE_KB_128 is not set
+# CONFIG_LINUXBIOS_ROMSIZE_KB_256 is not set
+# CONFIG_LINUXBIOS_ROMSIZE_KB_512 is not set
+# CONFIG_LINUXBIOS_ROMSIZE_KB_1024 is not set
+CONFIG_LINUXBIOS_ROMSIZE_KB_2048=y
+CONFIG_LINUXBIOS_ROMSIZE_KB=2048
+CONFIG_ARCH_X86=y
+CONFIG_ARCH="x86"
+CONFIG_CPU_I586=y
+CONFIG_OPTION_TABLE=y
+
+#
+# Compression
+#
+# CONFIG_COMPRESSION_LZMA is not set
+# CONFIG_COMPRESSION_NRV2B is not set
+# CONFIG_DEFAULT_COMPRESSION_LZMA is not set
+# CONFIG_DEFAULT_COMPRESSION_NRV2B is not set
+CONFIG_DEFAULT_COMPRESSION_NONE=y
+
+#
+# Console
+#
+CONFIG_CONSOLE=y
+CONFIG_CONSOLE_LOGLEVEL_8=y
+# CONFIG_CONSOLE_LOGLEVEL_7 is not set
+# CONFIG_CONSOLE_LOGLEVEL_6 is not set
+# CONFIG_CONSOLE_LOGLEVEL_5 is not set
+# CONFIG_CONSOLE_LOGLEVEL_4 is not set
+# CONFIG_CONSOLE_LOGLEVEL_3 is not set
+# CONFIG_CONSOLE_LOGLEVEL_2 is not set
+# CONFIG_CONSOLE_LOGLEVEL_1 is not set
+# CONFIG_CONSOLE_LOGLEVEL_0 is not set
+CONFIG_DEFAULT_CONSOLE_LOGLEVEL=8
+CONFIG_CONSOLE_SERIAL=y
+CONFIG_CONSOLE_SERIAL_COM1=y
+# CONFIG_CONSOLE_SERIAL_COM2 is not set
+CONFIG_CONSOLE_SERIAL_115200=y
+# CONFIG_CONSOLE_SERIAL_57600 is not set
+# CONFIG_CONSOLE_SERIAL_38400 is not set
+# CONFIG_CONSOLE_SERIAL_19200 is not set
+# CONFIG_CONSOLE_SERIAL_9600 is not set
+
+#
+# Devices
+#
+CONFIG_PCI_OPTION_ROM_RUN=y
+# CONFIG_PCI_OPTION_ROM_RUN_X86EMU is not set
+CONFIG_PCI_OPTION_ROM_RUN_VM86=y
+# CONFIG_PCI_OPTION_ROM_RUN_NONE is not set
+# CONFIG_MULTIPLE_VGA_INIT is not set
+# CONFIG_INITIALIZE_ONBOARD_VGA_FIRST is not set
+CONFIG_NORTHBRIDGE_INTEL_I440BXEMULATION=y
+CONFIG_SOUTHBRIDGE_INTEL_I82371EB=y
+CONFIG_SUPERIO_WINBOND_W83627HF=y
+CONFIG_NORTHBRIDGE_INTEL_I440BXEMULATION_RAMSIZE=32
+
+#
+# Payload
+#
+# CONFIG_PAYLOAD_PREPARSE_ELF is not set
+# CONFIG_PAYLOAD_ELF is not set
+CONFIG_PAYLOAD_NONE=y
Index: buildrom-devel/packages/linuxbiosv3/patches/lgdt.patch
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ buildrom-devel/packages/linuxbiosv3/patches/lgdt.patch 2007-12-06 14:35:17.000000000 -0700
@@ -0,0 +1,14 @@
+Index: svn/arch/x86/stage0_i586.S
+===================================================================
+--- svn/arch/x86/stage0_i586.S (revision 539)
++++ svn/arch/x86/stage0_i586.S (working copy)
+@@ -56,7 +56,8 @@
+ * the ld hackery and other things. So leave it as is with this comment.
+ */
+
+- data32 lgdt %cs:gdtptr
++ movl $gdtptr, %ebx
++ lgdt %cs:(%bx)
+
+ movl %cr0, %eax
+ andl $0x7FFAFFD1, %eax /* PG,AM,WP,NE,TS,EM,MP = 0 */
Index: buildrom-devel/packages/roms/rom-geode.inc
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ buildrom-devel/packages/roms/rom-geode.inc 2007-12-06 14:35:17.000000000 -0700
@@ -0,0 +1,17 @@
+# This is the geode specific optionrom target
+# download VSA
+
+VSA_URL=
http://www.amd.com/files/connectivitysolutions/geode/geode_lx/
+GEODE_VSA=lx_vsa.36k.bin
+
+$(SOURCE_DIR)/$(GEODE_VSA):
+ @ echo "Fetching the VSA code..."
+ @ wget -P $(SOURCE_DIR) $(VSA_URL)/$(GEODE_VSA).gz -O $@
+
+# Copy the file to the ROM_DIR - it should have the same name that it
+# will have in the LAR
+
+$(ROM_DIR)/vsa: $(SOURCE_DIR)/$(GEODE_VSA):
+ @ cp $< $@
+
+OPTIONROM_TARGETS += $(ROM_DIR)/vsa
Index: buildrom-devel/packages/roms/roms.mk
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ buildrom-devel/packages/roms/roms.mk 2007-12-06 14:35:17.000000000 -0700
@@ -0,0 +1,22 @@
+# Each platform that needs an option ROM or other binary blob is specified
+# here
+
+
+OPTIONROM_TARGETS=
+
+OPTIONROM-y =
+OPTIONROM-$(CONFIG_PLATFORM_NORWICH) += rom-geode.inc
+
+ifneq ($(OPTIONROMS-y),)
+include $(OPTIONROM-y)
+endif
+
+$(ROM_DIR):
+ mkdir -p $(ROM_DIR)
+
+roms: $(ROM_DIR) $(OPTIONROM_TARGETS)
+
+roms-clean:
+ @ rm -rf $(OPTIONROM_TARGETS)
+
+roms-distclean: roms-clean
Index: buildrom-devel/config/platforms/qemu.conf
===================================================================
--- buildrom-devel.orig/config/platforms/qemu.conf 2007-12-06 14:32:42.000000000 -0700
+++ buildrom-devel/config/platforms/qemu.conf 2007-12-06 14:35:17.000000000 -0700
@@ -23,17 +23,15 @@
# Etherboot configuration
ETHERBOOT_ARCH=i386
-# LinuxBIOS configuration
-
-ifeq ($(CONFIG_LINUXBIOS_V3),y)
-LINUXBIOS_TAG=HEAD
-LINUXBIOS_V3_CONFIG=$(PACKAGE_DIR)/linuxbios/conf.v3/qemu.conf
-LINUXBIOS_ROM_NAME=build/linuxbios.rom
-else
+# LinuxBIOSv2 configuration
LINUXBIOS_TAG=2950
LINUXBIOS_CONFIG=Config.lb
LINUXBIOS_ROM_NAME=qemu.rom
-endif
+
+# LinuxBIOS v3 configuration
+LBV3_CONFIG=qemu-i386-defconfig
+LBV3_TAG=HEAD
+LBV3_ROM_NAME=linuxbios.rom
LINUXBIOS_VENDOR=emulation
LINUXBIOS_BOARD=qemu-i386
Index: buildrom-devel/packages/linuxbios/qemu.mk
===================================================================
--- buildrom-devel.orig/packages/linuxbios/qemu.mk 2007-12-06 14:32:42.000000000 -0700
+++ buildrom-devel/packages/linuxbios/qemu.mk 2007-12-06 14:35:17.000000000 -0700
@@ -8,29 +8,18 @@
LINUXBIOS_PATCHES =
-
-
LINUXBIOS_BASE_DIR=svn
TARGET_ROM = $(LINUXBIOS_VENDOR)-$(LINUXBIOS_BOARD).rom
LINUXBIOS_PAYLOAD_TARGET=$(LINUXBIOS_BUILD_DIR)/payload.elf
-ifeq ($(CONFIG_LINUXBIOS_V3),y)
- LINUXBIOS_URL=svn://linuxbios.org/repository/LinuxBIOSv3
- LINUXBIOS_TARBALL=linuxbiosv3-svn-$(LINUXBIOS_TAG).tar.gz
- ifeq ($(CONFIG_LINUXBIOS_V3_LGDT_PATCH),y)
- LINUXBIOS_PATCHES += $(PACKAGE_DIR)/linuxbios/patches/lgdt.patch
- endif
- LINUXBIOS_SVN_DIR=$(SOURCE_DIR)/linuxbiosv3
+ifeq ($(CONFIG_PAYLOAD_LAB),y)
+LINUXBIOS_PATCHES += $(PACKAGE_DIR)/linuxbios/patches/qemu-lab.patch
else
- ifeq ($(CONFIG_PAYLOAD_LAB),y)
- LINUXBIOS_PATCHES += $(PACKAGE_DIR)/linuxbios/patches/qemu-lab.patch
- else
- LINUXBIOS_PATCHES += $(PACKAGE_DIR)/linuxbios/patches/qemu-payload.patch
- endif
- LINUXBIOS_URL=svn://linuxbios.org/repos/trunk/LinuxBIOSv2
- LINUXBIOS_TARBALL=linuxbios-svn-$(LINUXBIOS_TAG).tar.gz
- LINUXBIOS_SVN_DIR=$(SOURCE_DIR)/linuxbios
+LINUXBIOS_PATCHES += $(PACKAGE_DIR)/linuxbios/patches/qemu-payload.patch
endif
+LINUXBIOS_URL=svn://linuxbios.org/repos/trunk/LinuxBIOSv2
+LINUXBIOS_TARBALL=linuxbios-svn-$(LINUXBIOS_TAG).tar.gz
+LINUXBIOS_SVN_DIR=$(SOURCE_DIR)/linuxbios
include $(PACKAGE_DIR)/linuxbios/linuxbios.inc
Index: buildrom-devel/packages/linuxbiosv3/linuxbiosv3.mk
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ buildrom-devel/packages/linuxbiosv3/linuxbiosv3.mk 2007-12-06 15:04:26.000000000 -0700
@@ -0,0 +1,71 @@
+LBV3_URL=svn://openbios.org/repository/LinuxBIOSv3
+LBV3_TARBALL=linuxbios-svn-$(LBV3_TAG).tar.gz
+LBV3_DIR=$(BUILD_DIR)/linuxbiosv3
+LBV3_SRC_DIR=$(LBV3_DIR)/svn
+
+LBV3_STAMP_DIR=$(LBV3_DIR)/stamps
+LBV3_LOG_DIR=$(LBV3_DIR)/logs
+
+ifeq ($(CONFIG_VERBOSE),y)
+LBV3_FETCH_LOG=/dev/stdout
+LBV3_BUILD_LOG=/dev/stdout
+else
+LBV3_FETCH_LOG=$(LBV3_LOG_DIR)/fetch.log
+LBV3_BUILD_LOG=$(LBV3_LOG_DIR)/build.log
+endif
+
+LBV3_OUTPUT=$(LBV3_SRC_DIR)/build/linuxbios.rom
+
+LBV3_PATCHES ?=
+
+ifeq ($(CONFIG_LINUXBIOS_V3_LGDT_PATCH),y)
+LBV3_PATCHES += $(PACKAGE_DIR)/linuxbiosv3/patches/lgdt.patch
+endif
+
+$(SOURCE_DIR)/$(LBV3_TARBALL):
+ @ mkdir -p $(SOURCE_DIR)/linuxbiosv3
+ @ $(BIN_DIR)/fetchsvn.sh $(LBV3_URL) \
+ $(SOURCE_DIR)/linuxbiosv3 $(LBV3_TAG) \
+ $@ > $(LBV3_FETCH_LOG) 2>&1
+
+$(LBV3_STAMP_DIR)/.unpacked: $(SOURCE_DIR)/$(LBV3_TARBALL)
+ @echo "Unpacking LinuxBIOSv3..."
+ @ mkdir -p $(LBV3_DIR)
+ @ tar -C $(LBV3_DIR) -zxf $(SOURCE_DIR)/$(LBV3_TARBALL)
+ @ touch $@
+
+$(LBV3_STAMP_DIR)/.patched: $(LBV3_STAMP_DIR)/.unpacked
+ @ echo "Patching LinuxBIOSv3..."
+ @ $(BIN_DIR)/doquilt.sh $(LBV3_SRC_DIR) $(LBV3_PATCHES)
+ @ touch $@
+
+$(LBV3_STAMP_DIR)/.configured: $(LBV3_STAMP_DIR)/.patched
+ @ echo "Configuring LinuxBIOSv3..."
+ @ cp $(PACKAGE_DIR)/linuxbiosv3/conf/$(LBV3_CONFIG) $(LBV3_SRC_DIR)/.config
+ @ make -C $(LBV3_SRC_DIR) oldconfig > $(LBV3_BUILD_LOG) 2>&1
+ @ touch $@
+
+$(LBV3_OUTPUT): $(LBV3_STAMP_DIR)/.configured
+ @ echo "Building LinuxBIOSv3..."
+ @ $(MAKE) -C $(LBV3_SRC_DIR) > $(LBV3_BUILD_LOG) 2>&1
+
+$(LBV3_SRC_DIR)/build/util/lar/lar: $(LBV3_STAMP_DIR)/.configured
+ @ $(MAKE) -C $(LBV3_SRC_DIR)/util lar > $(LBV3_BUILD_LOG) 2>&1
+
+$(STAGING_DIR)/bin/lar: $(LBV3_SRC_DIR)/build/util/lar/lar
+ @ mkdir -p $(STAGING_DIR)/bin
+ @ cp $< $@
+
+$(LBV3_STAMP_DIR):
+ @ mkdir -p $@
+
+linuxbiosv3: $(LBV3_STAMP_DIR) $(LBV3_OUTPUT) $(STAGING_DIR)/bin/lar
+
+linuxbiosv3-clean:
+ @ echo "Cleaning linuxbiosv3..."
+ @ $(MAKE) -C $(LBV3_SRC_DIR) clean > /dev/null 2>&1
+
+linuxbiosv3-distclean:
+ @ rm -rf $(LBV3_DIR)/*
+ @ rm -rf $(STAGING_DIR)/bin/lar
+