ramips: sercomm.mk: make common recipe to set a bit in pid
authorMikhail Zhilkin <csharper2005@gmail.com>
Sun, 12 Nov 2023 07:52:45 +0000 (07:52 +0000)
committerHauke Mehrtens <hauke@hauke-m.de>
Sat, 25 Nov 2023 00:11:18 +0000 (01:11 +0100)
This commit makes a common recipe to set bit in Sercomm factory pid since
this is necessary for several devices (WiFire S1500.nbn, Rostelecom
RT-FL-1) at different offsets.

Signed-off-by: Mikhail Zhilkin <csharper2005@gmail.com>
target/linux/ramips/image/common-sercomm.mk
target/linux/ramips/image/mt7621.mk

index 4060da092357ef65f0a1490b3ba0ce0da40a92c4..182f2251ba78e03ba829306c21223fd55fae505d 100644 (file)
@@ -38,10 +38,6 @@ define Build/sercomm-factory-cqr
        mv $@.fhdr $@
 endef
 
-define Build/sercomm-fix-buc-pid
-       printf 1 | dd seek=$$((0x13)) of=$@ bs=1 conv=notrunc 2>/dev/null
-endef
-
 define Build/sercomm-kernel
        $(TOPDIR)/scripts/sercomm-kernel-header.py \
                --kernel-image $@ \
@@ -104,6 +100,10 @@ define Build/sercomm-payload
        rm $@.pid
 endef
 
+define Build/sercomm-pid-setbit
+       printf 1 | dd seek=$$(($(1))) of=$@ bs=1 conv=notrunc 2>/dev/null
+endef
+
 define Build/sercomm-prepend-tagged-kernel
        $(CP) $(IMAGE_KERNEL) $(IMAGE_KERNEL).tagged
        $(call Build/sercomm-part-tag-common,$(word 1,$(1)) \
index 83f0b8f41631761c31a960a334cc723cb9bdb6fe..a306331159dec95767e8cdaed5a096be8f51e54b 100644 (file)
@@ -2655,7 +2655,7 @@ define Device/wifire_s1500-nbn
   IMAGE_SIZE := 51200k
   IMAGE/factory.img := append-kernel | sercomm-kernel-factory | \
        sercomm-reset-slot1-chksum | append-ubi | check-size | \
-       sercomm-factory-cqr | sercomm-fix-buc-pid | sercomm-mkhash | \
+       sercomm-factory-cqr | sercomm-pid-setbit 0x13 | sercomm-mkhash | \
        sercomm-crypto
   SERCOMM_HWID := BUC
   SERCOMM_HWVER := 10000