Skip to content
terminal

GitHub Action

Rebuild Armbian and Kernel

Armbian_noble_save_2024.11 Latest version

Rebuild Armbian and Kernel

terminal

Rebuild Armbian and Kernel

Support Amlogic, Rockchip and Allwinner boxes

Installation

Copy and paste the following snippet into your .yml file.

              

- name: Rebuild Armbian and Kernel

uses: ophub/amlogic-s9xxx-armbian@Armbian_noble_save_2024.11

Learn more about this action in ophub/amlogic-s9xxx-armbian

Choose a version

Armbian

View Chinese description | 查看中文说明

Armbian is a lightweight Linux system specially built for ARM chips based on Debian/Ubuntu. The Armbian system is lean, clean, and 100% compatible with and inherits the features and rich software ecosystem of the Debian/Ubuntu system. It can run securely and stably in TF/SD/USB and the device's eMMC. This project preserves the integrity of the official Armbian system and further expands its usage on devices such as TV boxes that are not officially supported. It adds some convenient operation commands. Now, you can replace the Android TV system on your TV box with the Armbian system, turning it into a powerful server.

This project relies on many contributors to build the Armbian system for Amlogic, Rockchip, and Allwinner boxes, supports writing to eMMC for use, supports updating the kernel and other features. Detailed usage can be found in the Armbian User Documentation. The latest Armbian system can be downloaded from Releases. Welcome to Fork and personalize. If it's useful to you, you can click Star in the upper right corner of the repository to show support.

Armbian System Description

SoC Device Kernel Armbian
a311d Khadas-VIM3 All amlogic_a311d.img
s922x Beelink-GT-King, Beelink-GT-King-Pro, Ugoos-AM6-Plus, ODROID-N2, X88-King, Ali-CT2000 All amlogic_s922x.img
s905x3 X96-Max+, HK1-Box, Vontar-X3, H96-Max-X3, Ugoos-X3, TX3(QZ), TX3(BZ), X96-Air, X96-Max+_A100, A95X-F3-Air, Tencent-Aurora-3Pro(s905x3-b), X96-Max+Q1, X96-Max+100W, X96-Max+_2101, Infinity-B32, Whale, X88-Pro-X3, X99-Max-Plus, Transpeed-X3-Plus All amlogic_s905x3.img
s905x2 X96Max-4G, X96Max-2G, MECOOL-KM3-4G, Tanix-Tx5-Max, A95X-F2 All amlogic_s905x2.img
s912 Tanix-TX8-Max, Tanix-TX9-Pro(3G), Tanix-TX9-Pro(2G), Tanix-TX92, Nexbox-A1, Nexbox-A95X-A2, A95X, H96-Pro-Plus, VORKE-Z6-Plus, Mecool-M8S-PRO-L, Vontar-X92, T95Z-Plus, Octopus-Planet, Phicomm-T1, TX3-Mini, OneCloudPro-V1.1_V1.2 All amlogic_s912.img
s905d MECOOL-KI-Pro, Phicomm-N1, SML-5442TW All amlogic_s905d.img
s905x HG680P, B860H, TBee-Box, T95, TX9, XiaoMI-3S, X96 All amlogic_s905x.img
s905w X96-Mini, TX3-Mini, W95, X96W/FunTV, MXQ-Pro-4K All amlogic_s905w.img
s905mb S65 All amlogic_s905mb.img
s905l UNT402A, M201-S, MiBox-4, MiBox-4C, MG101, E900V21C, IP108H-53u1m, Tencent-Aurora-1s, B860AV2.1, B860AV2.1U, HM201 All amlogic_s905l.img
s905l2 MGV2000, MGV2000-K, MGV3000, Wojia-TV-IPBS9505, M301A, E900v21E, e900v21d, CM201-1, IP108H, MGV2000-CW All amlogic_s905l2.img
s905l3 CM211-1, CM311-1, HG680-LC, M401A, UNT400G1, UNT400G, UNT402A, ZXV10-BV310, M411A, ZXV10-B860AV3.2-M, ZXV10-B860AV2.1-U, E900V22D-2, CM201-1-6-YS, IP108H All amlogic_s905l3.img
s905l3a E900V22C/D, CM311-1a-YST, M401A, M411A, UNT403A, UNT413A, ZTE-B863AV3.2-M, CM311-1a-CH, IP112H, B863AV3.1-M2 All amlogic_s905l3a.img
s905l3b CM201-1, CM211-1, CM311-1, E900V21D, E900V22D, E900V21E, E900V22E, M302A/M304A, Hisense-IP103H, TY1608, TY1608, MGV2000, B860AV-2.1M, UNT403A, RG020ET-CA All amlogic_s905l3b.img
s905lb Q96-mini, BesTV-R3300L, SumaVision-Q7, MG101, s65, IPBS9505 All amlogic_s905lb.img
s905 Beelink-Mini-MX-2G, Sunvell-T95M, MXQ-Pro+4K, SumaVision-Q5 All amlogic_s905.img
rk3588 Radxa-Rock5B, Radxa-Rock5C, Orange-Pi-5-Plus, Beelink-IPC-R, HLink-H88K, HLink-H88K-V3, NanoPC-T6 rk3588 rockchip_boxname.img
rk3568 FastRhino-R66S, FastRhino-R68S, Radxa-E25, NanoPi-R5S, NanoPi-R5C, HLink-H66K, HLink-H68K, HLink-H69K, Seewo-sv21, Mrkaio-m68s, Swan1-w28, Ruisen-box rk35xx
6.x.y
rockchip_boxname.img
rk3566 Panther-X2, JP-TvBox, LCKFB-Taishan-Pi rk35xx
6.x.y
rockchip_boxname.img
rk3528 HLink-H28K, Radxa-E20C, H96-Max-M2 rk35xx rockchip_boxname.img
rk3399 EAIDK-610, King3399, TN3399, Kylin3399, ZCube1-Max, CRRC, SMART-AM40, SW799, ZYSJ, DG-3399, DLFR100, Emb3531, Leez-p710, tvi3315a, xiaobao, Fine3399, Firefly-RK3399, LX-R3S, Hugsun-x99, Tb-ls3399, Hisense-hs530r, Tpm312, ZK-rk39a 6.x.y rockchip_boxname.img
rk3328 BeikeYun, Chainedbox-L1-Pro, Station-M1, Bqeel-MVR9, Renegade/Firefly All rockchip_boxname.img
rk3318 RX3318-Box 6.x.y rockchip_boxname.img
h6 Vplus, Tanix-TX6, TQC-A01 6.x.y
h6
allwinner_boxname.img

Tip

At present, the s905 box can only be used in TF/SD/USB. Other models of boxes support writing to EMMC for use. For more information, please refer to the Supported Device List Description. You can refer to the method in Section 12.15 of the instruction document to add new supported devices. Please read the Armbian User Documentation before use. It provides solutions to common issues.

Installation and Upgrade Instructions for Armbian

Choose the Armbian system that corresponds to your box model, and refer to the corresponding instructions for different devices.

  • Install Armbian to EMMC

  1. For Rockchip platform, please refer to the Chapter 8 in the instruction document.

  2. For Amlogic and Allwinner platforms, use tools such as Rufus or balenaEtcher to write the system to a USB stick, then insert the USB stick with the written system into the box. Log in to the Armbian system (default user: root, default password: 1234) → Enter the command:

armbian-install
Optional Default Options Description
-m no yes/no Use mainline u-boot
-a yes yes/no Use ampart partition adjustment tool
-l no yes/no Show a list of all devices

Example: armbian-install -m yes -a no

  • Update Armbian Kernel

Log in to the Armbian system → Enter the command:

# Run as root user (sudo -i)
# If no parameter is specified, it will be updated to the latest version.
armbian-update
Optional Default Options Description
-r ophub/kernel <owner>/<repo> Set the repository to download the kernel from github.com
-u Automation stable/flippy/dev/beta/rk3588/rk35xx/h6 Set the tags suffix of the kernel in use
-k Latest version Kernel version Set the kernel version
-b yes yes/no Automatically back up the current system's kernel when updating the kernel
-m no yes/no Use mainline u-boot
-s None None/DiskName [SOS] Restore the system kernel in eMMC/NVMe/sdX and other disks
-h None None View help

Example: armbian-update -k 5.15.50 -u dev

When specifying the kernel version number through the -k parameter, you can accurately specify a specific version number, for example: armbian-update -k 5.15.50, or you can specify the kernel series vaguely, for example: armbian-update -k 5.15. When vaguely specified, the latest version of the specified series will be automatically used.

When updating the kernel, the currently used kernel will be automatically backed up and stored in the /ddbr/backup directory. The backup keeps the three most recent versions of the kernel. If the newly installed kernel is unstable, you can easily restore the backup kernel at any time. If the kernel update fails and the system cannot boot, you can restore the system kernel using armbian-update -s. For more details, see the Help Document.

  • Replace Armbian sources

Log in to the Armbian system → Enter the command:

armbian-apt

Choosing the appropriate software source for your country or region can improve software download speeds. For more details, see the Help Document.

  • Install Common Software

Log in to the Armbian system → Enter the command:

armbian-software

The command armbian-software -u can update the local software center list. Based on the demand feedback from users in Issue, we gradually integrate commonly used software to achieve one-click installation/update/uninstallation and other shortcut operations. This includes docker images, desktop software, application services, etc. For more details, see the instructions.

  • Modify Armbian Configuration

Log in to the Armbian system → Enter the command:

armbian-config
  • Create swap for Armbian

If you feel that the current box's memory is insufficient when using applications that consume a lot of memory, such as docker, you can create a swap virtual memory partition, virtually using a certain capacity of disk space as memory. The unit of the input parameter of the following command is GB, the default is 1.

Log in to the Armbian system → Enter the command:

armbian-swap 1
  • Control LED Display

Log in to the Armbian system → Enter the command:

armbian-openvfd

Debug according to the LED Screen Display Control Instructions.

  • Backup/Restore EMMC Original System

Supports backing up/restoring the EMMC partition of the box in TF/SD/USB. Before installing the Armbian system in a brand new box, it is recommended that you back up the Android TV system that comes with the current box so that it can be used in the future to restore the TV system and other situations.

Please boot the Armbian system from TF/SD/USB → Enter the command:

armbian-ddbr

Enter b according to the prompt to back up the system, and enter r to restore the system.

Important

In addition, the Android system can also be flashed into eMMC using the method of flashing via a cable. The download image of the Android system can be found in Tools.

  • Compile the Kernel in Armbian

For the usage of compiling the kernel in Armbian, please refer to the Compile Kernel instruction document. Log in to the Armbian system → Enter the command:

armbian-kernel -u
armbian-kernel -k 6.6.12
  • More Usage Instructions

To update all service scripts in the local system to the latest version, you can log in to the Armbian system → Enter the command:

armbian-sync

In the use of Armbian, some common problems that may be encountered can be found in documents

Local Packaging

  1. Clone the repository to local git clone --depth 1 https://github.com/ophub/amlogic-s9xxx-armbian.git

  2. Install the necessary software packages (scripts have only been tested under x86_64 Ubuntu-20.04/22.04)

sudo apt-get update -y
sudo apt-get full-upgrade -y
# For Ubuntu-22.04
sudo apt-get install -y $(cat compile-kernel/tools/script/ubuntu2204-build-armbian-depends)
  1. Enter the ~/amlogic-s9xxx-armbian root directory, create a build/output/images folder in the root directory, and upload the Armbian image file (such as Armbian_21.11.0-trunk_Odroidn2_current_5.15.50.img) to ~/amlogic-s9xxx-armbian/build/output/images directory. Please keep the release version number (such as 21.11.0) and the kernel version number (such as 5.15.50) in the original Armbian image file name. It will be used as the name of the Armbian system after restructuring.

  2. Enter the ~/amlogic-s9xxx-armbian root directory, and then run the sudo ./rebuild -b s905x3 -k 6.6.12 command to generate the Armbian image file for the specified board. The generated file is saved in the build/output/images directory.

  • Local Packaging Parameter Description

Parameter Meaning Description
-b Board Specify the TV box model, such as -b s905x3. Connect multiple models with _, such as -b s905x3_s905d. Use all to represent all models. The model code can be found in the BOARD setting in model_database.conf. Default value: all
-r KernelRepo Specify the <owner>/<repo> of the github.com kernel repository. Default value: ophub/kernel
-u kernelUsage Set the tags suffix of the kernel used, such as stable, flippy, dev, beta. Default value: stable
-k Kernel Specify kernel name, such as -k 6.6.12. Connect multiple kernels with _, such as -k 6.6.12_5.15.50. The kernel version freely specified by the -k parameter is only valid for kernels using stable/flippy/dev/beta. Other kernel series such as rk3588 / rk35xx / h6 can only use specific kernels.
-a AutoKernel Set whether to automatically adopt the latest version of the same series of kernels. When it is true, it will automatically look for whether there is a newer version of the same series in the kernel library in the kernel specified in -k, such as 6.6.12. If there is a latest version after 6.6.12, it will be automatically changed to the latest version. When set to false, it will compile the specified version of the kernel. Default value: true
-t RootfsType Set the file system type of the system's ROOTFS partition, the options are ext4 or btrfs type. For example: -t btrfs. Default value: ext4
-s Size Set the size of the system's image partitions. When setting only the ROOTFS partition size, you can specify a single value, for example: -s 2560. When setting both BOOTFS and ROOTFS partition sizes, use / to connect the two values, for example: -s 512/2560. The default value is 512/2560
-n BuilderName Set the Armbian system builder signature. Do not include spaces when setting the signature. Default value: None
  • sudo ./rebuild: Use the default configuration to package all models of TV boxes.
  • sudo ./rebuild -b s905x3 -k 6.6.12: Recommended. Use the default configuration to package related kernels.
  • sudo ./rebuild -b s905x3 -k 6.1.y : Package the relevant kernels using the default configuration; the kernel utilizes the latest version of the 6.1.y series.
  • sudo ./rebuild -b s905x3_s905d -k 6.6.12_5.15.50: Use the default configuration, package multiple kernels at the same time. Use _ to connect multiple kernel parameters.
  • sudo ./rebuild -b s905x3 -k 6.6.12 -s 2560: Use the default configuration, specify a kernel, a model for packaging, the system size is set to 2560MiB.
  • sudo ./rebuild -b s905x3_s905d Use the default configuration, package all kernels for multiple models of TV boxes, use _ to connect multiple models.
  • sudo ./rebuild -k 6.6.12_5.15.50: Use the default configuration, specify multiple kernels, and package all models of TV boxes, the kernel package uses _ for connection.
  • sudo ./rebuild -k 6.6.12_5.15.50 -a true: Use the default configuration, specify multiple kernels, and package all models of TV boxes, the kernel package uses _ for connection. Automatically upgrade to the latest kernel of the same series.
  • sudo ./rebuild -t btrfs -s 2560 -k 6.6.12: Use the default configuration, set the file system to btrfs format, the partition size is 2560MiB, and specify the kernel as 6.6.12, package for all models of TV boxes.

Use GitHub Actions for Compilation

  1. The configuration of the Workflows file can be found in the build-armbian.yml file.

  2. Full compile: On the Actions page, select Build armbian. According to the OS versions supported by Armbian official, you can choose the Ubuntu series: jammy, or the Debian series: bullseye etc. Click the Run workflow button to compile. More parameter setting methods can be found in the Armbian official documentation.

  3. Recompile: If there are already compiled Armbian_.*-trunk_.*.img.gz files in Releases, and you just want to make another box of different boards, you can skip the compilation of Armbian source files and proceed with the second production directly. On the Actions page, select Use Releases file to build armbian, and click the Run workflow button to compile again.

  4. Use other Armbian systems, such as the odroidn2 system provided by the Armbian official system download website armbian.tnahosting.net, and only introduce the script of this repository in the process control file rebuild-armbian.yml to restructure Armbian, which can be adapted to the use of other boxes. On the Actions page, select Rebuild armbian, input the network download address of Armbian like https://dl.armbian.com/*/Armbian_*.img.xz, or set the loading path of the restructuring file in the process control file rebuild-armbian.yml through the armbian_path parameter. The code is as follows:

- name: Rebuild Armbian
  uses: ophub/amlogic-s9xxx-armbian@main
  with:
    build_target: armbian
    armbian_path: build/output/images/*.img
    armbian_board: s905d_s905x3_s922x_s905x
    armbian_kernel: 6.1.y_5.15.y
  • GitHub Actions Input Parameter Description

The related parameters correspond to the local packaging command, please refer to the above description.

Parameter Default Description
armbian_path None Set the path of the original Armbian file, support the file path in the current workflow such as build/output/images/*.img, and also support the network download address such as: https://dl.armbian.com/*/Armbian_*.img.xz
armbian_board all Set the board of the package box, refer to -b
kernel_repo ophub/kernel Specify <owner>/<repo> of the github.com kernel repository, refer to -r
kernel_usage stable Set the tags suffix of the used kernel. Refer to -u
armbian_kernel 6.1.y_5.15.y Set the version of the kernel, refer to -k
auto_kernel true Set whether to automatically adopt the latest version of the same series kernel, refer to -a
armbian_fstype ext4 Set the file system type of the system's ROOTFS partition, refer to -t
armbian_size 512/2560 Set the size of the system BOOTFS and ROOTFS partitions, function reference -s
builder_name None Set the Armbian system builder signature, refer to -n
  • GitHub Actions Output Variable Description

To upload to Releases, you need to set Workflow read/write permissions for repository. For details, see the usage instructions.

Parameter Default Description
${{ env.PACKAGED_OUTPUTPATH }} out Armbian system files output path
${{ env.PACKAGED_OUTPUTDATE }} 04.13.1058 Packaging date (month.day.hourminute)
${{ env.PACKAGED_STATUS }} success Packaging status: success / failure

Default Information for Armbian System

Name Value
Default IP Obtain IP from router
Default account root
Default password 1234

Compiling Kernel using GitHub Actions

For the method of compiling the kernel, refer to compile-kernel

- name: Compile the kernel
  uses: ophub/amlogic-s9xxx-armbian@main
  with:
    build_target: kernel
    kernel_version: 6.1.y_5.15.y
    kernel_auto: true
    kernel_sign: -yourname

Armbian Contributors

First of all, thanks to 150balbes for the outstanding contributions and the solid foundation laid for using Armbian in Amlogic TV boxes. The Armbian system compiled here directly uses the latest source code from the official in real-time. The development ideas of the program come from tutorials from authors such as ebkso. Thank you all for your dedication and sharing, allowing us to use the Armbian system in more boxes.

The u-boot, kernel and other resources used in this system are mainly copied from the unifreq/openwrt_packit project, and some files are provided by users in Pull and Issues of projects such as amlogic-s9xxx-openwrt, amlogic-s9xxx-armbian, luci-app-amlogic, u-boot and kernel. To thank these pioneers and sharers, from now on (this source code repository was created on 2021-09-19), I have recorded it uniformly in CONTRIBUTORS.md. Thanks again to everyone for giving the box a new life and meaning.

Other Distributions

  • The amlogic-s9xxx-openwrt project provides the OpenWrt system used in the box, which is also applicable to devices that support Armbian.
  • unifreq has made OpenWrt system for more boxes such as Amlogic, Rockchip, and Allwinner, which is a benchmark in the box circle and recommended to use.
  • Scirese tested the production, installation, and use of Arch Linux ARM / Manjaro system in Android TV boxes, for details refer to the relevant instructions in his repository.
  • 7Ji has published some articles on reverse engineering and development on the Amlogic platform in his blog, such as installing the ArchLinux ARM system in the way of ArchLinux, an introduction to the boot mechanism of the Amlogic platform, etc. In his ampart project, a partition tool is provided that can read and edit the Amlogic eMMC partition table and DTB internal partition, and can utilize 100% of eMMC space. The amlogic-s9xxx-archlinuxarm project provides the production and use method of Arch Linux ARM system. In the YAopenvfD project, another openvfd daemon is provided.
  • 13584452567 is the pioneer for the Rockchip series of devices in this repository, having expanded support for numerous Rockchip devices like EAIDK-610, King3399, TN3399, Kylin3399, ZCube1-Max, tvi3315a, xiaobao and more, thanks to his sharing. Additionally, he remains the maintainer of specialized kernels for Allwinner devices like TQC-A01. Having provided a wealth of tech support and solutions within Discussions and Issues sections, he's made significant contributions to the development of the box circle.
  • cooip-jm shares many Armbian, lxc, docker, AdGuard, etc. usage methods in his wiki, recommended learning.

Links

License

The amlogic-s9xxx-armbian © OPHUB is licensed under GPL-2.0