View Chinese description | 查看中文说明
The OpenWrt Project is a Linux router operating system targeting embedded devices. Instead of trying to create a single, static firmware, OpenWrt provides a fully writable filesystem with package management. Allows you to freely choose the software package you need to customize your router system. For developers, OpenWrt is the framework to build an application without having to build a complete firmware around it; for users this means the ability for full customization, to use the device in ways never envisioned. It has more than 3000+ standardized application packages and a very rich third-party plug-in support, so you can easily replicate the same setup on any supported device.
Now you can replace the Android TV system of the TV box with the OpenWrt system, making it a powerful router. This project builds OpenWrt system for Amlogic
, Rockchip
and Allwinner
boxes. including install to eMMC and update kernel related functions. Please refer to the OpenWrt Documentation for the usage method.
The latest version of the OpenWrt firmware can be downloaded in Releases. Welcome to use Fork
for personalized OpenWrt firmware configuration. If you like it, Please click the Star
.
💡Tip: Currently s905 Boxes can only be used in TF/SD/USB
, Other models of boxes support writing to eMMC
for use. For more information, please refer to Description of Supported Device List. You can refer to the method in Section 12.15 of the documentation to add new support devices.
Choose the corresponding firmware according to your box. See the corresponding instructions for the use of different devices.
-
For the installation method of the
Rockchip
platform, please refer to Section 8 in the documentation. The installation method is the same as Armbian. -
Amlogic
andAllwinner
platform,Then write the IMG file to the USB hard disk through software such as Rufus or balenaEtcher. Insert the USB hard disk into the box. Log in to the default IP: 192.168.1.1 →Login in to openwrt
→system menu
→Amlogic Service
→Install OpenWrt
, Select your box in the Supported Devices drop-down list and click theInstall OpenWrt
button to install it.
Log in to the default IP: 192.168.1.1 → Login in to openwrt
→ system menu
→ Amlogic Service
→ Upload updates manually / Download updates online
If you choose Upload Updates Manually
OpenWrt firmware, You can upload the corresponding OpenWrt firmware package, such as openwrt_xxx_k5.15.50.img.gz (It is recommended to upload the compressed package, and the system will automatically decompress it. If you upload the decompressed xxx.img file, the upload may fail because the file is too large), After the upload is complete, the interface will display the Update firmware
operation button, click to update.
If you choose Manually upload updates
OpenWrt kernel, You can upload the three kernel files boot-xxx.tar.gz
, dtb-xxx.tar.gz
, modules-xxx.tar.gz
(Other kernel files are not required. If uploading at the same time does not affect the update, the system can accurately identify the required kernel files.),After the upload is complete, the interface will display the Update Kernel
operation button, click to update.
If you choose Online Download Update
OpenWrt firmware or kernel, it will be downloaded according to Firmware download address
and Kernel download address
in Plugin Settings
, you can customize and modify the download source, For details, please refer to the compilation and usage instructions of luci-app-amlogic.
If you feel that the memory of the current box is not enough when you are using applications with a large memory footprint such as docker
, you can create a swap
virtual memory partition, Change the disk space of /mnt/*4
A certain capacity is virtualized into memory for use. The unit of the input parameter of the following command is GB
, and the default is 1
.
Log in to the default IP: 192.168.1.1 → Login in to openwrt
→ system menu
→ TTYD terminal
→ input command
openwrt-swap 1
Supports backup/restore of the box's EMMC
partition in TF/SD/USB
. It is recommended that you back up the Android TV system that comes with the current box before installing the OpenWrt system in a brand new box, so that you can use it in the future when restoring the TV system.
Please start the OpenWrt system from TF/SD/USB
, Log in to the default IP: 192.168.1.1 → Login in to openwrt
→ system menu
→ TTYD terminal
→ input command
openwrt-ddbr
According to the prompt, enter b
to perform system backup, and enter r
to perform system recovery.
Log in to the default IP: 192.168.1.1 → Login in to openwrt
→ system menu
→ TTYD terminal
→ input command
openwrt-openvfd
Debug according to LED screen display control instructions.
Use the firstboot
command to restore the system to its initial state. In the use of OpenWrt, please refer to documents for some common problems that may be encountered.
- Install the necessary packages (E.g Ubuntu 22.04 LTS user)
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)
- Clone the repository to the local.
git clone --depth 1 https://github.com/ophub/amlogic-s9xxx-openwrt.git
- Create a
openwrt-armvirt
folder, and upload the OpenWrt firmware of the ARM kernel ( Eg:openwrt-armvirt-64-default-rootfs.tar.gz
) to this~/amlogic-s9xxx-openwrt/openwrt-armvirt
directory. - Enter the
~/amlogic-s9xxx-openwrt
root directory. And run Eg:sudo ./make -b s905x3 -k 6.1.10
. The generated OpenWrt firmware is in theout
directory under the root directory.
Parameter | Meaning | Description |
---|---|---|
-b | Board | Specify the Build system type. Write the build system name individually, such as -b s905x3 . Multiple system use _ connect such as -b s905x3_s905d . Use all for all board models. The model code is detailed in the BOARD setting in model_database.conf file. Default value: all |
-r | KernelRepo | Specifies 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. Default value: stable |
-k | Kernel | Specify the kernel version, Such as -k 5.10.125 . Multiple kernel use _ connection such as -k 5.10.125_5.15.50 . The kernel version freely specified by the -k parameter is only valid for the kernel in the stable/flippy/dev . Other kernel families such as rk3588 can only use specific kernels. |
-a | AutoKernel | Set whether to automatically adopt the latest version of the kernel of the same series. When it is true , it will automatically find in the kernel library whether there is an updated version of the kernel specified in -k such as 5.10.125 version. If there is the latest version of same series, it will automatically Replace with the latest version. When set to false , the specified version of the kernel will be compiled. Default value: true |
-s | Size | Specify the ROOTFS partition size for the system, and the specified size must be greater than 2048MiB. Such as -s 2560 , Default value: 2560 |
-g | GH_TOKEN | Optional. Set ${{ secrets.GH_TOKEN }} for api.github.com query. Default: None |
sudo ./make
: Compile latest kernel versions of openwrt for all board with the default configuration.sudo ./make -b s905x3 -k 6.1.10
: recommend. Use the default configuration, specify a kernel and a firmware for compilation.sudo ./make -b s905x3_s905d -k 6.1.10_5.15.50
: Use the default configuration, specify multiple cores, and multiple firmware for compilation. use_
to connect.sudo ./make -b s905x3 -k 6.1.10 -s 1024
: Using the default configuration, one kernel is specified, one model is packaged, and the firmware size is set to 1024 MiB.sudo ./make -b s905x3_s905d
: Use the default configuration, specify multiple firmware, use_
to connect. compile all kernels.sudo ./make -k 6.1.10_5.15.50
: Use the default configuration. Specify multiple cores, use_
to connect.sudo ./make -k 6.1.10_5.15.50 -a true
: Use the default configuration. Specify multiple cores, use_
to connect. Auto update to the latest kernel of the same series.sudo ./make -s 1024 -k 6.1.10
: Use the default configuration and set the partition size to 1024 MiB, and only compile the openwrt firmware with the kernel version 6.1.10.
You can modify the configuration file in the config-openwrt directory and .yml
file, customize the OpenWrt firmware, and complete the packaging online through Actions
, and complete all the compilation of OpenWrt firmware in github.com One-stop.
- Personalized plug-in configuration in documents directory. Workflows configuration in .yml file.
- New compilation: Select
Build OpenWrt
on the Action page. Click theRun workflow
button. - Compile again: If there is an
openwrt-armvirt-64-default-rootfs.tar.gz
file in Releases, you do not need to compile it completely, you can directly use this file tobuild openwrt
of different board. SelectUse Releases file to Packaging
on the Actions page. Click theRun workflow
button. - More support: The compiled
openwrt-armvirt-64-default-rootfs.tar.gz
file is a common file for making various board firmware, and it is also suitable for making OpenWrt firmware using unifreq's packaging script. As the pioneer of using OpenWrt and Armbian system in the box, he has supported more devices, such as OpenWrt (QEMU Version) as used byKVM
virtual machine on Armbian system, Amlogic, and Rockchip, and Allwinner series, etc. For details on the packaging method, please refer to his source code repository description. In Actions, you can use packaging-openwrt-for-qemu-etc.yml to call his packaging script to make more firmware.
- 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 }}
The relevant parameters correspond to the local packaging command
, please refer to the above description.
Parameter | Defaults | Description |
---|---|---|
openwrt_path | None | Set the file path of openwrt-armvirt-64-default-rootfs.tar.gz , you can use a relative path such as openwrt/bin/targets/*/*/*rootfs.tar.gz or the network file download address. E.g https://github.com/*/releases/*/*rootfs.tar.gz |
openwrt_board | all | Set the board of the packaging TV Boxes, function reference -b |
kernel_repo | ophub/kernel | Specifies the <owner>/<repo> of the github.com kernel repository, function reference -r |
kernel_usage | stable | Set the tags suffix of the kernel used, function reference -u |
openwrt_kernel | 6.1.1_5.15.1 | Set the kernel version,function reference -k |
auto_kernel | true | Set whether to automatically adopt the latest version of the kernel of the same series. function reference -a |
openwrt_size | 1024 | Set the size of the firmware ROOTFS partition, function reference -s |
gh_token | None | Optional. Set ${{ secrets.GH_TOKEN }} , function reference -g |
To upload to Releases
, you need to add ${{ secrets.GITHUB_TOKEN }}
and ${{ secrets.GH_TOKEN }}
to the repository and set Workflow read and write permissions
, see the instructions for details.
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 |
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
Name | Value |
---|---|
Default IP | 192.168.1.1 |
Default username | root |
Default password | password |
Default WIFI name | OpenWrt |
Default WIFI password | none |
For the compilation method of the kernel, see 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
When making an OpenWrt system, the kernel and u-boot files used are the same files used to make an Armbian system. In order to avoid repeated maintenance, the relevant content is classified and placed in the corresponding resource repository, and it will be automatically downloaded from the relevant repository when it is used.
The kernel
/ u-boot
and other resources used by this system are mainly copied from the project of unifreq/openwrt_packit, Some files are shared by users in Pull and Issues of amlogic-s9xxx-openwrt / amlogic-s9xxx-armbian / luci-app-amlogic / kernel and other projects. unifreq
opened the door for us to use OpenWrt in TV Boxes, and was deeply influenced by him. My firmware has inherited his consistent standards in production and use. To thank these pioneers and sharers, I have recorded them in CONTRIBUTORS.md. Thanks again everyone for giving new life and meaning to the Boxes.
- unifreq has made
OpenWrt
system for more boxes such asAmlogic
,Rockchip
andAllwinner
, which is a benchmark in the box circle and is recommended for use. - The amlogic-s9xxx-armbian project provides the
Armbian
system used in the box, which is also applicable to the relevant devices that support OpenWrt.
The amlogic-s9xxx-openwrt © OPHUB is licensed under GPL-2.0