We are using openwrt to build up firmware for our device.
Now, we have kernel image(Image), rootfs(rootfs.squashfs) and bld(bld.bin) at build dir.
After checking the image/Makefile under target/linux/xxxx folder, still no idea how to prepare my own sysupgrade.bin for my device.
Does anyone can give me some tips to try? Please advise. Thanks a lot.
There isn't universal rule for abstract board. It depends of your board bootloader firstly.
The most common case is uboot bootloader. In this case scenario looks like:
0. Add board configuration data (compiled dts-file or another data) into vmlinux kernel. It's kernel
Pack kernel with lzma command (if your version of uboot support it). It's kernel.lzma
Make header for packed kernel to inform uboot how to load your kernerl with mkimage command. It's kernel.bin
Simply join packed kernel with uboot header and rootfs.squash with cat command. It's sysupgrade.bin.
All these steps you can find in ./include/image* and in ./target/linux/${your_arch}/${your_sub_arch}/image/Makefile
Which firmware image header format does it support? Does exist special tool to prepare kernel image header? Does kernel support parser for this header (if not, you have to use fixed flash partitioning for kernel and roots parts)?
Does bootloader support packed image?
Where (flash offset) does it search firmware image header?
Does bootloader require flash area for its own information/environment?
Does your firmware require flash area for its own data/environment (usually some info for network and wifi drivers: calibration data, mac addresses etc)?
If you answer these questions you can plan your total flash partitioning (layout) and sysupgrade (firmware) part of this layout,
After checking how ramips create image, I can create full image with appending each bins into one image file. Like |bst|bld|fac|kernel|rootfs|add|.
Still, I have another question. Since we would like to upgrade kernel and rootfs partitions only via web, so
How do I prepare a sysupgrade image with kernel/rootfs only?
How to ask sysupgrade script to upgrade kernel/rootfs partition?
Please help. Thanks.