Documentation update

This commit is contained in:
zador-blood-stained 2016-01-07 20:06:36 +03:00
parent 61591ca831
commit f0b699893b

View File

@ -1,4 +1,4 @@
# How to build Armbian? #
# How to build Armbian image or custom kernel?
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.
@ -13,6 +13,79 @@ Run the script
./compile.sh
# Build options clarification
- **KERNEL_ONLY** (yes|no):
- set to "yes" to compile only kernel, u-boot and other packages for installing on existing Armbian system
- set to "no" to build complete OS image for writing to SD card
- **KERNEL_CONFIGURE** (yes|no):
- set to "yes" to configure kernel (add or remove modules or features). Kernel configuration menu will be brought up before compilation
- set to "no" to compile kernel without changing default or custom provided configuration
- **CLEAN_LEVEL** (comma-separated list): defines what should be cleaned. Default value is "make,debs" - remove all packages and clean sources. Changing this option can be useful when rebuilding images or building more than one image
- "make" = execute _make clean_ for selected kernel and u-boot sources,
- "images" = delete "./output/images" (complete OS images),
- "debs" = delete "./output/debs" (kernel, u-boot and other packages),
- "cache" = delete "./output/cache" (rootfs cache),
- "sources" = delete "./sources" (all downloaded sources)
- **KERNEL\_KEEP\_CONFIG** (yes|no):
- set to "yes" to use kernel config file from previous compilation for the same branch, device family and version
- set to "no" to use default or user-provided config file
- **BUILD_DESKTOP** (yes|no):
- set to "yes" to build image with minimal desktop environment
- set to "no" to build image with console interface only
- **FBTFT** (yes|no):
- set to "yes" to add a [driver for small displays](https://github.com/notro/fbtft). Only applicable for old kernels (3.4-3.14)
- **EXTERNAL** (yes|no):
- set to "yes" to compile and install some extra applications and drivers (only for **default** kernel branch:
- [USB redirector](http://www.incentivespro.com)
- Realtek RT8192 wireless driver
- Sunxi display control
- **FORCE_CHECKOUT** (yes|no):
- set to "yes" to force overwrite any changed or manually patched kernel, u-boot and other sources
- set to "no" to keep all changes to sources
- **BUILD_ALL** (yes|no): cycle through all available board and kernel configurations and make images for all combinations
### Hidden options to minimize user input for build automation:
- **BOARD** (string): you can set name of board manually to skip dialog prompt
- **BRANCH** (default|next|dev): you can set kernel and u-boot branch manually to skip dialog prompt; some options may not be available for all devices
- **RELEASE** (wheezy|jessie|trusty): you can set OS release manually to skip dialog prompt; use this option with KERNEL_ONLY=yes to create board support package
### Hidden options for advanced users (default values are marked **bold**):
- **USE_CCACHE** (**yes**|no): use a C compiler cache to speed up the build process
- **PROGRESS_DISPLAY** (none|plain|**dialog**): way to display output of verbose processes - compilation, packaging, debootstrap
- **PROGRESS_LOG_TO_FILE** (yes|**no**): duplicate output, affected by previous option, to log file (./output/debug/*.log)
- **USE_MAINLINE_GOOGLE_MIRROR** (yes|**no**): use googlesource.com mirror for downloading mainline kernel sources, may be faster than git.kernel.org depending on your location
- **EXPERIMENTAL_DEBOOTSTRAP** (yes|**no**): use new debootstrap and image creation process. NOTE: work in progress, it may not create proper images for some boards yet
- **FORCE_USE_RAMDISK** (yes|no): overrides autodetect for using tmpfs in new debootstrap and image creation process. Takes effect only if EXPERIMENTAL_DEBOOTSTRAP is set to "yes"
- **FIXED_IMAGE_SIZE** (integer): create image file of this size (in megabytes) instead of minimal. Takes effect only if EXPERIMENTAL_DEBOOTSTRAP is set to "yes"
- **USE_F2FS_ROOT** (yes|**no**): create image with [F2FS](https://en.wikipedia.org/wiki/F2FS) root filesystem instead of ext4. Requires setting FIXED_IMAGE_SIZE to actual size of your SD card. Takes effect only if EXPERIMENTAL_DEBOOTSTRAP is set to "yes"
### Supplying options via command line parameters
Instead of editing compile.sh to set options, you can set them by supplying command line parameters to compile.sh
Example:
./compile.sh BRANCH=next BOARD=cubietruck KERNEL_ONLY=yes PROGRESS_DISPLAY=plain RELEASE=jessie
## User provided patches
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**. User patches directory structure mirrors directory structure of "lib/patch". Look for the hint at the beginning of patching process to select proper directory for patches. Example:
[ o.k. ] Started patching process for [ kernel sunxi-dev 4.4.0-rc6 ]
[ o.k. ] Looking for user patches in [ userpatches/kernel/sunxi-dev ]
Patch with same file name in "userpatches" directory tree substitutes one in "lib/patch". To _replace_ a patch provided by Armbian maintainers, copy it from "lib/patch" to corresponding directory in "userpatches" and edit it to your needs. To _disable_ a patch, create empty file in corresponding directory in "userpatches".
## User provided kernel config
If file **"userpatches/linux-KERNELFAMILY-KERNELBRANCH.config"** exists, it will be used instead of default one from "lib/config". Look for the hint at the beginning of kernel compilation process to select proper config file name. Example:
[ o.k. ] Compiling dev kernel [ @host ]
[ o.k. ] Using kernel config file [ lib/config/linux-sunxi-dev.config ]
## User provided image customization script
You can run custom commands to customize created image. Edit file:
userpatches/customize-image.sh
and place your custom code here. You may test values of variables noted in the file to use different commands for different configurations. Those commands will be executed in a process of building just before closing image.
# What is behind the build process?
Build process summary:
@ -24,42 +97,6 @@ Build process summary:
- debootstraps minimalistic Debian Wheezy, Jessie and Ubuntu Trusty into SD card image,
- installs additional packets, applies customizations and shrinks image to its actual size.
Options clarification:
- **KERNEL_ONLY** (yes|no): if we want to compile kernel, u-boot, headers and dtbs package only
- **KERNEL_CONFIGURE** (yes|no): will bring up kernel configurator otherwise kernel will be compiled with script presets located in lib/config/linux-*.config
- **CLEAN_LEVEL** (comma-separated list): defines what should be cleaned. This is useful when we are rebuilding images or building more than one image
- "make" = make clean for selected kernel and u-boot,
- "images" = delete "./output/images",
- "debs" = delete "./output/debs",
- "cache" = delete "./output/cache",
- "sources" = delete "./sources"
- **KERNEL\_KEEP\_CONFIG** (yes|no): overwrite or keep kernel config before compilation
- **BUILD_DESKTOP** (yes|no): builds a desktop on the top of the system with hw acceleration for some boards.
- **FBTFT** (yes|no): is a [driver for small displays](https://github.com/notro/fbtft). Only applicable for old kernels (3.4-3.14)
- **EXTERNAL** (yes|no): compiles custom drivers
- **FORCE_CHECKOUT** (yes|no): ignore manual changes to source
- **BUILD_ALL** (yes|no): cycle through all available board and kernel configurations and make images for all combinations
Some hidden options (default values are marked **bold**):
- **BOARD** (string): you can set name of board manually to skip dialog prompt
- **BRANCH** (default|next|dev): you can set kernel and u-boot branch manually to skip dialog prompt; some options may not be available for all devices
- **RELEASE** (wheezy|jessie|trusty): you can set OS release manually to skip dialog prompt; use this option with KERNEL_ONLY=yes to create board support package
- **USE_CCACHE** (**yes**|no): use a C compiler cache to speed up the build process
- **PROGRESS_DISPLAY** (none|plain|**dialog**): way to display output of verbose processes - compilation, packaging, debootstrap
- **PROGRESS_LOG_TO_FILE** (yes|**no**): duplicate output, affected by previous option, to log file (./output/debug/*.log)
- **USE_MAINLINE_GOOGLE_MIRROR** (yes|**no**): use googlesource.com mirror for downloading mainline kernel sources, may be faster than git.kernel.org depending on your location
- **EXPERIMENTAL_DEBOOTSTRAP** (yes|**no**): use new debootstrap and image creation process. NOTE: work in progress, it may not create proper images for some boards yet
- **FORCE_USE_RAMDISK** (yes|no): overrides autodetect for using tmpfs in new debootstrap and image creation process. Takes effect only if EXPERIMENTAL_DEBOOTSTRAP is set to "yes"
- **FIXED_IMAGE_SIZE** (integer): create image file of this size (in megabytes) instead of minimal. Takes effect only if EXPERIMENTAL_DEBOOTSTRAP is set to "yes"
- **USE_F2FS_ROOT** (yes|**no**): create image with [F2FS](https://en.wikipedia.org/wiki/F2FS) root filesystem instead of ext4. Requires setting FIXED_IMAGE_SIZE to actual size of your SD card. Takes effect only if EXPERIMENTAL_DEBOOTSTRAP is set to "yes"
## Using command line parameters ##
Instead of editing compile.sh to set options, you can set them by supplying command line parameters to compile.sh
Example:
./compile.sh BRANCH=next BOARD=cubietruck KERNEL_ONLY=yes PROGRESS_DISPLAY=plain RELEASE=jessie
Image compiling example with partial cache:
[su_youtube_advanced url="https:\/\/youtu.be\/zeShf12MNLg" controls="yes" showinfo="no" loop="yes" rel="no" modestbranding="yes"]
@ -99,35 +136,6 @@ In patching process we are appling patches to sources. The process is defined in
Patch rules for subdirectories are: **KERNEL_FAMILY-BRANCH** for kernel and **U-BOOT-SOURCE-BRANCH** for U-boot.
## 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**. Subdirectory logic is the same as for default patches.
userpatches/kernel/sun7i-default
userpatches/kernel/sunxi-dev
...
userpatches/u-boot/u-boot-default
userpatches/u-boot/u-boot-neo-default
...
## User kernel config ##
You can use your own kernel config outside build script. Name it as follows:
**linux-KERNELFAMILY-KERNELBRANCH.config**
and place to:
userpatches/
## User root filesystem install ##
Edit:
userpatches/customize-image.sh
and place your custom code here, different for each base. Those commands will be executed in a process of building just before closing image.
## Debootstrap ##
Debootstrap creates fresh Debian / Ubuntu root filesystem templates or use cached under: