I regularly build customized OpenWrt firmware images. The script that I use to automate this process basically does a full build with fresh sources every single time. It boils down to this routine:
- Clone the OpenWrt repository in a temporary folder
- Update and install the package feeds
- Apply my configuration seed (diffconfig) and custom patches
- Build everything
- Copy generated binaries to my local firmware repository
- Delete the temporary folder
While this approach works fine for me, I'm wondering, though, whether there is a safe and more efficient way to do this. After all, with the current approach I always write some 8-10 GB of data to the disk and then wipe it again. And building the toolchain also makes up for most of the compilation time.
I know I can do a "make clean" after a build to keep the toolchain. But how do I know when the toolchain needs to be rebuilt across new builds? Does the build system detect automatically that the sources of some tools in the toolchain changed after I update the source tree? Do I have to manually check for changes in the git history (in which case I would prefer to stick to my current approach)?
How have you automated your workflows? Do you always start from scratch?
Note: When I say, I build firmware images regularly, I mean every few weeks. I usually don't build multiple times a day.