From 9674d0a66f1eaa9822897edded756eb87b4827be Mon Sep 17 00:00:00 2001 From: Daniel Golle Date: Fri, 23 Apr 2021 23:05:54 +0100 Subject: [PATCH] image: introduce 'append-image-stage' build command Similar to 'append-image' this new command appends an existing binary. 'append-image-stage' also makes a copy of that binary and keeps it in $(STAGING_DIR_IMAGE). When called from within the ImageBuilder, this copy is used instead of expecting the binary to be present. This is useful for artifacts which include the initramfs/recovery image which is usually not included in the ImageBuilder. Signed-off-by: Daniel Golle (cherry picked from commit de4b29dab987c5c1288558c3ca7e1edcd95920e0) --- include/image-commands.mk | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/include/image-commands.mk b/include/image-commands.mk index a931b988d9..a3363ca22a 100644 --- a/include/image-commands.mk +++ b/include/image-commands.mk @@ -15,6 +15,18 @@ define Build/append-image dd if=$(BIN_DIR)/$(DEVICE_IMG_PREFIX)-$(1) >> $@ endef +ifdef IB +define Build/append-image-stage + dd if=$(STAGING_DIR_IMAGE)/$(DEVICE_IMG_PREFIX)-$(1) >> $@ +endef +else +define Build/append-image-stage + dd if=$(BIN_DIR)/$(DEVICE_IMG_PREFIX)-$(1) of=$(STAGING_DIR_IMAGE)/$(DEVICE_IMG_PREFIX)-$(1) + dd if=$(BIN_DIR)/$(DEVICE_IMG_PREFIX)-$(1) >> $@ +endef +endif + + define Build/buffalo-enc $(eval product=$(word 1,$(1))) $(eval version=$(word 2,$(1)))