Care to explain how flashing work?

i am running openwrt on a rockchip rk3318 tv box, basically following this guide this guide,

im curious if it possible to add flash new firmware feature just like ordinary routers

to be noted this not important at all and i just asking because of my curiousity so please dont blame me if you dont want to explain, but if you want to blame your neighbor its absolutely okay at least for me, not your neighbor.

Is your device running an official version of OpenWrt? I’m not sure that any STBs are actually supported by the official project. Where did the download come from (exact link would be helpful)?

and what is the output of

ubus call system board
1 Like
root@H96:~# ubus call system board
        "kernel": "6.1.42-flippy-84+",
        "hostname": "H96",
        "system": "ARMv8 Processor rev 4",
        "model": "Rockchip RK3318 BOX",
        "board_name": "rockchip,rk3318-box",
        "rootfs_type": "ext4",
        "release": {
                "distribution": "OpenWrt",
                "version": "22.03.5",
                "revision": "r20134-5f15225c1e",
                "target": "armvirt/64",
                "description": "OpenWrt 22.03.5 r20134-5f15225c1e"

it is official, i build the openwrt tarbal using image builder then extract it to the sdcard which is pre filled with armbian's files based on that guide (boot/,/lib/firmware/,/lib/modules/)

when i build the openwrt firmware, i choose armvirt/64 as target/subtarget, with Default profile

There is also automated build system by github user unifreq, although it doesn't support rk3318 but rk3318 is almost similar with rk3328

Well, whatever is running on the system right now is neither OpenWrt, nor 23.05.


perhaps there is a way to manipulate system to make openwrt think that this is a router to make a similar "flash" functionality using dd, parted, or other tool since armbian and openwrt are both linux right ?

'Anything' can be done, but it requires the necessary low-level development first - and it starts with the kernel and its DTS, to get SOC and the specific device working and supported.

OpenWrt 22.03 uses kernel 5.10, so what you are using is not OpenWrt (as @slh has already said). Where did you get the source code?


it is linux kernel from unifreq, there is also other kernel version including 5.10, i believe he shared the kernel source in github, like this, i know its not pure openwrt, or that it just an "alternative", i was thinking if i better understand how that "flashing" work i will take a look if i can make something equivalent/fake sysupgrade.

With that in mind, it is likely quite different in order to be able to support an unusual device (unusual for openwrt).

And because of this, you should ask the maintainers of the source code and/or tutorials about why they don’t offer a flash upgrade option.

1 Like

in other word, sysupgrade functionality depends on the kernel ?
because the environment is all from official openwrt, only the kernel is not, at least that is what i know, when i install or update a package, it is downloading from openwrt

Not the kernel, but the rest of the target details and how the storage system works. What you're using is clearly very much outside the mold of a typical OpenWrt install on an unconventional device. The people who were able to figure out how to get it running on that product would be the ones who would probably know why the flash upgrade option is not there.

1 Like

Device support entails quite a bit of developing (very, very abbreviated):

  • step 1
    • get the kernel booting
    • get all hardware running, at least the subset of hardware that's really necessary for OpenWrt
  • step 2
    • define the flash partitioning and -structure
    • define the image generation code
    • get the flashing procedures sorted and hooked up
  • step 3
    • polish it all up for a pull request to OpenWrt
    • rinse and repeat until it meets expectations and gets merged
  • step 4
  • step 5
    • device support will eventually become part of the next major OpenWrt release; it's now supported in a stable release.

You can't do step 2, before step 1 is done - and neither is available in vanilla OpenWrt so far. Bugs or other problems are only interesting from step 4 and onwards.

As-is, an unsupported binary image provided by someone, somewhere unknown, for a device not known to- nor supported by OpenWrt doesn't work as expected, breaking news, there's nothing that could be done from OpenWrt's side.

1 Like

I can't explain it but based on my casual reading in the forum and the wiki the past couple of years, the web ui either does the same thing as, or is a front end to, the command /sbin/sysupgrade.

hexdump -Cvn 100 /sbin/sysupgrade shows it to be shell script so
cat /sbin/sysupgrade will reveal a lot of detail on how it works.

You might be able to adapt it to use the custom installation method you mention.
Look into the related luci code if you also want the web ui to do the same.

For automated download via the utility, you would need to point to a repository based on your own build server output.

There have been discussions on the forum about how upgrade works, like memory checks/clearing, extracting the image and copying to storage, reboot, and firstboot tasks. Do some searching as well as reading related material in the doc wiki.