aboutsummaryrefslogtreecommitdiffstats
path: root/target
diff options
context:
space:
mode:
authorJohn Crispin <john@phrozen.org>2020-06-04 14:23:07 +0200
committerJohn Crispin <john@phrozen.org>2020-06-07 17:52:21 +0200
commit55b97b688541b050e6d9f3f87c124c06fabe24ed (patch)
treecc3532887a13ad73424000a2232eb4b6eb48d1b7 /target
parent127ad76311079a842578e788a8af364f3910c676 (diff)
downloadupstream-55b97b688541b050e6d9f3f87c124c06fabe24ed.tar.gz
upstream-55b97b688541b050e6d9f3f87c124c06fabe24ed.tar.bz2
upstream-55b97b688541b050e6d9f3f87c124c06fabe24ed.zip
mediatek: make emmc image generation work on mt7622
Signed-off-by: John Crispin <john@phrozen.org>
Diffstat (limited to 'target')
-rw-r--r--target/linux/mediatek/image/Makefile2
-rwxr-xr-xtarget/linux/mediatek/image/gen_mt7622_emmc_img.sh19
2 files changed, 20 insertions, 1 deletions
diff --git a/target/linux/mediatek/image/Makefile b/target/linux/mediatek/image/Makefile
index 385277fd3d..db702509ed 100644
--- a/target/linux/mediatek/image/Makefile
+++ b/target/linux/mediatek/image/Makefile
@@ -12,7 +12,7 @@ define Build/sysupgrade-emmc
rm -f $@.recovery
mkfs.fat -C $@.recovery 3070
- ./gen_mt7623_emmc_img.sh $@ \
+ ./gen_$(SUBTARGET)_emmc_img.sh $@ \
$(IMAGE_KERNEL) \
$@.recovery \
$(IMAGE_ROOTFS)
diff --git a/target/linux/mediatek/image/gen_mt7622_emmc_img.sh b/target/linux/mediatek/image/gen_mt7622_emmc_img.sh
new file mode 100755
index 0000000000..d74068c7b1
--- /dev/null
+++ b/target/linux/mediatek/image/gen_mt7622_emmc_img.sh
@@ -0,0 +1,19 @@
+#!/bin/sh
+
+OUTPUT_FILE=$1
+KERNEL_FILE=$2
+RECOVERY_FILE=$3
+ROOTFS_FILE=$4
+
+BS=512
+
+#RECOVERY_OFFSET= kernel size / BS = 20M / 512 (blocks)
+RECOVERY_OFFSET=40960
+
+#ROOTFS_OFFSET = RECOVERY_OFFSET + (RECOVERY_SIZE / BS)
+# = 40960 + (10M / 512) (blocks)
+ROOTFS_OFFSET=61440
+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