OpenWrt Forum Archive

Topic: How to write code for firmware upgrade?

The content of this topic has been archived on 7 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

I want to write cgi to upgrade firmware.
But I can't find the source code for that in the source code package.
Anyone tell me where?
Or share your code?

I mean wrt300n-v2's setup.cgi and upload_lang.cgi under ap71-rootdir/www.
Thanks a lot if you can help me !

A simple upgrade script doesn't need to do anything more than:
mtd write -r firmware.trx linux

which is only slightly fancier than dd'ing the data directly to the flash

detail?
I have no idea about mtd.
How can I save the image file form webserver and then write it into flash?

The discussion might have continued from here.