Open
Description
from IRC rant a while back.. probably useful if cleaned up
build script has a decent inheritance model for configuration, albeit a few gotchas here and there, and decently subdivided to several libraries of functions.... there's some neat hooks where you can trigger individual functions from command line if you're crafty enough
General order of operations on a vanilla execution is:
* special command line argument parser function breaks up key=value passed as arguments and sets them as their respective config variable used later
* check basic system requirements (distro, etc)
* install OS dependency packages, ex: build tools, compression tools,
* carve out some work directories... ex cache, output, hidden tmp, userpatches
* download appropriate cross-compilation toolchains (we maintain our own collection of them for sanity purposes)
* prompt for input for what to build (if not passed via command config or config file)
** board, which flavor of kernel (legacy, stable, edge), which base OS flavor to bootstrap ( ex: debian bullseye, ubuntu focal ), what type of image.. minimal, server, or desktop... if desktop MORE questions
* commend build process
* checkout appropriate sources as defined in inherietence model for device for uboot, kernel, as well as some supplemental packages (firmware etc)
* apply patches to teh checked out code, based on the contents of our patch folders and its heirachy sytem
* apply custom patches provided by user
* compile uboot and kernel... output as deb files
* attempt to retrieve a cached prebuilt version of the respective root filesystem (ex: debian bullseye, server). if yes, mount, chroot, update, and remaining customization for a board etc, and then install kernel and uboot. if no, perform a debootstrap to create that respectiev filesystem then install other stuff
* once filesystem is complete, create actual raw disk image file via a loopback device... partition and create file ssytems as needed... rsync contents of chrooted file system prior into said image....
* perform post steps unique to system... ex: fancy u-boot dances, and assembly of secondary program loaders etc
* water mark image in /etc/armbian-release
* sign
* compress image