[PATCH] buildrom:  Add a 'source' target

Add a source target that will download all of the packages needed for
the current configuration - this is important for GPL compliance, but
also because one doesn't always have access to the intertubes while
building.  Source will be extracted into the usual location in
source/

Signed-off-by: Jordan Crouse <jordan@cosmicpenguin.net>
Index: buildrom-devel/Makefile
===================================================================
--- buildrom-devel.orig/Makefile	2008-12-02 09:21:01.000000000 -0700
+++ buildrom-devel/Makefile	2008-12-02 09:21:11.000000000 -0700
@@ -101,6 +101,7 @@
 PKG_clean=$(patsubst %, %-clean, $(PKGLIST))
 PKG_distclean=$(patsubst %, %-distclean, $(PKGLIST))
 PKG_extract=$(patsubst %, %-extract, $(PKGLIST))
+PKG_source=$(patsubst %, %-source, $(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
@@ -136,6 +137,7 @@
 payload: $(DEPENDS-y) $(PAYLOAD_TARGET)
 
 extract: $(PKG_extract)
+source: $(PKG_source)
 
 clean: $(PKG_clean)
 	@ rm -rf $(INITRD_DIR) $(OUTPUT_DIR)
Index: buildrom-devel/packages/busybox/busybox.mk
===================================================================
--- buildrom-devel.orig/packages/busybox/busybox.mk	2008-12-02 09:21:00.000000000 -0700
+++ buildrom-devel/packages/busybox/busybox.mk	2008-12-02 09:21:11.000000000 -0700
@@ -79,6 +79,7 @@
 	@ echo ""
 
 busybox-extract: $(BUSYBOX_STAMP_DIR)/.patched
+busybox-source: $(SOURCE_DIR)/$(BUSYBOX_SOURCE)
 
 busybox-config: | $(BUSYBOX_SRC_DIR)/.config
 ifeq ($(shell if [ -f $(PACKAGE_DIR)/busybox/conf/customconfig--$(PAYLOAD)--$(COREBOOT_VENDOR)-$(COREBOOT_BOARD) ]; then echo 1; fi),1)
Index: buildrom-devel/packages/coreboot-v2/coreboot.inc
===================================================================
--- buildrom-devel.orig/packages/coreboot-v2/coreboot.inc	2008-12-02 09:21:00.000000000 -0700
+++ buildrom-devel/packages/coreboot-v2/coreboot.inc	2008-12-02 09:21:11.000000000 -0700
@@ -157,6 +157,7 @@
 
 generic-coreboot: $(OUTPUT_DIR)/$(TARGET_ROM)
 
+generic-coreboot-source: $(SOURCE_DIR)/$(CBV2_TARBALL)
 generic-coreboot-clean:
 	@ echo "Cleaning coreboot..."
 	@ rm -f $(CBV2_STAMP_DIR)/.configured*
Index: buildrom-devel/packages/coreboot-v2/dbm690t.mk
===================================================================
--- buildrom-devel.orig/packages/coreboot-v2/dbm690t.mk	2008-12-02 09:21:00.000000000 -0700
+++ buildrom-devel/packages/coreboot-v2/dbm690t.mk	2008-12-02 09:21:11.000000000 -0700
@@ -20,3 +20,4 @@
 coreboot: generic-coreboot
 coreboot-clean: generic-coreboot-clean
 coreboot-distclean: generic-coreboot-distclean
+coreboot-source: generic-coreboot-source
Index: buildrom-devel/packages/coreboot-v2/ga-2761gxdk.mk
===================================================================
--- buildrom-devel.orig/packages/coreboot-v2/ga-2761gxdk.mk	2008-12-02 09:21:00.000000000 -0700
+++ buildrom-devel/packages/coreboot-v2/ga-2761gxdk.mk	2008-12-02 09:21:11.000000000 -0700
@@ -11,3 +11,4 @@
 coreboot: generic-coreboot
 coreboot-clean: generic-coreboot-clean
 coreboot-distclean: generic-coreboot-distclean
+coreboot-source: generic-coreboot-source
Index: buildrom-devel/packages/coreboot-v2/generic.mk
===================================================================
--- buildrom-devel.orig/packages/coreboot-v2/generic.mk	2008-12-02 09:21:00.000000000 -0700
+++ buildrom-devel/packages/coreboot-v2/generic.mk	2008-12-02 09:21:11.000000000 -0700
@@ -5,3 +5,4 @@
 coreboot: generic-coreboot
 coreboot-clean: generic-coreboot-clean
 coreboot-distclean: generic-coreboot-distclean
+coreboot-source: generic-coreboot-source
Index: buildrom-devel/packages/coreboot-v2/geodelx.mk
===================================================================
--- buildrom-devel.orig/packages/coreboot-v2/geodelx.mk	2008-12-02 09:21:00.000000000 -0700
+++ buildrom-devel/packages/coreboot-v2/geodelx.mk	2008-12-02 09:21:11.000000000 -0700
@@ -7,3 +7,4 @@
 coreboot: geodevsa generic-coreboot
 coreboot-clean: geodevsa-clean generic-coreboot-clean
 coreboot-distclean: geodevsa-distclean generic-coreboot-distclean
+coreboot-source: geodevsa-source generic-coreboot-source
Index: buildrom-devel/packages/coreboot-v2/serengeti_cheetah.mk
===================================================================
--- buildrom-devel.orig/packages/coreboot-v2/serengeti_cheetah.mk	2008-12-02 09:21:00.000000000 -0700
+++ buildrom-devel/packages/coreboot-v2/serengeti_cheetah.mk	2008-12-02 09:21:11.000000000 -0700
@@ -20,3 +20,5 @@
 coreboot: generic-coreboot
 coreboot-clean: generic-coreboot-clean
 coreboot-distclean: generic-coreboot-distclean
+coreboot-source: generic-coreboot-source
+
Index: buildrom-devel/packages/coreboot-v3/coreboot-v3.mk
===================================================================
--- buildrom-devel.orig/packages/coreboot-v3/coreboot-v3.mk	2008-12-02 09:21:00.000000000 -0700
+++ buildrom-devel/packages/coreboot-v3/coreboot-v3.mk	2008-12-02 09:21:11.000000000 -0700
@@ -97,6 +97,8 @@
 
 coreboot-v3: $(CBV3_LOG_DIR) $(CBV3_STAMP_DIR) $(CBV3_OUTPUT) $(STAGING_DIR)/bin/lar
 
+coreboot-v3-source: $(SOURCE_DIR)/$(CBV3_TARBALL)
+
 coreboot-v3-clean:
 	@ echo "Cleaning coreboot v3..."
 	@ rm -f $(CBV3_STAMP_DIR)/.configured
Index: buildrom-devel/packages/coreinfo/coreinfo.mk
===================================================================
--- buildrom-devel.orig/packages/coreinfo/coreinfo.mk	2008-12-02 09:21:00.000000000 -0700
+++ buildrom-devel/packages/coreinfo/coreinfo.mk	2008-12-02 09:21:11.000000000 -0700
@@ -52,6 +52,8 @@
 
 coreinfo: $(COREINFO_STAMP_DIR) $(COREINFO_LOG_DIR) $(COREINFO_STAMP_DIR)/.copied
 
+coreinfo-source: $(SOURCE_DIR)/$(COREINFO_TARBALL)
+
 coreinfo-clean:
 	@ echo "Cleaning coreinfo..."
 	@ rm -f $(COREINFO_STAMP_DIR)/.installed
Index: buildrom-devel/packages/etherboot/etherboot.mk
===================================================================
--- buildrom-devel.orig/packages/etherboot/etherboot.mk	2008-12-02 09:21:00.000000000 -0700
+++ buildrom-devel/packages/etherboot/etherboot.mk	2008-12-02 09:21:11.000000000 -0700
@@ -55,6 +55,7 @@
 	@ mkdir -p $(OUTPUT_DIR)
 	@ cp $(ETHERBOOT_OUTPUT) $(PAYLOAD_ELF)
 
+etherboot-source: $(SOURCE_DIR)/$(ETHERBOOT_SOURCE)
 etherboot-clean:
 	@ echo "Cleaning etherboot..."
 	@ rm -f $(ETHERBOOT_STAMP_DIR)/.configured
Index: buildrom-devel/packages/filo/filo.mk
===================================================================
--- buildrom-devel.orig/packages/filo/filo.mk	2008-12-02 09:21:00.000000000 -0700
+++ buildrom-devel/packages/filo/filo.mk	2008-12-02 09:21:11.000000000 -0700
@@ -64,6 +64,7 @@
 
 filo: $(FILO_STAMP_DIR) $(FILO_LOG_DIR) $(FILO_STAMP_DIR)/.copied
 
+
 filo-clean:
 	@ echo "Cleaning filo..."
 	@ rm -f $(FILO_STAMP_DIR)/.configured
@@ -76,6 +77,7 @@
 	@ rm -rf $(FILO_DIR)/*
 
 filo-extract: $(FILO_STAMP_DIR)/.patched
+filo-source: $(SOURCE_DIR)/$(FILO_TARBALL)
 
 filo-config: | $(FILO_STAMP_DIR)/.configured
 ifeq ($(shell if [ -f $(PACKAGE_DIR)/filo/conf/customconfig--$(PAYLOAD)--$(COREBOOT_VENDOR)-$(COREBOOT_BOARD) ]; then echo 1; fi),1)
Index: buildrom-devel/packages/geodevsa/amdvsa.inc
===================================================================
--- buildrom-devel.orig/packages/geodevsa/amdvsa.inc	2008-12-02 09:21:00.000000000 -0700
+++ buildrom-devel/packages/geodevsa/amdvsa.inc	2008-12-02 09:21:11.000000000 -0700
@@ -20,3 +20,5 @@
 $(GEODE_UNCOMPRESSED_VSA): $(SOURCE_DIR)/$(AMDVSA_BIN)
 	@ mkdir -p $(shell dirname $(GEODE_UNCOMPRESSED_VSA))
 	@ cp $< $@
+
+geodevsa-source: $(SOURCE_DIR)/$(AMDVSA_BIN)
Index: buildrom-devel/packages/geodevsa/openvsa.inc
===================================================================
--- buildrom-devel.orig/packages/geodevsa/openvsa.inc	2008-12-02 09:21:00.000000000 -0700
+++ buildrom-devel/packages/geodevsa/openvsa.inc	2008-12-02 09:21:11.000000000 -0700
@@ -51,3 +51,4 @@
 openvsa-distclean:
 	@ rm -rf $(OPENVSA_DIR)
 
+geodevsa-source: $(SOURCE_DIR)/$(OPENVSA_TARBALL)
Index: buildrom-devel/packages/gpxe/gpxe.mk
===================================================================
--- buildrom-devel.orig/packages/gpxe/gpxe.mk	2008-12-02 09:21:00.000000000 -0700
+++ buildrom-devel/packages/gpxe/gpxe.mk	2008-12-02 09:21:11.000000000 -0700
@@ -64,6 +64,7 @@
 	@ mkdir -p $(OUTPUT_DIR)
 	@ cp $(GPXE_OUTPUT) $(PAYLOAD_ELF)
 
+gpxe-source: $(SOURCE_DIR)/$(GPXE_SOURCE)
 gpxe-clean:
 	@ echo "Cleaning GPXE..."
 	@ rm -f $(GPXE_STAMP_DIR)/.configured
Index: buildrom-devel/packages/grub2/grub2.mk
===================================================================
--- buildrom-devel.orig/packages/grub2/grub2.mk	2008-12-02 09:21:05.000000000 -0700
+++ buildrom-devel/packages/grub2/grub2.mk	2008-12-02 09:21:11.000000000 -0700
@@ -77,6 +77,8 @@
 
 grub2: $(GRUB2_STAMP_DIR) $(GRUB2_LOG_DIR) $(GRUB2_STAMP_DIR)/.copied
 
+grub2-source: $(SOURCE_DIR)/$(GRUB2_TAR)
+
 grub2-clean:
 	@ echo "Cleaning grub2..."
 	@ rm -f $(GRUB2_DIR)/grub2.elf
Index: buildrom-devel/packages/kexec-tools/kexec-tools.mk
===================================================================
--- buildrom-devel.orig/packages/kexec-tools/kexec-tools.mk	2008-12-02 09:21:00.000000000 -0700
+++ buildrom-devel/packages/kexec-tools/kexec-tools.mk	2008-12-02 09:21:11.000000000 -0700
@@ -31,6 +31,8 @@
 
 kexec-tools: $(KEXEC_STAMP_DIR) $(INITRD_DIR)/sbin/kexec-tools
 
+kexec-tools-source: $(KEXEC_SOURCE)
+
 kexec-tools-clean:
 	@ rm -f $(KEXEC_STAMP_DIR)/.configured 
 ifneq ($(wildcard $(KEXEC_SRC_DIR)/Makefile),)
Index: buildrom-devel/packages/libpayload/libpayload.mk
===================================================================
--- buildrom-devel.orig/packages/libpayload/libpayload.mk	2008-12-02 09:21:00.000000000 -0700
+++ buildrom-devel/packages/libpayload/libpayload.mk	2008-12-02 09:21:11.000000000 -0700
@@ -74,6 +74,7 @@
 	@ rm -rf $(LIBPAYLOAD_DIR)/*
 
 libpayload-extract: $(LIBPAYLOAD_STAMP_DIR)/.patched
+libpayload-source: $(SOURCE_DIR)/$(LIBPAYLOAD_TARBALL)
 
 libpayload-config: | $(LIBPAYLOAD_SRC_DIR)/.config
 ifeq ($(call custom-config-exists,libpayload), 1)
Index: buildrom-devel/packages/lzma/lzma.mk
===================================================================
--- buildrom-devel.orig/packages/lzma/lzma.mk	2008-12-02 09:21:00.000000000 -0700
+++ buildrom-devel/packages/lzma/lzma.mk	2008-12-02 09:21:11.000000000 -0700
@@ -48,4 +48,4 @@
 	@ rm -rf $(LZMA_DIR)/*
 
 lzma-extract: $(LZMA_STAMP_DIR)/.unpacked
-
+lzma-source: $($(SOURCE_DIR)/$(LZMA_SOURCE)
Index: buildrom-devel/packages/memtest/memtest.mk
===================================================================
--- buildrom-devel.orig/packages/memtest/memtest.mk	2008-12-02 09:21:00.000000000 -0700
+++ buildrom-devel/packages/memtest/memtest.mk	2008-12-02 09:21:11.000000000 -0700
@@ -54,3 +54,5 @@
 
 memtest-distclean:
 	@ rm -rf $(MEMTEST_DIR)/*
+
+memtest-source: $(SOURCE_DIR)/$(MEMTEST_SOURCE)
Index: buildrom-devel/packages/mkelfimage/mkelfimage.mk
===================================================================
--- buildrom-devel.orig/packages/mkelfimage/mkelfimage.mk	2008-12-02 09:21:00.000000000 -0700
+++ buildrom-devel/packages/mkelfimage/mkelfimage.mk	2008-12-02 09:21:11.000000000 -0700
@@ -70,4 +70,4 @@
 	echo ""
 
 mkelfimage-extract: $(MKELFIMAGE_STAMP_DIR)/.patched
-
+mkelfimage-source: $($(SOURCE_DIR)/$(MKELFIMAGE_TARBALL)
Index: buildrom-devel/packages/nrv2b/nrv2b.mk
===================================================================
--- buildrom-devel.orig/packages/nrv2b/nrv2b.mk	2008-12-02 09:21:00.000000000 -0700
+++ buildrom-devel/packages/nrv2b/nrv2b.mk	2008-12-02 09:21:11.000000000 -0700
@@ -47,3 +47,4 @@
 nrv2b-distclean:
 	@ rm -rf $(NRV2B_DIR)
 
+nrv2b-source: $(SOURCE_DIR)/$(NRV2B_TARBALL)
Index: buildrom-devel/packages/ofw/ofw.mk
===================================================================
--- buildrom-devel.orig/packages/ofw/ofw.mk	2008-12-02 09:21:00.000000000 -0700
+++ buildrom-devel/packages/ofw/ofw.mk	2008-12-02 09:21:11.000000000 -0700
@@ -62,3 +62,4 @@
 ofw-distclean:
 	@ rm -rf $(OFW_DIR)/*
 
+ofw-source: $(SOURCE_DIR)/$(OFW_TARBALL)
Index: buildrom-devel/packages/openbios/openbios.mk
===================================================================
--- buildrom-devel.orig/packages/openbios/openbios.mk	2008-12-02 09:21:00.000000000 -0700
+++ buildrom-devel/packages/openbios/openbios.mk	2008-12-02 09:21:11.000000000 -0700
@@ -73,3 +73,4 @@
 openbios-distclean:
 	@ rm -rf $(OPENBIOS_DIR)/*
 
+openbios-source: $(SOURCE_DIR)/$(OPENBIOS_TARBALL)
Index: buildrom-devel/packages/qemu/qemu.mk
===================================================================
--- buildrom-devel.orig/packages/qemu/qemu.mk	2008-12-02 09:21:00.000000000 -0700
+++ buildrom-devel/packages/qemu/qemu.mk	2008-12-02 09:21:11.000000000 -0700
@@ -57,3 +57,5 @@
 	echo "Package: qemu"
 	echo "Source: $(QEMU_URL)/$(QEMU_SOURCE)"
 	echo ""
+
+qemu-source: $(SOURCE_DIR)/$(QEMU_SOURCE)
Index: buildrom-devel/packages/seabios/seabios.mk
===================================================================
--- buildrom-devel.orig/packages/seabios/seabios.mk	2008-12-02 09:21:00.000000000 -0700
+++ buildrom-devel/packages/seabios/seabios.mk	2008-12-02 09:21:11.000000000 -0700
@@ -62,3 +62,4 @@
 seabios-distclean:
 	@ rm -rf $(SEABIOS_DIR)/*
 
+seabios-source: $(SOURCE_DIR)/$(SEABIOS_TARBALL)
Index: buildrom-devel/packages/tint/tint.mk
===================================================================
--- buildrom-devel.orig/packages/tint/tint.mk	2008-12-02 09:21:00.000000000 -0700
+++ buildrom-devel/packages/tint/tint.mk	2008-12-02 09:21:11.000000000 -0700
@@ -53,3 +53,5 @@
 
 tint-distclean:
 	@ rm -rf $(TINT_DIR)
+
+tint-source: $(SOURCE_DIR)/$(TINT_TARBALL)
Index: buildrom-devel/packages/uclibc/uclibc.mk
===================================================================
--- buildrom-devel.orig/packages/uclibc/uclibc.mk	2008-12-02 09:21:01.000000000 -0700
+++ buildrom-devel/packages/uclibc/uclibc.mk	2008-12-02 09:21:11.000000000 -0700
@@ -93,6 +93,7 @@
 	@ echo ""
 
 uclibc-extract: $(UCLIBC_STAMP_DIR)/.unpacked
+uclibc-source: $(SOURCE_DIR)/$(UCLIBC_SOURCE)
 
 uclibc-config: | $(UCLIBC_SRC_DIR)/.config
 ifeq ($(shell if [ -f $(PACKAGE_DIR)/uclibc/conf/customconfig--$(PAYLOAD)--$(UCLIBC_ARCH)--$(COREBOOT_VENDOR)-$(COREBOOT_BOARD) ]; then echo 1; fi),1)
@@ -115,3 +116,4 @@
 else
 	@ echo "Your payload does not require uclibc."
 endif
+
