Author: ward Date: 2008-02-07 18:41:01 +0100 (Thu, 07 Feb 2008) New Revision: 109
Modified: buildrom-devel/Makefile buildrom-devel/config/payloads/filo.conf buildrom-devel/config/payloads/kernel.conf buildrom-devel/config/payloads/lab.conf buildrom-devel/packages/busybox/busybox.mk buildrom-devel/packages/coreboot-v2/coreboot.inc buildrom-devel/packages/filo/filo.mk buildrom-devel/packages/kernel/kernel.inc buildrom-devel/packages/lzma/lzma.mk buildrom-devel/packages/mkelfimage/mkelfimage.mk buildrom-devel/packages/uclibc/uclibc.mk buildrom-devel/packages/unifdef/unifdef.mk Log:
This patch adds extract targets, as well as some config targets: busybox-config, uclibc-config, kernel-config and filo-config.
The extract targets will just extract the component(s) under the work subdirectory.
The config targets will run a configure command for the component, and then copy the resulting custom config file to the conf directory for the package using a naming convention that indicates the payload, vendor, board and (for the kernel and uclibc) architecture.
That config file will then be used to build the image when 'make' is issued, overriding the default buildrom config for that package/payload - but only if there is a match for payload, vendor and board (and for uclibc and the kernel, architecture).
The config targets are somewhat smart: they will copy an existing custom config file back to the source directory so that doing a make something-config when a custom config file exists will have the effect of editing the custom config, rather than overwriting it.
If a custom config file is used, buildrom will say so on stdout.
Signed-off-by: Ward Vandewege ward@gnu.org Acked-by: Myles Watson myles@pel.cs.byu.edu
Modified: buildrom-devel/Makefile =================================================================== --- buildrom-devel/Makefile 2008-02-07 15:54:34 UTC (rev 108) +++ buildrom-devel/Makefile 2008-02-07 17:41:01 UTC (rev 109) @@ -21,7 +21,7 @@ config-targets := 1 endif
-ifneq ($(filter config %config,$(MAKECMDGOALS)),) +ifneq ($(filter textconfig oldconfig defconfig menuconfig,$(MAKECMDGOALS)),) config-targets := 1 dot-config := 0 endif @@ -60,6 +60,7 @@
PKG_clean=$(patsubst %, %-clean, $(PKGLIST)) PKG_distclean=$(patsubst %, %-distclean, $(PKGLIST)) +PKG_extract=$(patsubst %, %-extract, $(PKGLIST))
# This is the top level target - for v2, the final deliverable is built # by coreboot, for v3 it is built by us, so we have ifdef magic here @@ -78,6 +79,8 @@
payload: $(PAYLOAD_TARGET)
+extract: $(PKG_extract) + clean: $(PKG_clean) @ rm -rf $(INITRD_DIR) $(OUTPUT_DIR)
Modified: buildrom-devel/config/payloads/filo.conf =================================================================== --- buildrom-devel/config/payloads/filo.conf 2008-02-07 15:54:34 UTC (rev 108) +++ buildrom-devel/config/payloads/filo.conf 2008-02-07 17:41:01 UTC (rev 109) @@ -8,3 +8,6 @@ PAYLOAD_COMPRESSED=$(OUTPUT_DIR)/filo-payload.elf.lzma
PAYLOAD-y=filo + +PAYLOAD=filo +
Modified: buildrom-devel/config/payloads/kernel.conf =================================================================== --- buildrom-devel/config/payloads/kernel.conf 2008-02-07 15:54:34 UTC (rev 108) +++ buildrom-devel/config/payloads/kernel.conf 2008-02-07 17:41:01 UTC (rev 109) @@ -16,4 +16,6 @@ PAYLOAD_COMPRESSED=$(OUTPUT_DIR)/kernel-payload.elf.lzma
PAYLOAD-y= kernel +PAYLOAD=kernel + HOSTTOOLS-y = mkelfimage
Modified: buildrom-devel/config/payloads/lab.conf =================================================================== --- buildrom-devel/config/payloads/lab.conf 2008-02-07 15:54:34 UTC (rev 108) +++ buildrom-devel/config/payloads/lab.conf 2008-02-07 17:41:01 UTC (rev 109) @@ -30,4 +30,6 @@ PAYLOAD-$(CONFIG_BOOTMENU) += bootmenu PAYLOAD-$(CONFIG_OLPCFLASH) += olpcflash
+PAYLOAD=lab + HOSTTOOLS-y = mkelfimage unifdef
Modified: buildrom-devel/packages/busybox/busybox.mk =================================================================== --- buildrom-devel/packages/busybox/busybox.mk 2008-02-07 15:54:34 UTC (rev 108) +++ buildrom-devel/packages/busybox/busybox.mk 2008-02-07 17:41:01 UTC (rev 109) @@ -17,11 +17,18 @@
BUSYBOX_CONFIG ?= defconfig
+ifeq ($(findstring defconfig,$(BUSYBOX_CONFIG)),defconfig) +ifeq ($(shell if [ -f $(PACKAGE_DIR)/busybox/conf/customconfig--$(PAYLOAD)--$(COREBOOT_VENDOR)-$(COREBOOT_BOARD) ]; then echo 1; fi),1) + BUSYBOX_CONFIG = customconfig--$(PAYLOAD)--$(COREBOOT_VENDOR)-$(COREBOOT_BOARD) +endif +endif + $(SOURCE_DIR)/$(BUSYBOX_SOURCE): + @ echo "Downloading busybox..." @ mkdir -p $(SOURCE_DIR) @ wget -P $(SOURCE_DIR) $(BUSYBOX_URL)/$(BUSYBOX_SOURCE)
-$(BUSYBOX_STAMP_DIR)/.unpacked: $(SOURCE_DIR)/$(BUSYBOX_SOURCE) +$(BUSYBOX_STAMP_DIR)/.unpacked: $(SOURCE_DIR)/$(BUSYBOX_SOURCE) | $(BUSYBOX_STAMP_DIR) $(BUSYBOX_DIR) @ echo "Unpacking busybox..." @ tar -C $(BUSYBOX_DIR) -jxf $(SOURCE_DIR)/$(BUSYBOX_SOURCE) @ touch $@ @@ -32,24 +39,27 @@ @ touch $@
$(BUSYBOX_SRC_DIR)/.config: $(BUSYBOX_STAMP_DIR)/.patched - @ cp $(PACKAGE_DIR)/busybox/conf/$(BUSYBOX_CONFIG) $@ + @ cp -f $(PACKAGE_DIR)/busybox/conf/$(BUSYBOX_CONFIG) $@
-$(BUSYBOX_SRC_DIR)/busybox: $(BUSYBOX_SRC_DIR)/.config +$(BUSYBOX_SRC_DIR)/busybox: $(BUSYBOX_SRC_DIR)/.config | $(BUSYBOX_LOG_DIR) @ echo "Building busybox..." +ifneq ($(findstring defconfig,$(BUSYBOX_CONFIG)),defconfig) + @ echo "Using custom config $(PACKAGE_DIR)/busybox/conf/$(BUSYBOX_CONFIG)" +endif @ ( unset CFLAGS; unset LDFLAGS; \ export EXTRA_CFLAGS="$(CFLAGS)";\ export LDFLAGS="$(LDFLAGS_orig)";\ $(MAKE) -C $(BUSYBOX_SRC_DIR) VERBOSE=y \ LIBRARIES="$(LIBS)" all > $(BUSYBOX_BUILD_LOG) 2>&1)
-$(INITRD_DIR)/bin/busybox: $(BUSYBOX_SRC_DIR)/busybox +$(INITRD_DIR)/bin/busybox: $(BUSYBOX_SRC_DIR)/busybox | $(BUSYBOX_LOG_DIR) @ $(MAKE) -C $(BUSYBOX_SRC_DIR) \ PREFIX=$(INITRD_DIR) install > $(BUSYBOX_INSTALL_LOG) 2>&1
-$(BUSYBOX_STAMP_DIR) $(BUSYBOX_LOG_DIR): +$(BUSYBOX_STAMP_DIR) $(BUSYBOX_LOG_DIR) $(BUSYBOX_DIR): @ mkdir -p $@
-busybox: $(BUSYBOX_STAMP_DIR) $(BUSYBOX_LOG_DIR) $(INITRD_DIR)/bin/busybox +busybox: $(INITRD_DIR)/bin/busybox
busybox-clean: @ echo "Cleaning busybox..." @@ -62,3 +72,27 @@ @ echo "Package: busybox" @ echo "Source: $(BUSYBOX_URL)/$(BUSYBOX_SOURCE)" @ echo "" + +busybox-extract: $(BUSYBOX_STAMP_DIR)/.patched + +busybox-config: $(BUSYBOX_STAMP_DIR)/.patched +ifeq ($(shell if [ -f $(PACKAGE_DIR)/busybox/conf/customconfig--$(PAYLOAD)--$(COREBOOT_VENDOR)-$(COREBOOT_BOARD) ]; then echo 1; fi),1) + @ cp -f $(PACKAGE_DIR)/busybox/conf/customconfig--$(PAYLOAD)--$(COREBOOT_VENDOR)-$(COREBOOT_BOARD) $(BUSYBOX_SRC_DIR)/.config +endif +ifeq (busybox,$(filter busybox,$(PAYLOAD-y))) + @ echo "Configure busybox..." + @ $(MAKE) -C $(BUSYBOX_SRC_DIR) menuconfig + @ echo +ifeq ($(shell if [ -f $(PACKAGE_DIR)/busybox/conf/customconfig--$(PAYLOAD)--$(COREBOOT_VENDOR)-$(COREBOOT_BOARD) ]; then echo 1; fi),1) + @ echo "Found an existing custom configuration file:" + @ echo " $(PACKAGE_DIR)/busybox/conf/customconfig--$(PAYLOAD)--$(COREBOOT_VENDOR)-$(COREBOOT_BOARD)" + @ echo "I've copied it back to the source directory for modification." + @ echo "Remove the above file and re-run this command if you want to create a new custom configuration from scratch for this payload/board." + @ echo +endif + @ cp -f $(BUSYBOX_SRC_DIR)/.config $(PACKAGE_DIR)/busybox/conf/customconfig--$(PAYLOAD)--$(COREBOOT_VENDOR)-$(COREBOOT_BOARD) + @ echo "Your custom busybox config file has been saved as $(PACKAGE_DIR)/busybox/conf/customconfig--$(PAYLOAD)--$(COREBOOT_VENDOR)-$(COREBOOT_BOARD)." + @ echo +else + @ echo "Your payload does not require busybox." +endif
Modified: buildrom-devel/packages/coreboot-v2/coreboot.inc =================================================================== --- buildrom-devel/packages/coreboot-v2/coreboot.inc 2008-02-07 15:54:34 UTC (rev 108) +++ buildrom-devel/packages/coreboot-v2/coreboot.inc 2008-02-07 17:41:01 UTC (rev 109) @@ -58,8 +58,8 @@ $(CBV2_PAYLOAD_TARGET): $(PAYLOAD_TARGET) @ cp $< $@
-$(CBV2_STAMP_DIR)/.unpacked: $(SOURCE_DIR)/$(CBV2_TARBALL) - @ echo "Unpacking coreboot..." +$(CBV2_STAMP_DIR)/.unpacked: $(SOURCE_DIR)/$(CBV2_TARBALL) | $(CBV2_STAMP_DIR) $(CBV2_LOG_DIR) + @ echo "Unpacking coreboot ($(CBV2_TARBALL))..." @ tar -C $(CBV2_DIR) -zxf $(SOURCE_DIR)/$(CBV2_TARBALL) @ touch $@
@@ -98,3 +98,6 @@ fi
@ rm -rf $(CBV2_DIR)/* + +coreboot-extract: $(CBV2_STAMP_DIR)/.patched +
Modified: buildrom-devel/packages/filo/filo.mk =================================================================== --- buildrom-devel/packages/filo/filo.mk 2008-02-07 15:54:34 UTC (rev 108) +++ buildrom-devel/packages/filo/filo.mk 2008-02-07 17:41:01 UTC (rev 109) @@ -25,13 +25,17 @@
FILO_TARBALL=filo-svn-$(FILO_TAG).tar.gz
+ifeq ($(shell if [ -f $(PACKAGE_DIR)/filo/conf/customconfig--$(PAYLOAD)--$(COREBOOT_VENDOR)-$(COREBOOT_BOARD) ]; then echo 1; fi),1) + FILO_CONFIG = customconfig--$(PAYLOAD)--$(COREBOOT_VENDOR)-$(COREBOOT_BOARD) +endif + $(SOURCE_DIR)/$(FILO_TARBALL): @ mkdir -p $(SOURCE_DIR)/filo @ $(BIN_DIR)/fetchsvn.sh $(FILO_URL) $(SOURCE_DIR)/filo \ $(FILO_TAG) $(SOURCE_DIR)/$(FILO_TARBALL) \ > $(FILO_FETCH_LOG) 2>&1
-$(FILO_STAMP_DIR)/.unpacked: $(SOURCE_DIR)/$(FILO_TARBALL) +$(FILO_STAMP_DIR)/.unpacked: $(SOURCE_DIR)/$(FILO_TARBALL) | $(FILO_STAMP_DIR) $(FILO_DIR) @ echo "Unpacking filo..." @ tar -C $(FILO_DIR) -zxf $(SOURCE_DIR)/$(FILO_TARBALL) @ touch $@ @@ -48,6 +52,9 @@
$(FILO_SRC_DIR)/filo.elf: $(FILO_STAMP_DIR)/.configured @ echo "Building filo..." +ifeq ($(findstring customconfig,$(FILO_CONFIG)),customconfig) + @ echo "Using custom config $(PACKAGE_DIR)/filo/conf/$(FILO_CONFIG)" +endif @ make -C $(FILO_SRC_DIR) filo.elf > $(FILO_BUILD_LOG) 2>&1
$(FILO_STAMP_DIR) $(FILO_LOG_DIR): @@ -64,3 +71,24 @@ filo-distclean: @ rm -rf $(FILO_DIR)/*
+filo-extract: $(FILO_STAMP_DIR)/.patched + +filo-config: $(FILO_STAMP_DIR)/.unpacked +ifeq ($(shell if [ -f $(PACKAGE_DIR)/filo/conf/customconfig--$(PAYLOAD)--$(COREBOOT_VENDOR)-$(COREBOOT_BOARD) ]; then echo 1; fi),1) + @ echo + @ echo "Found an existing custom configuration file:" + @ echo " $(PACKAGE_DIR)/filo/conf/customconfig--$(PAYLOAD)--$(COREBOOT_VENDOR)-$(COREBOOT_BOARD)" + @ echo "Please modify this file by hand." + @ echo "Remove the above file and re-run this command if you want to create a new custom configuration from scratch for this payload/board." + @ echo +else + @ echo "Configure filo..." + @ $(MAKE) -C $(FILO_SRC_DIR) config + @ cp -f $(FILO_SRC_DIR)/Config $(PACKAGE_DIR)/filo/conf/customconfig--$(PAYLOAD)--$(COREBOOT_VENDOR)-$(COREBOOT_BOARD) + @ echo + @ echo "Your custom FILO config has been saved as " + @ echo " $(PACKAGE_DIR)/filo/conf/customconfig--$(PAYLOAD)--$(COREBOOT_VENDOR)-$(COREBOOT_BOARD)" + @ echo "Please edit it to your liking." + @ echo +endif +
Modified: buildrom-devel/packages/kernel/kernel.inc =================================================================== --- buildrom-devel/packages/kernel/kernel.inc 2008-02-07 15:54:34 UTC (rev 108) +++ buildrom-devel/packages/kernel/kernel.inc 2008-02-07 17:41:01 UTC (rev 109) @@ -15,6 +15,12 @@ KERNEL_BUILD_ARCH=i386 endif
+ifeq ($(findstring defconfig,$(KERNEL_CONFIG)),defconfig) +ifeq ($(shell if [ -f $(PACKAGE_DIR)/kernel/conf/customconfig--$(PAYLOAD)--$(KERNEL_BUILD_ARCH)--$(COREBOOT_VENDOR)-$(COREBOOT_BOARD) ]; then echo 1; fi),1) + KERNEL_CONFIG = $(PACKAGE_DIR)/kernel/conf/customconfig--$(PAYLOAD)--$(KERNEL_BUILD_ARCH)--$(COREBOOT_VENDOR)-$(COREBOOT_BOARD) +endif +endif + ifeq ($(CONFIG_VERBOSE),y) KERNEL_FETCH_LOG=/dev/stdout KERNEL_BUILD_LOG=/dev/stdout @@ -25,7 +31,7 @@ KERNEL_INSTALL_LOG=$(KERNEL_LOG_DIR)/install.log endif
-$(KERNEL_STAMP_DIR)/.unpacked: $(SOURCE_DIR)/$(KERNEL_SOURCE) +$(KERNEL_STAMP_DIR)/.unpacked: $(SOURCE_DIR)/$(KERNEL_SOURCE) | $(KERNEL_STAMP_DIR) @ mkdir -p $(KERNEL_DIR) @ echo "Unpacking kernel..." @ tar -C $(KERNEL_DIR) -jxf $(SOURCE_DIR)/$(KERNEL_SOURCE) @@ -50,8 +56,11 @@ $(KERNEL_SRC_DIR)/.config: $(KERNEL_STAMP_DIR)/.patched @ cat $(KERNEL_CONFIG) | sed -e s:^CONFIG_LOCALVERSION=.*:CONFIG_LOCALVERSION="$(ROM_VERSION)": > $(KERNEL_SRC_DIR)/.config
-$(KERNEL_BZIMAGE): $(KERNEL_SRC_DIR)/.config +$(KERNEL_BZIMAGE): $(KERNEL_SRC_DIR)/.config | $(KERNEL_LOG_DIR) @ echo "Building kernel..." +ifneq ($(findstring defconfig,$(KERNEL_CONFIG)),defconfig) + @ echo "Using custom kernel config $(KERNEL_CONFIG)" +endif @ $(MAKE) $(PARALLEL_MAKE) -C $(KERNEL_SRC_DIR) ARCH=$(KERNEL_BUILD_ARCH) \ KERNEL_CC="$(CC)" KERNEL_LD="$(LD)" > $(KERNEL_BUILD_LOG) 2>&1
@@ -63,7 +72,7 @@ @ install -d $(OUTPUT_DIR) @ install -m 0644 $(KERNEL_SRC_DIR)/vmlinux $@ -$(KERNEL_STAMP_DIR)/.headers: $(KERNEL_SRC_DIR)/.config $(STAGING_DIR)/host/bin/unifdef +$(KERNEL_STAMP_DIR)/.headers: $(KERNEL_SRC_DIR)/.config $(STAGING_DIR)/host/bin/unifdef | $(KERNEL_LOG_DIR) @ echo "Installing kernel headers..." @( export PATH=$(PATH):$(STAGING_DIR)/host/bin; \ $(MAKE) -C $(KERNEL_SRC_DIR) ARCH=$(KERNEL_BUILD_ARCH) \ @@ -73,7 +82,7 @@ $(KERNEL_STAMP_DIR) $(KERNEL_LOG_DIR): @ mkdir -p $@
-generic-kernel: $(KERNEL_STAMP_DIR) $(KERNEL_LOG_DIR) $(OUTPUT_DIR)/bzImage $(OUTPUT_DIR)/vmlinux $(KERNEL_STAMP_DIR)/.headers +generic-kernel: $(OUTPUT_DIR)/bzImage $(OUTPUT_DIR)/vmlinux $(KERNEL_STAMP_DIR)/.headers
generic-kernel-clean: @ echo "Cleaning kernel..." @@ -83,3 +92,27 @@
generic-kernel-distclean: @ rm -rf $(KERNEL_DIR) + +kernel-extract: $(KERNEL_STAMP_DIR)/.patched + +kernel-config: $(KERNEL_STAMP_DIR)/.patched +ifeq ($(shell if [ -f $(PACKAGE_DIR)/kernel/conf/customconfig--$(PAYLOAD)--$(KERNEL_BUILD_ARCH)--$(COREBOOT_VENDOR)-$(COREBOOT_BOARD) ]; then echo 1; fi),1) + @ cp -f $(PACKAGE_DIR)/kernel/conf/customconfig--$(PAYLOAD)--$(KERNEL_BUILD_ARCH)--$(COREBOOT_VENDOR)-$(COREBOOT_BOARD) $(KERNEL_SRC_DIR)/.config +endif +ifeq (kernel,$(filter kernel,$(PAYLOAD-y))) + @ echo "Configure kernel..." + @ $(MAKE) -C $(KERNEL_SRC_DIR) ARCH=$(KERNEL_BUILD_ARCH) menuconfig + @ echo +ifeq ($(shell if [ -f $(PACKAGE_DIR)/kernel/conf/customconfig--$(PAYLOAD)--$(KERNEL_BUILD_ARCH)--$(COREBOOT_VENDOR)-$(COREBOOT_BOARD) ]; then echo 1; fi),1) + @ echo "Found an existing custom configuration file:" + @ echo " $(PACKAGE_DIR)/kernel/conf/customconfig--$(PAYLOAD)--$(KERNEL_BUILD_ARCH)--$(COREBOOT_VENDOR)-$(COREBOOT_BOARD)" + @ echo "I've copied it back to the source directory for modification." + @ echo "Remove the above file and re-run this command if you want to create a new custom configuration from scratch for this payload/board." + @ echo +endif + @ cp -f $(KERNEL_SRC_DIR)/.config $(PACKAGE_DIR)/kernel/conf/customconfig--$(PAYLOAD)--$(KERNEL_BUILD_ARCH)--$(COREBOOT_VENDOR)-$(COREBOOT_BOARD) + @ echo "Your custom kernel config file has been saved as $(PACKAGE_DIR)/kernel/conf/customconfig--$(PAYLOAD)--$(KERNEL_BUILD_ARCH)--$(COREBOOT_VENDOR)-$(COREBOOT_BOARD)." + @ echo +else + @ echo "Your payload does not require a kernel." +endif
Modified: buildrom-devel/packages/lzma/lzma.mk =================================================================== --- buildrom-devel/packages/lzma/lzma.mk 2008-02-07 15:54:34 UTC (rev 108) +++ buildrom-devel/packages/lzma/lzma.mk 2008-02-07 17:41:01 UTC (rev 109) @@ -17,7 +17,7 @@ @ mkdir -p $(SOURCE_DIR) @ wget -P $(SOURCE_DIR) $(LZMA_URL)/$(LZMA_SOURCE)
-$(LZMA_STAMP_DIR)/.unpacked: $(SOURCE_DIR)/$(LZMA_SOURCE) +$(LZMA_STAMP_DIR)/.unpacked: $(SOURCE_DIR)/$(LZMA_SOURCE) | $(LZMA_STAMP_DIR) @ mkdir -p $(LZMA_SRC_DIR) @ tar -C $(LZMA_SRC_DIR) -jxf $(SOURCE_DIR)/$(LZMA_SOURCE) @ touch $@ @@ -44,3 +44,6 @@
lzma-distclean: @ rm -rf $(LZMA_DIR)/* + +lzma-extract: $(LZMA_STAMP_DIR)/.unpacked +
Modified: buildrom-devel/packages/mkelfimage/mkelfimage.mk =================================================================== --- buildrom-devel/packages/mkelfimage/mkelfimage.mk 2008-02-07 15:54:34 UTC (rev 108) +++ buildrom-devel/packages/mkelfimage/mkelfimage.mk 2008-02-07 17:41:01 UTC (rev 109) @@ -15,11 +15,14 @@ MKELFIMAGE_CONFIG_LOG=$(MKELFIMAGE_LOG_DIR)/config.log endif
+$(MKELFIMAGE_STAMP_DIR) $(MKELFIMAGE_LOG_DIR): + @ mkdir -p $@ + $(SOURCE_DIR)/$(MKELFIMAGE_SOURCE): @ mkdir -p $(SOURCE_DIR) @ wget -P $(SOURCE_DIR) $(MKELFIMAGE_URL)/$(MKELFIMAGE_SOURCE)
-$(MKELFIMAGE_STAMP_DIR)/.unpacked: $(SOURCE_DIR)/$(MKELFIMAGE_SOURCE) +$(MKELFIMAGE_STAMP_DIR)/.unpacked: $(SOURCE_DIR)/$(MKELFIMAGE_SOURCE) | $(MKELFIMAGE_STAMP_DIR) $(MKELFIMAGE_LOG_DIR) @ echo "Unpacking mkelfimage..." @ tar -C $(MKELFIMAGE_DIR) -zxf $(SOURCE_DIR)/$(MKELFIMAGE_SOURCE) @ touch $@ @@ -45,11 +48,8 @@ @ install -d $(STAGING_DIR)/sbin @ install -m 0755 $< $@
-$(MKELFIMAGE_STAMP_DIR) $(MKELFIMAGE_LOG_DIR): - @ mkdir -p $@ +mkelfimage: $(STAGING_DIR)/sbin/mkelfImage
-mkelfimage: $(MKELFIMAGE_STAMP_DIR) $(MKELFIMAGE_LOG_DIR) $(STAGING_DIR)/sbin/mkelfImage - mkelfimage-clean: $(MAKE) -C $(MKELFIMAGE_SRC_DIR) clean
@@ -60,3 +60,6 @@ echo "Package: mkelfimage" echo "Source: $(MKELFIMAGE_URL)/$(MKELFIMAGE_SOURCE)" echo "" + +mkelfimage-extract: $(MKELFIMAGE_STAMP_DIR)/.patched +
Modified: buildrom-devel/packages/uclibc/uclibc.mk =================================================================== --- buildrom-devel/packages/uclibc/uclibc.mk 2008-02-07 15:54:34 UTC (rev 108) +++ buildrom-devel/packages/uclibc/uclibc.mk 2008-02-07 17:41:01 UTC (rev 109) @@ -9,6 +9,12 @@ UCLIBC_CONFIG ?= defconfig endif
+ifeq ($(findstring defconfig,$(UCLIBC_CONFIG)),defconfig) +ifeq ($(shell if [ -f $(PACKAGE_DIR)/uclibc/conf/customconfig--$(PAYLOAD)--$(UCLIBC_ARCH)--$(COREBOOT_VENDOR)-$(COREBOOT_BOARD) ]; then echo 1; fi),1) + UCLIBC_CONFIG = customconfig--$(PAYLOAD)--$(UCLIBC_ARCH)--$(COREBOOT_VENDOR)-$(COREBOOT_BOARD) +endif +endif + UCLIBC_URL=http://www.uclibc.org/downloads UCLIBC_SOURCE=uClibc-$(UCLIBC_VER).tar.bz2 UCLIBC_DIR=$(BUILD_DIR)/uclibc @@ -25,10 +31,11 @@ endif
$(SOURCE_DIR)/$(UCLIBC_SOURCE): + @ echo "Downloading uclibc..." @ mkdir -p $(SOURCE_DIR) @ wget -P $(SOURCE_DIR) $(UCLIBC_URL)/$(UCLIBC_SOURCE)
-$(UCLIBC_STAMP_DIR)/.unpacked: $(SOURCE_DIR)/$(UCLIBC_SOURCE) +$(UCLIBC_STAMP_DIR)/.unpacked: $(SOURCE_DIR)/$(UCLIBC_SOURCE) | $(UCLIBC_STAMP_DIR) $(UCLIBC_DIR) @ echo "Unpacking uclibc..." @ tar -C $(UCLIBC_DIR) -jxf $(SOURCE_DIR)/$(UCLIBC_SOURCE) @ touch $@ @@ -38,6 +45,9 @@
$(UCLIBC_SRC_DIR)/lib/libc.a: $(UCLIBC_SRC_DIR)/.config @ echo "Building uclibc..." +ifneq ($(findstring defconfig,$(UCLIBC_CONFIG)),defconfig) + @ echo "Using custom config $(PACKAGE_DIR)/uclibc/conf/$(UCLIBC_CONFIG)" +endif @ ( unset CFLAGS; unset LDFLAGS; \ $(MAKE) $(PARALLEL_MAKE) -C $(UCLIBC_SRC_DIR) TARGET_ARCH="$(UCLIBC_ARCH)" \ CC="$(CC) $(CROSS_CFLAGS)" LD="$(LD) $(CROSS_LDFLAGS)" \ @@ -61,7 +71,7 @@ @ install -m 755 -d $(STAGING_DIR)/bin @ install -m 755 $< $@
-$(UCLIBC_STAMP_DIR) $(UCLIBC_LOG_DIR): +$(UCLIBC_STAMP_DIR) $(UCLIBC_LOG_DIR) $(UCLIBC_DIR): @ mkdir -p $@
uclibc: $(UCLIBC_STAMP_DIR) $(UCLIBC_LOG_DIR) $(STAGING_DIR)/lib/libc.a @@ -77,3 +87,27 @@ @ echo "Package: uclibc" @ echo "Source: $(UCLIBC_URL)/$(UCLIBC_SOURCE)" @ echo "" + +uclibc-extract: $(UCLIBC_STAMP_DIR)/.unpacked + +uclibc-config: $(UCLIBC_STAMP_DIR)/.unpacked +ifeq ($(shell if [ -f $(PACKAGE_DIR)/uclibc/conf/customconfig--$(PAYLOAD)--$(UCLIBC_ARCH)--$(COREBOOT_VENDOR)-$(COREBOOT_BOARD) ]; then echo 1; fi),1) + @ cp -f $(PACKAGE_DIR)/uclibc/conf/customconfig--$(PAYLOAD)--$(UCLIBC_ARCH)--$(COREBOOT_VENDOR)-$(COREBOOT_BOARD) $(UCLIBC_SRC_DIR)/.config +endif +ifeq (uclibc,$(filter uclibc,$(PAYLOAD-y))) + @ echo "Configure uclibc..." + @ $(MAKE) -C $(UCLIBC_SRC_DIR) TARGET_ARCH="$(UCLIBC_ARCH)" menuconfig + @ echo +ifeq ($(shell if [ -f $(PACKAGE_DIR)/uclibc/conf/customconfig--$(PAYLOAD)--$(UCLIBC_ARCH)--$(COREBOOT_VENDOR)-$(COREBOOT_BOARD) ]; then echo 1; fi),1) + @ echo "Found an existing custom configuration file:" + @ echo " $(PACKAGE_DIR)/uclibc/conf/customconfig--$(PAYLOAD)--$(UCLIBC_ARCH)--$(COREBOOT_VENDOR)-$(COREBOOT_BOARD)" + @ echo "I've copied it back to the source directory for modification." + @ echo "Remove the above file and re-run this command if you want to create a new custom configuration from scratch for this payload/board." + @ echo +endif + @ cp -f $(UCLIBC_SRC_DIR)/.config $(PACKAGE_DIR)/uclibc/conf/customconfig--$(PAYLOAD)--$(UCLIBC_ARCH)--$(COREBOOT_VENDOR)-$(COREBOOT_BOARD) + @ echo "Your custom uclibc config file has been saved as $(PACKAGE_DIR)/uclibc/conf/customconfig--$(PAYLOAD)--$(UCLIBC_ARCH)--$(COREBOOT_VENDOR)-$(COREBOOT_BOARD)." + @ echo +else + @ echo "Your payload does not require uclibc." +endif
Modified: buildrom-devel/packages/unifdef/unifdef.mk =================================================================== --- buildrom-devel/packages/unifdef/unifdef.mk 2008-02-07 15:54:34 UTC (rev 108) +++ buildrom-devel/packages/unifdef/unifdef.mk 2008-02-07 17:41:01 UTC (rev 109) @@ -17,7 +17,7 @@ @ mkdir -p $(SOURCE_DIR) @ wget -P $(SOURCE_DIR) $(UNIFDEF_URL)/$(UNIFDEF_SOURCE)
-$(UNIFDEF_STAMP_DIR)/.unpacked: $(SOURCE_DIR)/$(UNIFDEF_SOURCE) +$(UNIFDEF_STAMP_DIR)/.unpacked: $(SOURCE_DIR)/$(UNIFDEF_SOURCE) | $(UNIFDEF_STAMP_DIR) @ tar -C $(UNIFDEF_DIR) -zxf $(SOURCE_DIR)/$(UNIFDEF_SOURCE) @ rm -f $(UNIFDEF_SRC_DIR)/unifdef @ rm -f $(UNIFDEF_SRC_DIR)/unifdef.o @@ -49,3 +49,5 @@ echo ""
.PHONY: unifdef + +unifdef-extract: $(UNIFDEF_STAMP_DIR)/.unpacked