Skip to content

Latest commit

 

History

History
 
 

armbian-docs

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

How to build and use Armbian

View Chinese description | 查看中文说明

GitHub Actions is a service launched by Microsoft. It provides a virtual server environment with very good performance configuration. Based on it, projects can be built, tested, packaged, and deployed. The public repository can be used for free without time limit, and the single compilation time is up to 6 hours, which is enough for compiling Armbian (we can usually complete a compilation in about 3 hours). Sharing is only for the exchange of experience. Please understand the deficiencies. Please do not initiate various bad attacks on the Internet, and do not maliciously use it.

Tutorial directory

1. Register your own GitHub account

Register your own account, so that you can continue to customize the firmware. Click the Sign up button in the upper right corner of the github.com website and follow the prompts to register your account.

2. Set the privacy variable GitHub_TOKEN

Set the GitHub privacy variable GitHub_TOKEN. After the firmware is compiled, we need to upload the firmware to GitHub Releases. We set this variable according to the official requirements of GitHub. The method is as follows: Personal center: Settings > Developer settings > Personal access tokens > Generate new token ( Name: GitHub_TOKEN, Select: public_repo ). Other options can be selected according to your needs. Submit and save, copy the Encrypted KEY Value generated by the system, and save it to your computer's notepad first. This value will be used in the next step. The icons are as follows:

3. Fork repository and set GH_TOKEN

Now you can Fork the repository, open the repository https://github.com/ophub/amlogic-s9xxx-armbian, click the Fork button on the upper right, Will copy a copy of the repository code to your account, wait a few seconds, and prompt the Fork to complete Later, go to your account to access amlogic-s9xxx-armbian in your repository. In the upper right corner of Settings > Secrets > Actions > New repostiory secret (Name: GH_TOKEN, Value: Fill in the value of GitHub_TOKEN just now), save it. And select Read and write permissions under Actions > General > Workflow permissions in the left nav and save. The icons are as follows:

4. Personalized Armbian firmware customization file description

The firmware compilation process is controlled in the .github/workflows/build-armbian.yml file. There are other yml files in the workflows directory to achieve other different functions. When compiling the firmware, the Armbian official current code is used for real-time compilation, and the relevant parameters can be found in the official documentation.

- name: Compile Armbian [ ${{ env.ARMBIAN_BOARD }} ]
  id: compile
  run: |
    cd build/
    sudo chmod +x compile.sh
    sudo ./compile.sh BRANCH=${{ env.ARMBIAN_BRANCH }} RELEASE=${{ env.ARMBIAN_RELEASE }} BOARD=${{ env.ARMBIAN_BOARD }} \
                      BUILD_MINIMAL=no BUILD_DESKTOP=no HOST=armbian KERNEL_ONLY=no KERNEL_CONFIGURE=no \
                      CLEAN_LEVEL=make,debs COMPRESS_OUTPUTIMAGE=sha
    echo "::set-output name=status::success"

5. Compile the firmware

There are many ways to compile firmware, you can set timed compilation, manual compilation, or set some specific events to trigger compilation. Let's start with simple operations.

5.1 Manual compilation

In the navigation bar of your repository, click the Actions button, and then click Build armbian > Run workflow > Run workflow to start the compilation, wait about 3 hours, and complete the compilation after all the processes are over. The icons are as follows:

5.2 Compile at the agreed time

In the .github/workflows/build-armbian.yml file, use cron to set the timing compilation. The 5 different positions represent min (0 - 59) / hour (0 - 23) / day of month (1 - 31) / month (1 - 12) / day of week (0 - 6)(Sunday - Saturday). Set the time by modifying the values of different positions. The system uses UTC standard time by default, please convert it according to the time zone of your country.

schedule:
  - cron: '0 17 * * *'

6. Save the firmware

The settings saved by the firmware are also controlled in the .github/workflows/build-armbian.yml file. We will automatically upload the compiled firmware to the Releases officially provided by GitHub through scripts.

- name: Upload Armbian Firmware to Release
  uses: ncipollo/release-action@main
  if: steps.build.outputs.status == 'success' && env.UPLOAD_RELEASE == 'true' && !cancelled()
  with:
    tag: Armbian_${{ env.FILE_DATE }}
    artifacts: ${{ env.FILEPATH }}/*
    allowUpdates: true
    token: ${{ secrets.GH_TOKEN }}
    body: |
      This is Armbian firmware for Amlogic s9xxx TV Boxes
      * Firmware information
      Default username: root
      Default password: 1234

7. Download the firmware

Enter from the GitHub Releases section at the bottom right corner of the Repository homepage, and select the firmware corresponding to the model of your Amlogic s9xxx TV Boxes. The icons are as follows:

8. Install Armbian to EMMC

Login in to armbian (default user: root, default password: 1234) → input command:

armbian-install

The mainline u-boot is installed by default, In order to support the use of 5.10 and above kernels. If you choose not to install, specify it in the 1 input parameter, e.g. armbian-install no

9. Compile the Armbian kernel

Supports compiling the kernel in Ubuntu20.04/22.04 or Armbian system. It supports local compilation and cloud compilation using GitHub Actions. For details, see Kernel Compilation Instructions.

10. Update Armbian Kernel

Login in to armbian → input command:

# Run as root user (sudo -i)
# If no other parameters are specified, the following update command will update to the latest version of the current kernel of the same series.
armbian-update

If there is a set of kernel files in the current directory, it will be updated with the kernel in the current directory (The 4 kernel files required for the update are header-xxx.tar.gz, boot-xxx.tar.gz, dtb-amlogic-xxx.tar.gz, modules-xxx.tar.gz. Other kernel files are not required. If they exist at the same time, it will not affect the update. The system can accurately identify the required kernel files). If there is no kernel file in the current directory, it will query and download the latest kernel of the same series from the server for update. You can also query the optional kernel version and update the specified version: armbian-update 5.10.100. The optional kernel supported by the device can be freely updated, such as from 5.10.100 kernel to 5.15.25 kernel. When the kernel is updated, By default, download from stable kernel version branch, if you download other version branch, please specify according to the branch folder name in the 2 parameter, such as armbian-update 5.7.19 dev . The mainline u-boot will be installed automatically by default, which has better support for kernels using versions above 5.10. If you choose not to install, please specify it in the 3 input parameter, such as armbian-update 5.10.100 stable no

The headers files in the kernel is installed in the /use/local/include directory.

11. common problem

In the use of Armbian, some common problems that may be encountered are summarized below.

11.1 dtb and u-boot correspondence table for each box

Please refer to Description

11.2 LED screen display control instructions

Please refer to Description

11.3 How to restore the original Android TV system

Usually use armbian-ddbr backup to restore, or use Amlogic usb burning tool to restore the original Android TV system.

11.3.1 Restoring using armbian-ddbr backup

It is recommended that you make a backup of the original Android TV system that comes with the current box before installing the Armbian system in a new box, so that you can use it when you need to restore the system. Please boot the Armbian system from TF/SD/USB, enter the armbian-ddbr command, and then enter b according to the prompts to backup the system. The backup file is stored in the path /ddbr/BACKUP-arm-64-emmc. img.gz , please download and save. When you need to restore the Android TV system, upload the previously backed up files to the same path of the TF/SD/USB device, enter the armbian-ddbr command, and then enter r according to the prompt to restore the system.

11.3.2 Restoring with Amlogic usb burning tool

  • Under normal circumstances, re-insert the USB hard disk and install it again.

  • If you cannot start the Armbian system from the USB hard disk again, connect the Amlogic s9xxx TV Boxes to the computer monitor. If the screen is completely black and there is nothing, you need to restore the Amlogic s9xxx TV Boxes to factory settings first, and then reinstall it. First download the amlogic_usb_burning_tool system recovery tool and install it. Prepare a USB dual male data cable, Prepare a paper clip.

  • Take x96max+ as an example. Find the two short-circuit points on the motherboard, Download the Android TV firmware. The Android TV system firmware of other common devices and the corresponding short circuit diagrams can also be downloaded and viewed here.

Operation method:

1. Open the USB Burning Tool:
   [ File → Import image ]: X96Max_Plus2_20191213-1457_ATV9_davietPDA_v1.5.img
   [ Check ]:Erase flash
   [ Check ]:Erase bootloader
   Click the [ Start ] button
2. Use a [ paper clip ] to connect the [ two shorting points ] on the main board of the box,
   and use a [ USB dual male data cable ] to connect the [ box ] to the [ computer ] at the same time.
3. Loosen the short contact after seeing the [ progress bar moving ].
4. After the [ progress bar is 100% ], the restoration of the original Android TV system is completed.
   Click [ stop ], unplug the [ USB male-to-male data cable ] and [ power ].
5. If the progress bar is interrupted, repeat the above steps until it succeeds.
   If the progress bar does not respond after the short-circuit, plug in the [ power ] supply after the short-circuit.
   Generally, there is no need to plug in the power supply.

When the factory reset is completed, the box has been restored to the Android TV system, and other operations to install the Armbian system are the same as the requirements when you installed the system for the first time before, just do it again.

11.4 Set the box to boot from USB/TF/SD

  • Write the firmware to USB/TF/SD, insert it into the box after writing.
  • Open the developer mode: Settings → About this machine → Version number (for example: X96max plus...), click on the version number for 5 times in quick succession, See the prompt of Enable Developer Mode displayed by the system.
  • Turn on USB debugging: System → Advanced options → Developer options again (after entering, confirm that the status is on, and the USB debugging status in the list is also on). Enable ADB debugging.
  • Install ADB tools: Download adb and unzip it, copy the three files adb.exe, AdbWinApi.dll, and AdbWinUsbApi.dll to the two files system32 and syswow64 under the directory of c://windows/ Folder, then open the cmd command panel, use adb --version command, if it is displayed, it is ready to use.
  • Enter the cmd command mode. Enter the adb connect 192.168.1.137 command (the ip is modified according to your box, and you can check it in the router device connected to the box), If the link is successful, it will display connected to 192.168.1.137:5555
  • Enter the adb shell reboot update command, the box will restart and boot from the USB/TF/SD you inserted, access the firmware IP address from a browser, or SSH to enter the firmware.

11.5 Disable infrared receiver

Support for the infrared receiver is enabled by default but if you are using your TV box as a server then you may wish to disable the IR kernel module to prevent switching your TV box off by mistake. To completely disable IR, add the line:

blacklist meson_ir

to /etc/modprobe.d/blacklist.conf and reboot.

11.6 Selection of bootstrap file

In general, just use /boot/uEnv.txt. The /boot/extlinux/extlinux.conf file is required for individual devices, such as T95 (s905x) / T95Z-Plus (s912) etc. If necessary, delete the .bak in the /boot/extlinux/extlinux.conf.bak file name that comes with the firmware to use it. armbian-install automatically checks when writing to eMMC and creates an extlinux.conf file if it exists.