armbian 构建选项
2023-01-19 21:46:18
jiang\n楼主
Build options
These parameters are meant to be applied to the
./compile.sh command. They are all optional. They can also be added to yourbuild configuration fileto save time. Default values are marked bold if applicable. Main options
- BUILD_ONLY (comma-separated list): defines what artifacts should be built. Default value is empty string - will build all artifacts. Changing this option can be useful to build partial artifacts only.
- u-boot: build U-Boot
- kernel: build Kernel
- armbian-config: build Armbian config
- armbian-zsh: build Armbian zsh
- plymouth-theme-armbian: build Armbian Plymouth theme
- armbian-firmware: build Armbian firmware
- armbian-bsp: build Armbian board support package
- chroot: build additional packages
- bootstrap: build bootstrap package
- KERNELONLY ( yes | no ) :warning: Warning: This option is deprecated and may be removed in future releases - use BUILDONLY instead
- yes: compiles only kernel, U-Boot and other packages for installation on existing Armbian system<br>
"u-boot,kernel,armbian-config,armbian-zsh,plymouth-theme-armbian,armbian-firmware,armbian-bsp"- no: build complete OS image for writing to SD card<br>
- leave empty to display selection dialog each time
- KERNEL_CONFIGURE ( yes | no ):
- yes: Automatically call kernel's
make menuconfig(add or remove modules or features) - no: Use provided kernel configuration provided by Armbian
- leave empty to display selection dialog each time
- CLEAN_LEVEL (comma-separated list): defines what should be cleaned. Default value is
"make,debs"- clean sources and remove all packages. Changing this option can be useful when rebuilding images or building more than one image - make: execute
make cleanfor selected kernel and U-Boot sources - images: delete
output/images(complete OS images) - debs: delete packages in
output/debsfor current branch and device family - alldebs: delete all packages in
output/debs - cache: delete
cache/rootfs(rootfs cache) - oldcache: remove old
cache/rootfsexcept for the newest eight files - sources: delete
cache/sources(all downloaded sources) - extras: delete additional packages for current release in
output/debs/extra - REPOSITORY_INSTALL (comma-separated list): list of core packages which will be installed from repository
- Available options:
u-boot,kernel,bsp,armbian-bsp-cli,armbian-bsp-desktop,armbian-desktop,armbian-config,armbian-firmware - Set to "" to use packages one from local output or build if not available
- KERNEL\KEEP\CONFIG ( yes | no ):
- yes: use kernel config file from previous compilation for the same branch, device family and version
- no: use default or user-provided config file
- BUILD_MINIMAL ( yes | no ):
- yes: build bare CLI image suitable for application deployment. This option is not compatible with
BUILDDESKTOP="yes"andBUILDEXTERNAL="yes" - no: default CLI package selection
- BUILD_DESKTOP ( yes | no ):
- yes: build image with minimal desktop environment
- no: build image with console interface only
- EXTERNAL ( yes | no ):
- yes: compile and install extra applications and firmware
- BSPFREEZE ( yes | no ):
- yes: freeze (from update) armbian packages when building images (U-Boot, kernel, DTB)
- INSTALL_HEADERS ( no | yes ):
- yes: install kernel headers
- EXTERNAL_NEW ( no | prebuilt | compile ):
- prebuilt: install extra applications from repository
- compile: compile extra applications in chroot
- CREATE_PATCHES ( yes | no ):
- yes: prompt right before the compilation starts to make changes to the source code for both U-Boot and kernel. From these changes patch files will be created and placed in `output` directory. If you want these patches included in a normal run (without CREATE_PATCHES to say) these files need to be copied to the appropriate directories. Also see [user provided patches](https://docs.armbian.com/Developer-Guide_User-Configurations/#user-provided-patches).
- BUILD_ALL ( yes | no | demo ): cycle through all available board and kernel configurations and make images for all combinations
- LIB_TAG ( master | "branchname" ):
- set to
masterto compile from the master branch (default) - set to another "branchname" to compile from any other branch available. Checkherefor available branches
- CARD_DEVICE ( /dev/sdX ): set to the device of your SD card. The image will be burned and verified using Etcher for CLI.
- CRYPTROOT_ENABLE ( yes | no ): enable LUKS encrypted rootfs
-
CRYPTROOT_PASSPHRASE="MYSECRECTPASS"mandatory -
CRYPTROOTSSHUNLOCK=yesDefault:yes -
CRYPTROOT_SSH_UNLOCK_PORT=2222Default:2022 -
CRYPTROOT_PARAMETERS="custom cryptsetup options"Default:--pbkdf pbkdf2(May not contain=; separate with spaces) - Note: This function might not work well with all distributions. Debian Buster and Stretch were tested. For building under Docker you have to use privileged mode which can be enable in
userpatches/config-docker. - **Warning:** This feature was added as community contribution and mostly functional. Under some circumstances though the prompt will not be shown. Therefore it should be considered experimental. Check [here](https://github.com/armbian/build/commit/681e58b6689acda6a957e325f12e7b748faa8330) and [here](https://github.com/armbian/build/issues/1183)
- Hint: If you want to do the encryption part from scratch check outthisforum post.
Hidden options to minimize user input for build automation
- BOARD (
string): set name of board manually to skip dialog prompt - BRANCH (
legacy|current|edge): set kernel and U-Boot branch manually to skip dialog prompt; some options may not be available for all devices - RELEASE (
stretch|buster|bullseye|bionic|focal|hirsute): set OS release manually to skip dialog prompt; use this option withKERNEL_ONLY=yesto create board support package - ARMBIAN_CACHE_ROOTFS_PATH (
string): bind mount cache/rootfs to defined folder - ARMBIAN_CACHE_TOOLCHAIN_PATH (
string): bind mount cache/toolchain path to defined folder
Hidden options for advanced users (default values are marked **bold**)
- EXPERT ( yes | no ): Show development features and boards regardless of its status in interactive mode
- USERPATCHES_PATH ( userpatches/ ): set alternate path for location of
userpatchesfolder - USE_CCACHE ( yes | no ): use a C compiler cache to speed up the build process
- PRIVATE_CCACHE ( yes | no ) use
$DEST/ccacheas ccache home directory - SKIP_EXTERNAL_TOOLCHAINS ( yes | no ) don't download and use Linaro toolchains, by default placed in cache/toolchain (and configurable with ARMBIAN_CACHE_TOOLCHAIN_PATH)
- 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 files
output/debug/*.log - NOAPTCACHER ( yes | no ): disable usage of APT cache. Default
yesin containers, but can be overridden - DISABLE_IPV6 ( true | false ): The distant future, the year Two-Thousand. Set false to allow Aria2c to use a modern ip protocol.
- NO_HOST_RELEASE_CHECK ( yes | no ): overrides the check for a supported host system
- USE_MAINLINE_GOOGLE_MIRROR ( yes | no ): use
googlesource.commirror for downloading mainline kernel sources, may be faster thangit.kernel.orgdepending on your location - USE_GITHUB_UBOOT_MIRROR ( yes | no ): use unofficial Github mirror for downloading mainline U-Boot sources, may be faster than
git.denx.dedepending on your location - SYNC_CLOCK ( yes | no ): sync system clock on builder before start image creation process
- OFFLINE_WORK ( yes | no ): skip downloading and updating sources as well as time and host check. Set to "yes" and you can collect packages without accessing the internet
- FORCEUSERAMDISK ( yes | no ): overrides autodetect for using tmpfs in new debootstrap and image creation process
- FIXEDIMAGESIZE (
integer): create image file of this size (in megabytes) instead of minimal - BOOTSIZE (
integer96 ): set size (in megabytes) for separate /boot filesystem. Used if ROOTFS_TYPE set to non-ext4 - COMPRESS_OUTPUTIMAGE (comma-separated list): create compressed archive with image file and GPG signature for redistribution
- sha: generate SHA256 hash for image
- gpg: sign image using gpg
- 7z: compress image, hash and signature to 7z archive
- gz: compress image only using gz format
- yes: compatibility shorcut for
sha,gpg,7z - SEVENZIP ( yes | no ): create .7z archive with extreme compression ratio instead of .zip
- BUILD_KSRC ( yes | no ): create kernel source packages while building...
- INSTALL_KSRC ( yes | no ): ... and pre-install these kernel sources on the image
- ROOTFS_TYPE ( ext4 | f2fs | btrfs | xfs | nfs | fel ): create image with different root filesystems instead of default
ext4. Requires settingFIXED_IMAGE_SIZEto something smaller than the size of your SD card forF2FS - BTRFSCOMPRESSION ( lzo | none | zlib | zstd ): when choosing
ROOTFSTYPE=btrfsselectbtrfsfilesystem compression method and compression level. By default the compression iszlib.
zstd or setting zlib compression level(zlib:[1-9]) user must ensure kernel version is >=4.14.x. When selecting zstd compression level (
zstd:[1-15]) both the host and the target kernel version must be >=5.1.x since kernel started supporting zstd compression ratio only from 5.1 on. *Note:* The script does not check the legality of input variable (compression ratio). Input like
zlib:1234 is legal to the script but illegal to the kernel. Beware that setting this option does affect image creation only (shrinking disk size) and will not adjust /etc/fstab so it is up to the user to later edit /etc/fstab if compression in daily operation is also wanted (beware of serious performance penalties with random IO patterns and heavy compression algorithms!).- FORCEBOOTSCRIPTUPDATE ( yes | no ):
- yes: force bootscript to get updated during bsp package upgrade
- NAMESERVER (
IPv4 address): the DNS resolver used inside the build chroot. Does not affect the final image. Default:1.0.0.1 - DOWNLOAD_MIRROR (
china|bfsu): select download mirror fortoolchainanddebian/ubuntu packages
china: use mirrors.tuna.tsinghua.edu.cn, it will be very fast thanks to Tsinghua University-
bfsu: use mirrors.bfsu.edu.cn, mirror of Beijing Foreign Studies University - leave empty to use official source
- ARMBIANMIRROR (auto): override automated mirror selection, example 'ARMBIANMIRROR="https://yourlocalmirror.com"'
- MAINLINE_MIRROR (
google|tuna|bfsu): select mainline mirror oflinux-stable.git
google: use mirror provided by Google, the same as USE_MAINLINE_GOOGLE_MIRROR=yes-
tuna: use mirror provided by Tsinghua University-
bfsu: use mirror provided by Beijing Foreign Studies University which is similar to tuna- leave empty to use offical
git.kernel.org, may be very slow for mainland China users- UBOOT_MIRROR (
github|gitee: select mainline mirror ofu-boot.git
github: use mirror provided by github, the same as USE_GITHUB_UBOOT_MIRROR=yes-
gitee: use mirror provided by Gitee, a Chinese git services- leave empty to use offical
source.denx.de, may be very slow for mainland China users- GITHUB_MIRROR (
fastgit|gitclone|cnpmjs): select download mirror for GitHub hosted repository
fastgit: use mirror provided by fastgit.org-
gitclone: use mirror provided by gitclone.com-
cnpmjs: use mirror provided by cnpmjs.org- leave empty to connect directly to GitHub, may be very slow for mainland China users
- REGIONAL_MIRROR (
china): select mirrors based on regional setting, will not overwrite explicitly specified mirror option
china: MAINLINEMIRROR=tuna, UBOOTMIRROR=gitee, GITHUBMIRROR=fastgit, DOWNLOADMIRROR=china- leave empty to use default settings
- USE_TORRENT ( yes | no ): use torrent to download toolchains and rootfs
- ROOT_FS_CREATE_ONLY ( yes | no ): set to yes to force local cache creation
- **EXTRAWIFI** ( **yes** | no ): include several drivers for [WiFi adapters](https://github.com/armbian/build/blob/1914066729b7d0f4ae4463bba2491e3ec37fac84/lib/compilation-prepare.sh#L179-L507)
- WIREGUARD ( yes | no ): include Wireguard for kernels before it got upstreamed to mainline. Will lose functionality soon.
- **AUFS** ( **yes** | no ): Include support for [AUFS](https://en.wikipedia.org/wiki/Aufs)
- SKIP_BOOTSPLASH ( yes | no ): Use kernel bootsplash. Disable in case of troubles
- CONSOLE_AUTOLOGIN ( yes | no ): Automatically login as root for local consoles. Disable if your security threat model requires.
2023-01-19 21:46:18
jiang\n楼主
构建选项
这些参数应应用于
./compile.sh 命令. 它们都是可选的. 它们也可以添加到您的构建配置文件为了省时间. 如果适用,则默认值标记为粗体. 主要选项
- BUILD_ONLY (逗号分隔列表): 定义应该建造哪些固件. 默认值是空字符串 - 将构建所有固件. 更改此选项对于仅构建部分固件可能很有用.
- u-boot: 构建 U-Boot
- kernel: 构建 Kernel
- armbian-config: 构建 Armbian config
- armbian-zsh: 构建 Armbian zsh
- plymouth-theme-armbian: 构建 Armbian Plymouth 主题
- armbian-firmware: 构建 Armbian 固件
- armbian-bsp: 构建 Armbian 板 支持包
- chroot: 构建其他软件包
- bootstrap: 构建引导程序包
- KERNELONLY ( yes | no ) :警告: 警告: 此选项已弃用,可以在以后的版本中删除 - 使用 BUILDONLY
- yes: 仅编译内核, U-Boot 和其他用于在现有Armbian系统上安装的软件包<br>
"u-boot,kernel,armbian-config,armbian-zsh,plymouth-theme-armbian,armbian-firmware,armbian-bsp"- no: 构建完整的操作系统图像以写入SD卡<br>
- 空白以显示选择对话框
- KERNEL_CONFIGURE ( yes | no ):
- yes: Automatically call kernel's
make menuconfig(add or remove modules or features) - no: Use provided kernel configuration provided by Armbian
- 空白以显示选择对话框
- CLEAN_LEVEL (comma-separated list): defines what should be cleaned. Default value is
"make,debs"- clean sources and remove all packages. Changing this option can be useful when rebuilding images or building more than one image - make: execute
make cleanfor selected kernel and U-Boot sources - images: delete
output/images(complete OS images) - debs: delete packages in
output/debsfor current branch and device family - alldebs: delete all packages in
output/debs - cache: delete
cache/rootfs(rootfs cache) - oldcache: remove old
cache/rootfsexcept for the newest eight files - sources: delete
cache/sources(all downloaded sources) - extras: delete additional packages for current release in
output/debs/extra - REPOSITORY_INSTALL (comma-separated list): list of core packages which will be installed from repository
- Available options:
u-boot,kernel,bsp,armbian-bsp-cli,armbian-bsp-desktop,armbian-desktop,armbian-config,armbian-firmware - Set to "" to use packages one from local output or build if not available
- KERNEL\KEEP\CONFIG ( yes | no ):
- yes: use kernel config file from previous compilation for the same branch, device family and version
- no: use default or user-provided config file
- BUILD_MINIMAL ( yes | no ):
- yes: build bare CLI image suitable for application deployment. This option is not compatible with
BUILDDESKTOP="yes"andBUILDEXTERNAL="yes" - no: default CLI package selection
- BUILD_DESKTOP ( yes | no ):
- yes: build image with minimal desktop environment
- no: build image with console interface only
- EXTERNAL ( yes | no ):
- yes: compile and install extra applications and firmware
- BSPFREEZE ( yes | no ):
- yes: freeze (from update) armbian packages when building images (U-Boot, kernel, DTB)
- INSTALL_HEADERS ( no | yes ):
- yes: install kernel headers
- EXTERNAL_NEW ( no | prebuilt | compile ):
- prebuilt: install extra applications from repository
- compile: compile extra applications in chroot
- CREATE_PATCHES ( yes | no ):
- yes: prompt right before the compilation starts to make changes to the source code for both U-Boot and kernel. From these changes patch files will be created and placed in `output` directory. If you want these patches included in a normal run (without CREATE_PATCHES to say) these files need to be copied to the appropriate directories. Also see [user provided patches](https://docs.armbian.com/Developer-Guide_User-Configurations/#user-provided-patches).
- BUILD_ALL ( yes | no | demo ): cycle through all available board and kernel configurations and make images for all combinations
- LIB_TAG ( master | "branchname" ):
- set to
masterto compile from the master branch (default) - set to another "branchname" to compile from any other branch available. Checkherefor available branches
- CARD_DEVICE ( /dev/sdX ): set to the device of your SD card. The image will be burned and verified using Etcher for CLI.
- CRYPTROOT_ENABLE ( yes | no ): enable LUKS encrypted rootfs
-
CRYPTROOT_PASSPHRASE="MYSECRECTPASS"mandatory -
CRYPTROOTSSHUNLOCK=yesDefault:yes -
CRYPTROOT_SSH_UNLOCK_PORT=2222Default:2022 -
CRYPTROOT_PARAMETERS="custom cryptsetup options"Default:--pbkdf pbkdf2(May not contain=; separate with spaces) - Note: This function might not work well with all distributions. Debian Buster and Stretch were tested. For building under Docker you have to use privileged mode which can be enable in
userpatches/config-docker. - **Warning:** This feature was added as community contribution and mostly functional. Under some circumstances though the prompt will not be shown. Therefore it should be considered experimental. Check [here](https://github.com/armbian/build/commit/681e58b6689acda6a957e325f12e7b748faa8330) and [here](https://github.com/armbian/build/issues/1183)
- Hint: If you want to do the encryption part from scratch check outthisforum post.
Hidden options to minimize user input for build automation
- BOARD (
string): set name of board manually to skip dialog prompt - BRANCH (
legacy|current|edge): set kernel and U-Boot branch manually to skip dialog prompt; some options may not be available for all devices - RELEASE (
stretch|buster|bullseye|bionic|focal|hirsute): set OS release manually to skip dialog prompt; use this option withKERNEL_ONLY=yesto create board support package - ARMBIAN_CACHE_ROOTFS_PATH (
string): bind mount cache/rootfs to defined folder - ARMBIAN_CACHE_TOOLCHAIN_PATH (
string): bind mount cache/toolchain path to defined folder
Hidden options for advanced users (default values are marked **bold**)
- EXPERT ( yes | no ): Show development features and boards regardless of its status in interactive mode
- USERPATCHES_PATH ( userpatches/ ): set alternate path for location of
userpatchesfolder - USE_CCACHE ( yes | no ): use a C compiler cache to speed up the build process
- PRIVATE_CCACHE ( yes | no ) use
$DEST/ccacheas ccache home directory - SKIP_EXTERNAL_TOOLCHAINS ( yes | no ) don't download and use Linaro toolchains, by default placed in cache/toolchain (and configurable with ARMBIAN_CACHE_TOOLCHAIN_PATH)
- 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 files
output/debug/*.log - NOAPTCACHER ( yes | no ): disable usage of APT cache. Default
yesin containers, but can be overridden - DISABLE_IPV6 ( true | false ): The distant future, the year Two-Thousand. Set false to allow Aria2c to use a modern ip protocol.
- NO_HOST_RELEASE_CHECK ( yes | no ): overrides the check for a supported host system
- USE_MAINLINE_GOOGLE_MIRROR ( yes | no ): use
googlesource.commirror for downloading mainline kernel sources, may be faster thangit.kernel.orgdepending on your location - USE_GITHUB_UBOOT_MIRROR ( yes | no ): use unofficial Github mirror for downloading mainline U-Boot sources, may be faster than
git.denx.dedepending on your location - SYNC_CLOCK ( yes | no ): sync system clock on builder before start image creation process
- OFFLINE_WORK ( yes | no ): skip downloading and updating sources as well as time and host check. Set to "yes" and you can collect packages without accessing the internet
- FORCEUSERAMDISK ( yes | no ): overrides autodetect for using tmpfs in new debootstrap and image creation process
- FIXEDIMAGESIZE (
integer): create image file of this size (in megabytes) instead of minimal - BOOTSIZE (
integer96 ): set size (in megabytes) for separate /boot filesystem. Used if ROOTFS_TYPE set to non-ext4 - COMPRESS_OUTPUTIMAGE (comma-separated list): create compressed archive with image file and GPG signature for redistribution
- sha: generate SHA256 hash for image
- gpg: sign image using gpg
- 7z: compress image, hash and signature to 7z archive
- gz: compress image only using gz format
- yes: compatibility shorcut for
sha,gpg,7z - SEVENZIP ( yes | no ): create .7z archive with extreme compression ratio instead of .zip
- BUILD_KSRC ( yes | no ): create kernel source packages while building...
- INSTALL_KSRC ( yes | no ): ... and pre-install these kernel sources on the image
- ROOTFS_TYPE ( ext4 | f2fs | btrfs | xfs | nfs | fel ): create image with different root filesystems instead of default
ext4. Requires settingFIXED_IMAGE_SIZEto something smaller than the size of your SD card forF2FS - BTRFSCOMPRESSION ( lzo | none | zlib | zstd ): when choosing
ROOTFSTYPE=btrfsselectbtrfsfilesystem compression method and compression level. By default the compression iszlib.
zstd or setting zlib compression level(zlib:[1-9]) user must ensure kernel version is >=4.14.x. When selecting zstd compression level (
zstd:[1-15]) both the host and the target kernel version must be >=5.1.x since kernel started supporting zstd compression ratio only from 5.1 on. *Note:* The script does not check the legality of input variable (compression ratio). Input like
zlib:1234 is legal to the script but illegal to the kernel. Beware that setting this option does affect image creation only (shrinking disk size) and will not adjust /etc/fstab so it is up to the user to later edit /etc/fstab if compression in daily operation is also wanted (beware of serious performance penalties with random IO patterns and heavy compression algorithms!).- FORCEBOOTSCRIPTUPDATE ( yes | no ):
- yes: force bootscript to get updated during bsp package upgrade
- NAMESERVER (
IPv4 address): the DNS resolver used inside the build chroot. Does not affect the final image. Default:1.0.0.1 - DOWNLOAD_MIRROR (
china|bfsu): select download mirror fortoolchainanddebian/ubuntu packages
china: use mirrors.tuna.tsinghua.edu.cn, it will be very fast thanks to Tsinghua University-
bfsu: use mirrors.bfsu.edu.cn, mirror of Beijing Foreign Studies University - leave empty to use official source
- ARMBIANMIRROR (auto): override automated mirror selection, example 'ARMBIANMIRROR="https://yourlocalmirror.com"'
- MAINLINE_MIRROR (
google|tuna|bfsu): select mainline mirror oflinux-stable.git
google: use mirror provided by Google, the same as USE_MAINLINE_GOOGLE_MIRROR=yes-
tuna: use mirror provided by Tsinghua University-
bfsu: use mirror provided by Beijing Foreign Studies University which is similar to tuna- leave empty to use offical
git.kernel.org, may be very slow for mainland China users- UBOOT_MIRROR (
github|gitee: select mainline mirror ofu-boot.git
github: use mirror provided by github, the same as USE_GITHUB_UBOOT_MIRROR=yes-
gitee: use mirror provided by Gitee, a Chinese git services- leave empty to use offical
source.denx.de, may be very slow for mainland China users- GITHUB_MIRROR (
fastgit|gitclone|cnpmjs): select download mirror for GitHub hosted repository
fastgit: use mirror provided by fastgit.org-
gitclone: use mirror provided by gitclone.com-
cnpmjs: use mirror provided by cnpmjs.org- leave empty to connect directly to GitHub, may be very slow for mainland China users
- REGIONAL_MIRROR (
china): select mirrors based on regional setting, will not overwrite explicitly specified mirror option
china: MAINLINEMIRROR=tuna, UBOOTMIRROR=gitee, GITHUBMIRROR=fastgit, DOWNLOADMIRROR=china- leave empty to use default settings
- USE_TORRENT ( yes | no ): use torrent to download toolchains and rootfs
- ROOT_FS_CREATE_ONLY ( yes | no ): set to yes to force local cache creation
- **EXTRAWIFI** ( **yes** | no ): include several drivers for [WiFi adapters](https://github.com/armbian/build/blob/1914066729b7d0f4ae4463bba2491e3ec37fac84/lib/compilation-prepare.sh#L179-L507)
- WIREGUARD ( yes | no ): include Wireguard for kernels before it got upstreamed to mainline. Will lose functionality soon.
- **AUFS** ( **yes** | no ): Include support for [AUFS](https://en.wikipedia.org/wiki/Aufs)
- SKIP_BOOTSPLASH ( yes | no ): Use kernel bootsplash. Disable in case of troubles
- CONSOLE_AUTOLOGIN ( yes | no ): Automatically login as root for local consoles. Disable if your security threat model requires.