aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMathias Kresin <dev@kresin.me>2019-01-25 21:39:49 +0100
committerMathias Kresin <dev@kresin.me>2019-01-26 15:23:36 +0100
commit6491643df4595262fbb2387327a01e16523b58ba (patch)
treebd6ca924606fe2b9063c6b2a4dcf7d244cd66c45
parent0ffa6bae0af0057000bdc3f57603f0a8b539855e (diff)
downloadupstream-6491643df4595262fbb2387327a01e16523b58ba.tar.gz
upstream-6491643df4595262fbb2387327a01e16523b58ba.tar.bz2
upstream-6491643df4595262fbb2387327a01e16523b58ba.zip
gemini: build images in temporary directories
Create files in temporary directories within the build directory instead manipulating files in the (final) output directory. Signed-off-by: Mathias Kresin <dev@kresin.me>
-rw-r--r--target/linux/gemini/image/Makefile24
1 files changed, 13 insertions, 11 deletions
diff --git a/target/linux/gemini/image/Makefile b/target/linux/gemini/image/Makefile
index f3086dee78..c08ea5d5eb 100644
--- a/target/linux/gemini/image/Makefile
+++ b/target/linux/gemini/image/Makefile
@@ -27,18 +27,20 @@ endef
# to satisfy the boot loader on the device. The zImage is
# the only real content.
define Build/dns313-images
- if [ -d $(BIN_DIR)/.boot ] ; then rm -rf $(BIN_DIR)/.boot ; fi
- mkdir -p $(BIN_DIR)/.boot
- echo "dummy" > $(BIN_DIR)/.boot/dummyfile
- dns313-header $(BIN_DIR)/.boot/dummyfile \
- $(BIN_DIR)/.boot/rootfs.tgz
- dns313-header $(BIN_DIR)/.boot/dummyfile \
- $(BIN_DIR)/.boot/rd.gz
+ mkdir -p $@.tmp/.boot
+
+ echo "dummy" > $@.tmp/dummyfile
+
+ dns313-header $@.tmp/dummyfile \
+ $@.tmp/.boot/rootfs.tgz
+ dns313-header $@.tmp/dummyfile \
+ $@.tmp/.boot/rd.gz
dns313-header $(IMAGE_KERNEL) \
- $(BIN_DIR)/.boot/zImage
- rm -f $(BIN_DIR)/.boot/dummyfile
- (cd $(BIN_DIR); tar -czf $@ .boot)
- if [ -d $(BIN_DIR)/.boot ] ; then rm -rf $(BIN_DIR)/.boot ; fi
+ $@.tmp/.boot/zImage
+
+ tar -czf $@ -C @.tmp .boot
+
+ rm -rf $@.tmp
endef
# Create the special NAS4220B and Itian Square One SQ201 image