Browse Source

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 <[email protected]>
Mathias Kresin 7 years ago
parent
commit
6491643df4
1 changed files with 13 additions and 11 deletions
  1. 13 11
      target/linux/gemini/image/Makefile

+ 13 - 11
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 [email protected]/.boot
+
+	echo "dummy" > [email protected]/dummyfile
+
+	dns313-header [email protected]/dummyfile \
+		[email protected]/.boot/rootfs.tgz
+	dns313-header [email protected]/dummyfile \
+		[email protected]/.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
+		[email protected]/.boot/zImage
+
+	tar -czf $@ -C @.tmp .boot
+
+	rm -rf [email protected]
 endef
 
 # Create the special NAS4220B and Itian Square One SQ201 image