From e333999ecf9dfee2b1c3da22b776eade671d0a4a Mon Sep 17 00:00:00 2001 From: Sungbo Eo Date: Sun, 5 Dec 2021 02:08:48 +0900 Subject: [PATCH] build: image: improve zip build recipe * clean before build * specify executable path * allow adding extra options for zip * use basename of $@ Signed-off-by: Sungbo Eo (cherry picked from commit 446da706690a239dc7a454102db0b0a3b3a9d1ed) --- include/image-commands.mk | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/include/image-commands.mk b/include/image-commands.mk index e20c303b71..08a9b786a1 100644 --- a/include/image-commands.mk +++ b/include/image-commands.mk @@ -180,11 +180,13 @@ define Build/gzip endef define Build/zip + rm -rf $@.tmp mkdir $@.tmp - mv $@ $@.tmp/$(1) + mv $@ $@.tmp/$(word 1,$(1)) - TZ=UTC zip -j -X \ - $@ $@.tmp/$(if $(1),$(1),$@) + TZ=UTC $(STAGING_DIR_HOST)/bin/zip -j -X \ + $(wordlist 2,$(words $(1)),$(1)) \ + $@ $@.tmp/$(if $(word 1,$(1)),$(word 1,$(1)),$$(basename $@)) rm -rf $@.tmp endef