aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/ramips/image
diff options
context:
space:
mode:
authorMikhail Zhilkin <csharper2005@gmail.com>2023-06-11 20:48:49 +0000
committerHauke Mehrtens <hauke@hauke-m.de>2023-07-01 16:05:01 +0200
commitf560be583a858bc3099f2b1f0aa0ddec62cfd91c (patch)
treee87f22a5fd397f7235c2f763434c5c4463efb18e /target/linux/ramips/image
parentdac0a133cf8dbf0bd9afabecdc1092456c451ec7 (diff)
downloadupstream-f560be583a858bc3099f2b1f0aa0ddec62cfd91c.tar.gz
upstream-f560be583a858bc3099f2b1f0aa0ddec62cfd91c.tar.bz2
upstream-f560be583a858bc3099f2b1f0aa0ddec62cfd91c.zip
ramips: sercomm.mk: preparation for Sercomm s1500 devices support
This commit moves a part of the code from the "sercomm-factory-cqr" recipe to the separate "sercomm-mkhash" recipe. This simplifies recipes and allows insert additional recipes between these code blocks (required for the future support for Beeline SmartBox PRO router). dd automatically fills the file by 0x00 if the filesize is less than offset where we start writing. We drop such dd command so we need to add --extra-padding-size 0x190 to the sercomm-pid.py call. Signed-off-by: Mikhail Zhilkin <csharper2005@gmail.com>
Diffstat (limited to 'target/linux/ramips/image')
-rw-r--r--target/linux/ramips/image/common-sercomm.mk14
1 files changed, 9 insertions, 5 deletions
diff --git a/target/linux/ramips/image/common-sercomm.mk b/target/linux/ramips/image/common-sercomm.mk
index fbe29d70174..b743df44080 100644
--- a/target/linux/ramips/image/common-sercomm.mk
+++ b/target/linux/ramips/image/common-sercomm.mk
@@ -22,14 +22,12 @@ define Build/sercomm-factory-cqr
--hw-version $(SERCOMM_HWVER) \
--hw-id $(SERCOMM_HWID) \
--sw-version $(SERCOMM_SWVER) \
- --pid-file $@.fhdr
+ --pid-file $@.fhdr \
+ --extra-padding-size 0x190
printf $$(stat -c%s $(IMAGE_KERNEL)) | \
dd seek=$$((0x70)) of=$@.fhdr bs=1 conv=notrunc 2>/dev/null
printf $$(($$(stat -c%s $@)-$$(stat -c%s $(IMAGE_KERNEL))-$$((0x200)))) | \
dd seek=$$((0x80)) of=$@.fhdr bs=1 conv=notrunc 2>/dev/null
- dd bs=$$((0x200)) skip=1 if=$@ conv=notrunc 2>/dev/null | \
- $(MKHASH) md5 | awk '{print $$1}' | tr -d '\n' | \
- dd seek=$$((0x1e0)) of=$@.fhdr bs=1 conv=notrunc 2>/dev/null
dd if=$@ >> $@.fhdr 2>/dev/null
mv $@.fhdr $@
endef
@@ -60,6 +58,12 @@ define Build/sercomm-kernel-factory
mv $@.khdr $@
endef
+define Build/sercomm-mkhash
+ dd bs=$$((0x400)) skip=1 if=$@ conv=notrunc 2>/dev/null | \
+ $(MKHASH) md5 | awk '{print $$1}' | tr -d '\n' | \
+ dd seek=$$((0x1e0)) of=$@ bs=1 conv=notrunc 2>/dev/null
+endef
+
define Build/sercomm-part-tag
$(call Build/sercomm-part-tag-common,$(word 1,$(1)) $@)
endef
@@ -118,7 +122,7 @@ define Device/sercomm_cxx
IMAGE/sysupgrade.bin := append-kernel | sercomm-kernel | \
sysupgrade-tar kernel=$$$$@ | append-metadata
IMAGE/factory.img := append-kernel | sercomm-kernel-factory | \
- append-ubi | sercomm-factory-cqr
+ append-ubi | sercomm-factory-cqr | sercomm-mkhash
endef
define Device/sercomm_dxx