[OpenWrt-Devel] [PATCH] gemini: Cook SQ201 images

Linus Walleij linus.walleij at linaro.org
Fri Jun 15 17:34:57 EDT 2018

This generates the "rd.gz" and "hddapp.tgz" that doesn't contain
anything of the sort but rather the OpenWRT rootfs. It works the
same way as how we generate the same layout for the NAS4220b.
For some reason the ImageInfo file is different for the SQ201.

Signed-off-by: Linus Walleij <linus.walleij at linaro.org>
 target/linux/gemini/image/ImageInfo-sq201 | 18 ++++++++++++++++++
 target/linux/gemini/image/Makefile        | 17 +++++++++++++++++
 2 files changed, 35 insertions(+)
 create mode 100644 target/linux/gemini/image/ImageInfo-sq201

diff --git a/target/linux/gemini/image/ImageInfo-sq201 b/target/linux/gemini/image/ImageInfo-sq201
new file mode 100644
index 000000000000..86040ab4708c
--- /dev/null
+++ b/target/linux/gemini/image/ImageInfo-sq201
@@ -0,0 +1,18 @@
+UpgradeImages="zImage rd.gz hddapp.tgz"
+DESCRIPTION="Square One Router/Nas"
diff --git a/target/linux/gemini/image/Makefile b/target/linux/gemini/image/Makefile
index ba2ee02bfa7d..a05b7111b5bc 100644
--- a/target/linux/gemini/image/Makefile
+++ b/target/linux/gemini/image/Makefile
@@ -54,6 +54,21 @@ define Build/nas4220b-images
 	rm -f $(BIN_DIR)/ImageInfo
+# The Itian Square One SQ201 uses the same method.
+define Build/sq201-images
+	dd if=$(IMAGE_ROOTFS) of=$(BIN_DIR)/rd.gz bs=6144k conv=sync
+	dd if=$(IMAGE_ROOTFS) of=$(BIN_DIR)/hddapp.tgz bs=6144k count=1 seek=1
+	cp $(IMAGE_KERNEL) $(BIN_DIR)/zImage
+	cp ./ImageInfo-sq201 $(BIN_DIR)/ImageInfo
+	sed -i -e "s/DATESTR/`date +%Y%m%d`/g" $(BIN_DIR)/ImageInfo
+	(cd $(BIN_DIR); tar -czf $(IMG_PREFIX)-sysupgrade-sq201.tar.gz ImageInfo zImage rd.gz hddapp.tgz)
+	mv $(BIN_DIR)/rd.gz $(BIN_DIR)/$(IMG_PREFIX)-sq201-rd.gz
+	mv $(BIN_DIR)/hddapp.tgz $(BIN_DIR)/$(IMG_PREFIX)-sq201-hddapp.tgz
+	mv $(BIN_DIR)/zImage $(BIN_DIR)/$(IMG_PREFIX)-sq201-zImage
+	rm -f $(BIN_DIR)/ImageInfo
 # WBD-111 and WBD-222:
 # work around the bootloader's bug with extra nops
 # FIXME: is this really needed now that we no longer append the code
@@ -120,6 +135,8 @@ TARGET_DEVICES += rut1xx
 define Device/sq201
 	DEVICE_TITLE := ITian Square One SQ201
+	IMAGES += sq201-image
+	IMAGE/sq201-image := sq201-images

openwrt-devel mailing list
openwrt-devel at lists.openwrt.org

More information about the openwrt-devel mailing list