What happens behind the build process?¶
Build process summary:¶
- creates development environment on top of amd64 Ubuntu 22.04 LTS,
- downloads proven sources, applies patches on top and uses tested configurations,
- cross-compiles universal boot loader (U-Boot), kernel and other tools and drivers,
- packs kernel, U-Boot, dtb and root customizations into Debian packages,
- debootstraps minimalistic Debian Bullseye and Ubuntu Jammy into SD card images,
- installs additional packets, applies customizations and shrinks image to its actual size.
Check this image compiling example with partial cache.
Build process details:¶
Creating compile environment¶
First things first. All necessary dependencies are downloaded and installed. This happens though both http and torrent network. Btw. having too much unused traffic? Help us to reduce ours :)
Using board configuration¶
We need to get some predefined variables about selected the board. Which kernel & uboot source to use, modules to load, which is the build number, do we need to have a single partition or dual with boot on fat, which extra drivers to compile out of the kernel tree … All this stuff is predefined for each and every single supported board.
When we know which sources to use and where they need to be the download or updated this process starts. This might take from several minutes to several hours.
In the patching process we are applying patches to the used sources. The process is - depending on selected board - defined in:
1 2 3 4 5 6
Patch rules for subdirectories are: KERNEL_FAMILY-BRANCH for kernel and U-BOOT-SOURCE-BRANCH for U-Boot.
Debootstrap creates fresh Debian / Ubuntu root filesystem templates or use cached under:
To recreate those files you need to remove them manually. From time to time they will be recreated anyway if Armbian updates their rootfs cache.
When the root filesystem is ready we need to install the kernel image with modules, board definitions and firmwares. Along with this we set the CPU frequency min/max, hostname, modules, network interfaces templates. Here is also the place to install headers and fix + native compile them on the way.
Each distribution has it’s own way of doing things:
- serial console
- different packets
- configuration locations
Each board has their own tricks: different device names, firmware loaders, configuration (de)compilers, hardware configurators
You can build a desktop environment withing the image. Consider this feature as experimental. Do not expect to have working hardware acceleration since this is a very complicated task and needs individial care for different boards.
This place is reserved for custom applications. There is one example of application: USB redirector.
There is an option to add some extra commands just before closing an image which is also automaticaly shrink to it’s actual size with some small reserve.
It will be something like this:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24