Hello OpenWRT community,
First of all, I wanted to say how grateful I am for the good work you are doing.
I have a device with a microSD card slot that runs just fine using a standard stable OpenWRT image, as provided on the OpenWRT website.
Rather than flashing the OpenWRT image to my SD card, I would like to have a minimal "loader" Linux image on the SD card which reads a text file from the SD card that contains a URL, and then downloads and boots the image from that URL. The goal is for the "loader" to boot the OpenWRT image and behave exactly as that image would have done were the "loader" not present.
The "loader" image will contain static network configuration and will need to download the OpenWRT image over the internet. In other words, traditional BOOTP/TFTP network booting is not an option - it will have to boot over the internet, most likely with HTTP, but I am open to other solutions that work over the internet.
It is complicated and risky to either build my own OpenWRT images or modify the standard OpenWRT images, so I would like this setup to be able to boot stock stable OpenWRT images from the OpenWRT website. The device will be in a remote location and I would like to be able to reboot it and have it load new images while minimising the risk of rendering the device inoperable, which custom images would increase. U-Boot supports some form of network booting, but from what I have read, it does not reliably support HTTP booting, so I expect I will need U-Boot to load a minimal Linux image that will then download the OpenWRT image over HTTP and boot from it. If possible, I would like to store an OpenWRT image on the SD card and in the event of being unable to download an image over HTTP, the device should boot from the image stored on the SD card. Note, this backup image will be an image file on the file system, rather than an expanded image that would typically be written to an SD card.
My device has more than enough RAM to download the OpenWRT image to RAM, keep it there and then run reliably using the remaining free RAM. I would prefer a solution that operates entirely in RAM once the "loader" has finished downloading the OpenWRT.
Since I would like to boot a stock OpenWRT image, essentially the work will be in building the "loader" image.
Has anyone done something like this before, or does anyone have any ideas how I may go about it?
Would it be easier for me to start working on the "loader" image by taking a stock OpenWRT image and trying to strip it down?
What exactly will I need to do in order to prepare the loader to boot a stock OpenWRT image?
Thank you in advance for any input.