You will need to setup development environment within [Ubuntu 14.04 LTS x64 server image](http://releases.ubuntu.com/14.04/) and cca. 20G of free space.
- creates development environment on the top of X86/AMD64 Ubuntu 14.04 LTS,
- download proven sources, applies patches and use tested configurations,
- cross-compile universal boot loader (u-boot), kernel and other tools and drivers,
- pack kernel, uboot, dtb and root customizations into debs,
- debootstrap minimalistic Debian Wheezy, Jessie and Ubuntu Trusty into SD card image,
- install additional packets, apply customizations and shrink image to it's actual size.
Switches clarification:
- **KERNEL_ONLY** - if we want to compile kernel, u-boot, headers and dtbs package only.
- **KERNEL_CONFIGURE** will bring up kernel configurator otherwise kernel will be compiled with script presets located in lib/config/linux-*.config
- **KERNEL\_KEEP\_CONFIG** overwrite kernel config before compilation
- **CLEAN_LEVEL** defines what should be cached. This is useful when we are rebuilind images or builind more than one image.
- 0 = executes make clean and delete previously created deb files [default]
- 1 = executes make clean
- 2 = does nothing
- 3 = provide kernel selection if any present
- 4 = delete all output files (rootfs cache, debs)
- **USE_CCACHE** use a C compiler cache to speed up the build process
- **BUILD_DESKTOP** builds a desktop on the top of the system with hw acceleration for some boards.
- **AFTERINSTALL** is a variable with command executed in a process of building just before closing image to insert some of your custom applications or fixes.
- **FBTFT** is a [driver for small displays](https://github.com/notro/fbtft). Only applicable for old kernels (3.4-3.14)
- **EXTERNAL** compiles custom drivers
- **FORCE** ignore manual changes to source
- **BUILD_ALL** cycle through selected boards and make images
At first run we are downloading all necessary dependencies.
## Using board configuration ##
We need to get some predefined variables about selected 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, ...
**Board configuration example:**
REVISION="1.1" # Version number is altered by board maintainer
BOOTSIZE="16" # FAT boot partition in MB, 0 for none
LINUXSOURCE="linux-neo" # Local folder where to download it
LINUXFAMILY="udoo" # boards share kernel
This **isn't ment to be user configurable** but you can alter variables if you know what you are doing.
## Downloading sources ##
When we know where are the sources and where they need to be the download / update process starts. This might take from several minutes to several hours.
## Patching ##
In patching process we are appling patches to sources. The process is defined in:
lib/patching.sh
## User patching ##
You can add your own patches outside build script. Place your patches inside appropriate directory, for kernel or u-boot. There are no limitations except all patches must have ending **.patch**
userpatches/kernel
userpatches/u-boot
## Compiling or choosing from cache ##
- compile from scratch with additional source cleaning and menu config.
- select cached / already made kernel
## Debootstrap ##
Debootstrap creates fresh Debian / Ubuntu root filesystem templates or use cached under:
output/cache/rootfs/$DISTRIBUTION.tgz
To recreate those files you need to remove them manually.
## Kernel install ##
When root filesystem is ready we need to instal kernel image with modules, board definitions, 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.
## Distribution fixes ##
Each distributin has it's own way of doing things:
- serial console
- different packets
- configuration locations
## Board fixes ##
Each board has their own tricks: **different device names, firmware loaders, configuration (de)compilers, hardware configurators**
## Desktop installation ##
You can build a desktop withing the image. Consider this feature as experimental. Hardware acceleration on Allwinner boards is working within kernel 3.4.x only.
## External applications ##
This place is reserved for custom applications. There is one example of application - USB redirector.
## Closing image ##
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.