From bc7c4c70606c5c10aa803768fb19f70eef98241e Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Wed, 13 Feb 2013 08:38:14 +0100 Subject: [PATCH] Create package index and do other image preparations just once --- Makefile | 5 ++--- builder/Makefile | 21 +++++++++------------ builder/Makefile.image | 7 +++++++ 3 files changed, 18 insertions(+), 15 deletions(-) create mode 100644 builder/Makefile.image diff --git a/Makefile b/Makefile index 4f63ea52..cd8d08a2 100644 --- a/Makefile +++ b/Makefile @@ -41,9 +41,8 @@ prepare: $(GLUON_OPENWRTDIR)/scripts/feeds install -a echo -e "CONFIG_TARGET_$(BOARD)=y\nCONFIG_TARGET_ROOTFS_JFFS2=n\n$(subst ${ },\n,$(patsubst %,CONFIG_PACKAGE_%=m,$(GLUON_PACKAGES) $(PROFILE_PACKAGES)))" > $(GLUON_OPENWRTDIR)/.config - $(MAKE) -C $(GLUON_OPENWRTDIR) defconfig prepare - $(MAKE) -C $(GLUON_BUILDERDIR) kernel - $(MAKE) -C $(GLUON_OPENWRTDIR) package/compile + $(MAKE) -C $(GLUON_OPENWRTDIR) defconfig prepare package/compile + $(MAKE) -C $(GLUON_BUILDERDIR) prepare touch $(prepared_stamp) diff --git a/builder/Makefile b/builder/Makefile index 6074ba05..f3c48a0d 100644 --- a/builder/Makefile +++ b/builder/Makefile @@ -71,22 +71,18 @@ PACKAGES:= include $(INCLUDE_DIR)/kernel-build.mk -kernel: FORCE +prepare: FORCE $(Kernel/CompileImage) + $(MAKE) -C $(TOPDIR)/target/linux/$(BOARD)/image -f $(GLUON_BUILDERDIR)/Makefile.image prepare + $(MAKE) package_index _call_image: echo 'Building images for $(BOARD)$(if $($(USER_PROFILE)_NAME), - $($(USER_PROFILE)_NAME))' echo 'Packages: $(BUILD_PACKAGES)' echo rm -rf $(TARGET_DIR) - mkdir -p $(TARGET_DIR) $(BIN_DIR) $(TMP_DIR) - if [ ! -f "$(PACKAGE_DIR)/Packages" ] || [ ! -f "$(PACKAGE_DIR)/Packages.gz" ] || [ "`find $(PACKAGE_DIR) -cnewer $(PACKAGE_DIR)/Packages.gz`" ]; then \ - echo "Package list missing or not up-to-date, generating it.";\ - $(MAKE) package_index; \ - else \ - mkdir -p $(TARGET_DIR)/tmp; \ - $(OPKG) update; \ - fi + mkdir -p $(TARGET_DIR) $(BIN_DIR) $(TMP_DIR) $(TARGET_DIR)/tmp + $(OPKG) update $(MAKE) package_install ifneq ($(USER_FILES),) $(MAKE) copy_files @@ -97,11 +93,9 @@ endif package_index: FORCE @echo @echo Building package index... - @mkdir -p $(TOPDIR)/tmp $(TOPDIR)/dl $(TARGET_DIR)/tmp (cd $(PACKAGE_DIR); $(SCRIPT_DIR)/ipkg-make-index.sh . > Packages && \ gzip -9c Packages > Packages.gz \ ) >/dev/null 2>/dev/null - $(OPKG) update package_install: FORCE @echo @@ -139,10 +133,13 @@ package_postinst: FORCE ) $(if $(CONFIG_CLEAN_IPKG),rm -rf $(TARGET_DIR)/usr/lib/opkg) +include $(INCLUDE_DIR)/image.mk + build_image: FORCE @echo @echo Building images... - $(NO_TRACE_MAKE) -C $(TOPDIR)/target/linux/$(BOARD)/image install TARGET_BUILD=1 IMG_PREFIX="gluon-$(BOARD)$(if $(SUBTARGET),-$(SUBTARGET))" \ + $(call Image/mkfs/prepare) + $(NO_TRACE_MAKE) -C $(TOPDIR)/target/linux/$(BOARD)/image install TARGET_BUILD=1 IB=1 IMG_PREFIX="gluon-$(BOARD)$(if $(SUBTARGET),-$(SUBTARGET))" \ $(if $(USER_PROFILE),PROFILE="$(USER_PROFILE)") image: diff --git a/builder/Makefile.image b/builder/Makefile.image new file mode 100644 index 00000000..eb110339 --- /dev/null +++ b/builder/Makefile.image @@ -0,0 +1,7 @@ +override BuildImage := + +# The Makefile included here is $(TOPDIR)/target/linux/$(BOARD)/image/Makefile +include Makefile + +prepare: FORCE + $(call Image/Prepare)