Can anyone tell me how to write a DTS file ?
Thanks.
Open notepad and begin writing...
There are a lot of examples in the linux kernel source and here in the openwrt source.
Here are the specifications:
I understand that the right *.dts file allow the crafting of a FW for Router which is not in the Database.
I tried to find a guide a to build the *.bin from the *.dts, but I did not find it yet.
Another approach is to use a device that is already in the database as a template - one with the same chips, boot loader, and flash size. Then go back and review the commits on the device you are using a template to see what other entries are needed. Be careful with the boot loader partitions, it is easiest if they match the OEM partitions.
Sure. Once we modified the *.dts starting from the one of a similar router, how do we generate the *.img file?
Do we have a guide like this?
I would also look at the commit message for the similar router, it will contain the other files that need editing.
For example:
https://git.openwrt.org/?p=openwrt/openwrt.git;a=commit;h=c0e131b4363dde16a1071131b7e762e36099f780
There are 01_leds, 02_network, mt7621.mk files that also need to be modified.
How you set up a build environment depends on what Operating systems you have access to.
I run Debian 10 and this guide: worked for me:
https://openwrt.org/docs/guide-developer/build-system/install-buildsystem
You can find rules of building firmware image file in target/linux/${platform}/image directories for all supported boards.
Coming back to my case (Sitecom WLR-4100 based on RAMIPS MT 7620): I put the wlr-4100.dts file (custom) in the "ramips" dts folder: target/linux/rampis/dts
Then I included such board in target/linux/rampis/image/mk7620.mk file
define Device/wlr-4100
DTS := WLR-4100
BLOCKSIZE := 4k
IMAGE_SIZE := 7244k
IMAGES += factory.dlf
IMAGE/factory.dlf := $$(sysupgrade_bin) | check-size $$$$(IMAGE_SIZE) | \
senao-header -r 0x0202 -p 0x41 -t 2
DEVICE_TITLE := Sitecom WLR-4100
DEVICE_PACKAGES := kmod-usb-core kmod-usb-ohci kmod-usb2 swconfig
endef
TARGET_DEVICES += wlr-4100
I deleted the previous configuration, I created a new one and re-compiled:
rm .config
make menuconfig
make