realtek: build sane factory images for DGS-1210 models

During upload of firmware images the WebUI and CLI patch process
extracts a version information from the uploaded file and stores it
onto the jffs2 partition. To be precise it is written into the
flash.txt or flash2.txt files depending on the selected target image.
This data is not used anywhere else. The current OpenWrt factory
image misses this label. Therefore version information shows only
garbage. Fix this.

Before:
DGS-1210-20> show firmware information
IMAGE ONE:
Version      : xfo/QE~WQD"A\Scxq...
Size         : 5505185 Bytes

After:
DGS-1210-20> show firmware information
IMAGE ONE:
Version      : OpenWrt
Size         : 5505200 Bytes

Tested-by: Luiz Angelo Daros de Luca <luizluca@gmail.com>
Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
(cherry picked from commit fae3ac3560)
This commit is contained in:
Markus Stockhausen 2022-07-06 13:43:23 +02:00 committed by Luiz Angelo Daros de Luca
parent 3fbf45bd09
commit 945b13e369
2 changed files with 7 additions and 1 deletions

View File

@ -21,6 +21,11 @@ define Build/dlink-cameo
$(SCRIPT_DIR)/cameo-tag.py $@ $(DLINK_KERNEL_PART_SIZE) $(SCRIPT_DIR)/cameo-tag.py $@ $(DLINK_KERNEL_PART_SIZE)
endef endef
define Build/dlink-version
echo -n "OpenWrt" >> $@
dd if=/dev/zero bs=25 count=1 >> $@
endef
define Build/dlink-headers define Build/dlink-headers
dd if=$@ bs=$(DLINK_KERNEL_PART_SIZE) count=1 of=$@.kernel_part; \ dd if=$@ bs=$(DLINK_KERNEL_PART_SIZE) count=1 of=$@.kernel_part; \
dd if=$@ bs=$(DLINK_KERNEL_PART_SIZE) skip=1 of=$@.rootfs_part; \ dd if=$@ bs=$(DLINK_KERNEL_PART_SIZE) skip=1 of=$@.rootfs_part; \

View File

@ -23,7 +23,8 @@ define Device/d-link_dgs-1210
CAMEO_BOARD_VERSION := 32 CAMEO_BOARD_VERSION := 32
IMAGES += factory_image1.bin IMAGES += factory_image1.bin
IMAGE/factory_image1.bin := append-kernel | pad-to 64k | \ IMAGE/factory_image1.bin := append-kernel | pad-to 64k | \
append-rootfs | pad-rootfs | pad-to 16 | check-size | dlink-headers append-rootfs | pad-rootfs | pad-to 16 | check-size | \
dlink-version | dlink-headers
endef endef
define Device/d-link_dgs-1210-10p define Device/d-link_dgs-1210-10p