• Stars
    star
    1,737
  • Rank 26,819 (Top 0.6 %)
  • Language
    Shell
  • License
    GNU General Publi...
  • Created almost 4 years ago
  • Updated 4 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Support for OpenWrt in Amlogic, Rockchip and Allwinner boxes. Support a311d, s922x, s905x3, s905x2, s912, s905d, s905x, s905w, s905, s905l, rk3588, rk3568, rk3399, rk3328, h6, etc.

OpenWrt

View Chinese description | 查看中文说明

OpenWrt is a Linux-based router operating system designed for embedded devices. Unlike a single, unmodifiable firmware, OpenWrt provides a fully writable file system with package management capabilities, allowing users to freely choose the software packages they need to customize their router system. For developers, OpenWrt is a framework that allows them to develop applications without having to build a complete firmware around it. For regular users, this means having the ability to fully customize and use the device in unexpected ways. It offers over 3000 standardized application software packages and extensive third-party plugin support, making it easy to apply them to various supported devices. Now you can replace the Android TV system on your TV box with OpenWrt, turning it into a powerful router.

This project relies on many contributors to build OpenWrt systems for Amlogic, Rockchip, and Allwinner boxes. It supports writing to eMMC, updating the kernel, and other functions. For detailed instructions on how to use it, please refer to the OpenWrt Documentation. The latest firmware can be downloaded from Releases. You are welcome to Fork and customize the software package according to your needs. If it is useful to you, please click Star in the upper right corner of the repository to show your support.

OpenWrt System Description

SoC Device Kernel OpenWrt
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, A95XF3-Air, Tencent-Aurora-3Pro(s905x3-b), X96-Max+Q1, X96-Max+100W, X96-Max+_2101, Infinity-B32, Whale 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 All amlogic_s912.img
s905d MECOOL-KI-Pro, Phicomm-N1 All amlogic_s905d.img
s905x HG680P, B860H, TBee-Box, T95, TX9, XiaoMI-3S All amlogic_s905x.img
s905w X96-Mini, TX3-Mini, W95, X96W/FunTV, MXQ-Pro-4K All amlogic_s905w.img
s905l2 MGV2000, MGV3000, Wojia-TV-IPBS9505, M301A, E900v21E All amlogic_s905l2.img
s905l3 CM211-1, CM311-1, HG680-LC, M401A, UNT400G1 All amlogic_s905l3.img
s905l3a E900V22C/D, CM311-1a-YST, M401A, M411A, UNT403A, UNT413A, ZTE-B863AV3.2-M All amlogic_s905l3a.img
s905l3b CM211-1, CM311-1, E900V22D, E900V22E, M302A/M304A, Hisense-IP103H, TY1608 All amlogic_s905l3b.img
s905lb Q96-mini, BesTV-R3300L, SumaVision-Q7 All amlogic_s905lb.img
s905 Beelink-Mini-MX-2G, Sunvell-T95M, MXQ-Pro+4K, SumaVision-Q5 All amlogic_s905.img
rk3588 Radxa-Rock5B, HinLink-H88K, Beelink-IPC-R rk3588 rockchip_boxname.img
rk3568 FastRhino-R66S, FastRhino-R68S, HinLink-H66K, HinLink-H68K, Radxa-E25, NanoPi-R5S 6.x.y rockchip_boxname.img
rk3566 Panther-X2 6.x.y rockchip_boxname.img
rk3399 EAIDK-610, King3399, TN3399, Kylin3399, ZCube1-Max, CRRC, SMART-AM40, SW799, ZYSJ 6.x.y rockchip_boxname.img
rk3328 BeikeYun, L1-Pro, Station-M1, Bqeel-MVR9 All rockchip_boxname.img
h6 Vplus, Tanix-TX6 All allwinner_boxname.img

💡Note: Currently, s905 boxes can only be used with TF/SD/USB, while other models of boxes can support writing to EMMC. For more information, please refer to the Supported Device List Description. You can refer to Chapter 12.15 of the documentation for the method on Adding New Supported Devices.

Installation and Upgrade Instructions

Select the OpenWrt image that corresponds to your TV box model and refer to the corresponding instructions for usage of different devices.

  • Install OpenWrt

  1. For installation instructions on the Rockchip platform, please refer to Chapter 8 in the Documentation. The installation process is the same as that for Armbian.

  2. For the Amlogic and Allwinner platforms, use tools such as Rufus or balenaEtcher to write the firmware into a USB drive, then insert the USB into the device. Access OpenWrt's default IP address from your browser: 192.168.1.1 → log in to OpenWrt using the default credentials → System Menu → Amlogic Service → Install OpenWrt. Select your device from the list of supported devices, and click the Install OpenWrt button to start the installation process.

  • Update OpenWrt

Access OpenWrt's IP address from your browser, such as 192.168.1.1 → Log in to OpenWrt using the account → System Menu → Amlogic Service → Manually Upload Update / Download Update Online. From there, you can choose to manually upload an update or download an update online.

If you choose to Manually Upload Update, you can upload the compiled OpenWrt firmware package, such as openwrt_xxx_k5.15.50.img.gz (it is recommended to upload the compressed package, as the system will automatically decompress it). If you upload a xxx.img format file that has been decompressed, the upload may fail due to its large size. Once the upload is complete, the interface will display an Update Firmware button. Click this button to update the firmware.

If you choose to Manually Upload Update, you can upload the 3 kernel files boot-xxx.tar.gz, dtb-xxx.tar.gz, and modules-xxx.tar.gz (other kernel files are not required, but uploading them will not affect the update, as the system can accurately identify the necessary kernel files). Once the upload is complete, the interface will display an Update Kernel button. Click this button to update the kernel.

If you choose to Download Update Online for OpenWrt firmware or kernel, it will be downloaded based on the Firmware Download Address and Kernel Download Address settings in the plugin. You can customize and modify the download source. For detailed instructions on how to do this, please refer to the compilation and usage instructions of luci-app-amlogic.

  • Creating swap for OpenWrt

If you are using memory-intensive applications such as docker and find that the current box doesn't have enough memory, you can create a swap virtual memory partition that virtualizes a certain capacity of /mnt/*4 disk space to use as memory. The unit used in the following command input parameters is GB, and the default is 1.

Access OpenWrt's default IP 192.168.1.1 from your browser → Log in to OpenWrt using the default account → System Menu → TTYD Terminal → Enter the following command:

openwrt-swap 1
  • Backing up/Restoring eMMC Original System

Support for backing up/restoring eMMC partitions using TF/SD/USB. Before installing OpenWrt on your box, it is recommended to backup the pre-installed Android TV system in case you need to restore it later.

Boot the OpenWrt system from TF/SD/USB, access OpenWrt's default IP 192.168.1.1 from your browser → Log in to OpenWrt using the default account → System Menu → TTYD Terminal → Enter the following command:

openwrt-ddbr

Follow the prompt to enter b to backup the system or r to restore the system.

  • Controlling the LED display

Access OpenWrt's default IP 192.168.1.1 from your browser → Log in to OpenWrt using the default account → System Menu → TTYD Terminal → Enter the following command:

openwrt-openvfd

Follow the LED Screen Display Control Instructions for debugging.

  • More usage instructions

Using the firstboot command allows you to restore the system to its initial state. For common issues that may be encountered when using OpenWrt, please refer to the documentation.

Local build instructions

  1. Installing necessary build dependencies (for Ubuntu 22.04 LTS users)
sudo apt-get update -y
sudo apt-get full-upgrade -y
# For Ubuntu-22.04
sudo apt-get install -y $(curl -fsSL https://is.gd/depend_ubuntu2204_openwrt)
  1. Clone the repository to your local machine using git clone --depth 1 https://github.com/ophub/amlogic-s9xxx-openwrt.git.
  2. Create a openwrt-armvirt folder in the root directory of ~/amlogic-s9xxx-openwrt and upload the openwrt-armvirt-64-default-rootfs.tar.gz file to this directory.
  3. In the root directory of ~/amlogic-s9xxx-openwrt, enter the packaging command, such as sudo ./make -b s905x3 -k 6.1.10. The OpenWrt firmware generated by the packaging process will be placed in the out folder in the root directory.
  • Local packaging parameters

Parameter Meaning Description
-b Board Specify the TV box model using -b, such as -b s905x3. Multiple models can be specified using _, such as -b s905x3_s905d. Use all to indicate all models. Model codes can be found in the BOARD setting of model_database.conf. The default value is all.
-r KernelRepo Specify the <owner>/<repo> of the kernel repository on github.com. The default value is ophub/kernel.
-u kernelUsage Set the tags suffix of the kernel to be used, such as stable, flippy, dev. The default value is stable.
-k Kernel Specify the kernel name, such as -k 5.10.125. Multiple kernels can be specified using _, such as -k 5.10.125_5.15.50. The kernel version specified by the -k parameter is only valid for the stable/flippy/dev kernel series. Other kernel series such as rk3588 can only use specific kernels.
-a AutoKernel Set whether to automatically use the latest version of the same series kernel. When set to true, it will automatically search for newer versions of the same series specified in -k, such as version 5.10.125, and if there is a newer version after 5.10.125, it will be replaced with the latest version automatically. When set to false, the specified version of the kernel will be compiled. The default value is true.
-s Size Set the size of the ROOTFS partition of the system, which must be greater than 2048MiB. For example: -s 2560. The default value is 2560.
-g GH_TOKEN Optional. Set ${{ secrets.GH_TOKEN }} for querying api.github.com. The default value is none.
  • sudo ./make: Package for all TV box models using the latest kernel package in the kernel library with default configuration.
  • sudo ./make -b s905x3 -k 6.1.10: Package for a specific model (s905x3) and kernel version (6.1.10) with default configuration (recommended).
  • sudo ./make -b s905x3_s905d -k 6.1.10_5.15.50: Package for multiple models (s905x3 and s905d) and kernels (6.1.10 and 5.15.50) simultaneously with default configuration.
  • sudo ./make -b s905x3 -k 6.1.10 -s 1024: Package for a specific model (s905x3) and kernel version (6.1.10) with default configuration, and set the firmware size to 1024 MiB.
  • sudo ./make -b s905x3_s905d: Package for all models (s905x3 and s905d) with default configuration and all available kernels.
  • sudo ./make -k 6.1.10_5.15.50: Package for all TV box models with multiple specified kernel versions (6.1.10 and 5.15.50) with default configuration.
  • sudo ./make -k 6.1.10_5.15.50 -a true: Package for all TV box models with multiple specified kernel versions (6.1.10 and 5.15.50) with default configuration, and automatically upgrade to the latest version of the same series kernel if available.
  • sudo ./make -s 1024 -k 6.1.10: Package for all TV box models with a specific kernel version (6.1.10) and set the firmware size to 1024 MiB with default configuration.

Compiling with GitHub Actions

You can customize and compile OpenWrt firmware that suits you by modifying the personalized firmware configuration files in the config-openwrt directory, as well as the .yml files. The firmware can be uploaded to Actions and Releases on github.com.

  1. You can find personalized firmware configuration instructions in the documentation. The workflow control file is .yml.
  2. Freshly compile: On github.com's Action page, select Build OpenWrt. Click the Run workflow button to perform one-stop firmware compilation and packaging.
  3. Re-compile: If there is already a compiled openwrt-armvirt-64-default-rootfs.tar.gz file in Releases, and you only want to make another box of a different board, you can skip compiling the OpenWrt source file and go directly to the secondary production. On the Actions page, select Use Releases file to Packaging and click the Run workflow button to re-compile.
  4. More support: The compiled openwrt-armvirt-64-default-rootfs.tar.gz file is a universal file for making various board firmware. It is also suitable for making OpenWrt firmware using unifreq's packaging script. As the pioneer of using OpenWrt and Armbian systems in boxes, it supports more devices, such as OpenWrt used in Armbian system through KVM virtual machine (QEMU version), Amlogic, Rockchip, and Allwinner series. For packaging methods, please refer to its repository instructions. You can call his packaging script to make more firmware through packaging-openwrt-for-qemu-etc.yml in Actions.
- name: Package Armvirt as OpenWrt
  uses: ophub/amlogic-s9xxx-openwrt@main
  with:
    openwrt_path: openwrt/bin/targets/*/*/*rootfs.tar.gz
    openwrt_board: s905x3_s905x2_s905x_s905w_s905d_s922x_s912
    openwrt_kernel: 6.1.10_5.15.50
    gh_token: ${{ secrets.GH_TOKEN }}
  • GitHub Actions Input Parameter Description

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

Parameter Defaults Description
openwrt_path None You can set the file path of openwrt-armvirt-64-default-rootfs.tar.gz using a relative path such as openwrt/bin/targets/*/*/*rootfs.tar.gz or a network file download address such as https://github.com/*/releases/*/*rootfs.tar.gz.
openwrt_board all You can set the board for packaging the box, which is equivalent to using -b function.
kernel_repo ophub/kernel You can specify the <owner>/<repo> of the GitHub kernel repository, which is equivalent to using the -r function.
kernel_usage stable You can set the tags suffix of the kernel used, which is equivalent to using the -u function.
openwrt_kernel 6.1.1_5.15.1 You can set the kernel version, which is equivalent to using the -k function.
auto_kernel true You can set whether to automatically use the latest kernel version in the same series, which is equivalent to using the -a function.
openwrt_size 1024 You can set the size of the firmware rootfs partition, which is equivalent to using the -s function.
gh_token None This is an optional parameter. You can set ${{ secrets.GH_TOKEN }}, which is equivalent to using the -g function.
  • GitHub Actions Output Variable Description

To upload to Releases, you need to add ${{ secrets.GITHUB_TOKEN }} and ${{ secrets.GH_TOKEN }} to the repository and set Workflow read/write permissions. For more information, please refer to the usage instructions.

Parameter For example Description
${{ env.PACKAGED_OUTPUTPATH }} out OpenWrt firmware storage path
${{ env.PACKAGED_OUTPUTDATE }} 04.13.1058 Packing date(month.day.hour.minute)
${{ env.PACKAGED_STATUS }} success / failure Package status

openwrt-*-rootfs.tar.gz Firmware compilation parameters

Option Value
Target System QEMU ARM Virtual Machine
Subtarget QEMU ARMv8 Virtual Machine(cortex-a53)
Target Profile Default
Target Images tar.gz

For more instructions please see: documents

OpenWrt firmware default information

Name Value
Default IP 192.168.1.1
Default username root
Default password password
Default WIFI name OpenWrt
Default WIFI password none

Compile the kernel

For more information on how to compile the kernel, please refer to compile-kernel.

- name: Compile the kernel
  uses: ophub/amlogic-s9xxx-armbian@main
  with:
    build_target: kernel
    kernel_version: 6.1.10_5.15.50
    kernel_auto: true
    kernel_sign: -yourname

Resource Description

When making the OpenWrt system, the kernel and u-boot files used are the same as those used to make the Armbian system. In order to avoid duplicate maintenance, the relevant content is classified and placed in the corresponding resource repository, and will be automatically downloaded from the relevant repository when used.

The kernel / u-boot and other resources used by this system are mainly copied from the unifreq/openwrt_packit project, and some files are shared by users in the Pulls and Issues of projects such as amlogic-s9xxx-openwrt / amlogic-s9xxx-armbian / luci-app-amlogic / kernel. Unifreq opened the door for us to use OpenWrt on TV boxes, and my firmware inherited his consistent standards in production and use. In order to thank these pioneers and sharers, I have recorded them in CONTRIBUTORS.md. Thank you again for giving new life and meaning to the box.

Other distributions

  • Unifreq has created OpenWrt systems for more boxes such as Amlogic, Rockchip, and Allwinner, which is a benchmark in the box community and recommended for use.
  • The amlogic-s9xxx-armbian project provides the Armbian system for use on boxes, which is also applicable to related devices that support OpenWrt.

Links

License

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