diff options
author | Felix Fietkau <nbd@openwrt.org> | 2015-01-10 15:26:53 +0000 |
---|---|---|
committer | Felix Fietkau <nbd@openwrt.org> | 2015-01-10 15:26:53 +0000 |
commit | 6ee18aa54e9fa3a0df4c3ae31e774af4b3b770da (patch) | |
tree | 2bd62705262d7f8e5a85a05ccf82dd4c4708e3f7 /include | |
parent | 0565d88e3b04993f966c87b91b8b08e9efda2fe3 (diff) | |
download | upstream-6ee18aa54e9fa3a0df4c3ae31e774af4b3b770da.tar.gz upstream-6ee18aa54e9fa3a0df4c3ae31e774af4b3b770da.tar.bz2 upstream-6ee18aa54e9fa3a0df4c3ae31e774af4b3b770da.zip |
ramips: convert mt7621 images to new image building code
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@43908 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'include')
-rw-r--r-- | include/image.mk | 37 |
1 files changed, 24 insertions, 13 deletions
diff --git a/include/image.mk b/include/image.mk index cdb1e48540..e64020132f 100644 --- a/include/image.mk +++ b/include/image.mk @@ -322,31 +322,36 @@ define Device/Init KERNEL_SIZE:= CMDLINE:= - IMAGE_PREFIX := $(BIN_DIR)/$(IMG_PREFIX)-$(1) + IMAGE_PREFIX := $(IMG_PREFIX)-$(1) IMAGE_NAME = $$(IMAGE_PREFIX)-$$(1)-$$(2) - KERNEL_PREFIX = $$(if $$(KERNEL_INSTALL),$$(IMAGE_PREFIX),$(KDIR)/$(1)) - KERNEL_INITRAMFS_PREFIX = $$(IMAGE_PREFIX)-initramfs + KERNEL_PREFIX = $(1) KERNEL_SUFFIX := -kernel.bin KERNEL_IMAGE = $$(KERNEL_PREFIX)$$(KERNEL_SUFFIX) + KERNEL_INITRAMFS_PREFIX = $$(IMAGE_PREFIX)-initramfs + KERNEL_INITRAMFS_IMAGE = $$(KERNEL_INITRAMFS_PREFIX)$$(KERNEL_SUFFIX) KERNEL_INSTALL := KERNEL_SIZE := FILESYSTEMS := $(TARGET_FILESYSTEMS) +endef + +define Device/ExportVar + $(1) : $(2):=$$($(2)) - BIN_KERNEL_IMAGE = $$(patsubst $$(KERNEL_PREFIX)%,$$(IMAGE_PREFIX)%,$$(KERNEL_IMAGE)) endef +Device/Export = $(foreach var,$(DEVICE_VARS) KERNEL,$(call Device/ExportVar,$(1),$(var))) define Device/Check _TARGET = $$(if $$(filter $(PROFILE),$$(PROFILES)),install,install-disabled) endef define Device/Build/initramfs - $$(_TARGET): $$(KERNEL_INITRAMFS_PREFIX)$$(KERNEL_SUFFIX) + $$(_TARGET): $(BIN_DIR)/$$(KERNEL_INITRAMFS_IMAGE) - $$(KERNEL_INITRAMFS_PREFIX)$$(KERNEL_SUFFIX): $$(KERNEL_PREFIX)-initramfs$$(KERNEL_SUFFIX) + $(BIN_DIR)/$$(KERNEL_INITRAMFS_IMAGE): $(KDIR)/$$(KERNEL_INITRAMFS_IMAGE) cp $$^ $$@ - $$(KERNEL_PREFIX)-initramfs$$(KERNEL_SUFFIX): $(KDIR)/vmlinux-initramfs + $(KDIR)/$$(KERNEL_INITRAMFS_IMAGE): $(KDIR)/vmlinux-initramfs @rm -f $$@ $$(call concat_cmd,$$(KERNEL_INITRAMFS)) endef @@ -359,22 +364,28 @@ define Device/Build/check_size endef define Device/Build/kernel - $$(_TARGET): $$(if $$(KERNEL_INSTALL),$$(BIN_KERNEL_IMAGE)) - $$(BIN_KERNEL_IMAGE): $$(KERNEL_IMAGE) + $$(_TARGET): $$(if $$(KERNEL_INSTALL),$(BIN_DIR)/$$(KERNEL_IMAGE)) + $(BIN_DIR)/$$(KERNEL_IMAGE): $(KDIR)/$$(KERNEL_IMAGE) cp $$^ $$@ - $$(KERNEL_IMAGE): $(KDIR)/vmlinux + $(KDIR)/$$(KERNEL_IMAGE): $(KDIR)/vmlinux @rm -f $$@ $$(call concat_cmd,$$(KERNEL)) $$(if $$(KERNEL_SIZE),$$(call Device/Build/check_size,$$(KERNEL_SIZE))) endef define Device/Build/image - $$(_TARGET): $(call IMAGE_NAME,$(1),$(2)) - $(call IMAGE_NAME,$(1),$(2)): $$(KERNEL_IMAGE) $(KDIR)/root.$(1) + $$(_TARGET): $(BIN_DIR)/$(call IMAGE_NAME,$(1),$(2)) + $(eval $(call Device/Export,$(KDIR)/$(KERNEL_IMAGE))) + $(eval $(call Device/Export,$(KDIR)/$(KERNEL_INITRAMFS_IMAGE))) + $(eval $(call Device/Export,$(KDIR)/$(call IMAGE_NAME,$(1),$(2)))) + $(KDIR)/$(call IMAGE_NAME,$(1),$(2)): $(KDIR)/$$(KERNEL_IMAGE) $(KDIR)/root.$(1) @rm -f $$@ [ -f $$(word 1,$$^) -a -f $$(word 2,$$^) ] $$(call concat_cmd,$(if $(IMAGE/$(2)/$(1)),$(IMAGE/$(2)/$(1)),$(IMAGE/$(2)))) + $(BIN_DIR)/$(call IMAGE_NAME,$(1),$(2)): $(KDIR)/$(call IMAGE_NAME,$(1),$(2)) + cp $$^ $$@ + endef define Device/Build @@ -383,7 +394,7 @@ define Device/Build $$(eval $$(foreach image,$$(IMAGES), \ $$(foreach fs,$$(filter $(TARGET_FILESYSTEMS),$$(FILESYSTEMS)), \ - $$(call Device/Build/image,$$(fs),$$(image))))) + $$(call Device/Build/image,$$(fs),$$(image),$(1))))) endef define Device |