aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/mediatek/image
diff options
context:
space:
mode:
Diffstat (limited to 'target/linux/mediatek/image')
-rw-r--r--target/linux/mediatek/image/Makefile10
-rwxr-xr-xtarget/linux/mediatek/image/gen_mt7623_emmc_img.sh18
-rw-r--r--target/linux/mediatek/image/mt7623.mk11
3 files changed, 39 insertions, 0 deletions
diff --git a/target/linux/mediatek/image/Makefile b/target/linux/mediatek/image/Makefile
index 6659d446d0..5e2b2c6d0a 100644
--- a/target/linux/mediatek/image/Makefile
+++ b/target/linux/mediatek/image/Makefile
@@ -22,6 +22,16 @@ define Build/dtb
$(CP) $(DEVICE_DTS_DIR)/$(DEVICE_DTS).dtb $(BIN_DIR)/
endef
+define Build/sysupgrade-emmc
+ rm -f $@.recovery
+ mkfs.fat -C $@.recovery 3070
+
+ ./gen_mt7623_emmc_img.sh $@ \
+ $(IMAGE_KERNEL) \
+ $@.recovery \
+ $(IMAGE_ROOTFS)
+endef
+
# default all platform image(fit) build
define Device/Default
PROFILES = Default $$(DEVICE_NAME)
diff --git a/target/linux/mediatek/image/gen_mt7623_emmc_img.sh b/target/linux/mediatek/image/gen_mt7623_emmc_img.sh
new file mode 100755
index 0000000000..1cb0883fb0
--- /dev/null
+++ b/target/linux/mediatek/image/gen_mt7623_emmc_img.sh
@@ -0,0 +1,18 @@
+#!/usr/bin/env bash
+
+OUTPUT_FILE=$1
+KERNEL_FILE=$2
+RECOVERY_FILE=$3
+ROOTFS_FILE=$4
+
+BS=512
+
+#These to offsets are relative to the absolute location of the kernel on the mmc
+#(0xA00), so their position in the image is -2560 blocks
+RECOVERY_OFFSET=67072
+ROOTFS_OFFSET=87552
+
+dd bs="$BS" of="$OUTPUT_FILE" if="$KERNEL_FILE"
+dd bs="$BS" of="$OUTPUT_FILE" if="$RECOVERY_FILE" seek="$RECOVERY_OFFSET"
+dd bs="$BS" of="$OUTPUT_FILE" if="$ROOTFS_FILE" seek="$ROOTFS_OFFSET"
+dd if=/dev/zero of="$OUTPUT_FILE" bs=128k count=1 oflag=append conv=notrunc
diff --git a/target/linux/mediatek/image/mt7623.mk b/target/linux/mediatek/image/mt7623.mk
index ddb4faa480..fa6774e783 100644
--- a/target/linux/mediatek/image/mt7623.mk
+++ b/target/linux/mediatek/image/mt7623.mk
@@ -1,3 +1,14 @@
+define Device/7623a-unielec-u7623-02-emmc-512m
+ DEVICE_TITLE := MTK7623a UniElec U7623-02 (eMMC/512MB RAM)
+ DEVICE_DTS := mt7623a-unielec-u7623-02-emmc-512M
+ DEVICE_PACKAGES := mkf2fs e2fsprogs kmod-fs-vfat kmod-nls-cp437 kmod-nls-iso8859-1 kmod-mmc
+ SUPPORTED_DEVICES := unielec,u7623-02-emmc-512m
+ IMAGES := sysupgrade-emmc.bin.gz
+ IMAGE/sysupgrade-emmc.bin.gz := sysupgrade-emmc | gzip | append-metadata
+endef
+
+TARGET_DEVICES += 7623a-unielec-u7623-02-emmc-512m
+
define Device/7623n-bananapi-bpi-r2
DEVICE_TITLE := MTK7623n BananaPi R2
DEVICE_DTS := mt7623n-bananapi-bpi-r2