Skip to content

. 注意!注意!注意! 在R3300L R3300M (芯片S905L )上实测可用的lede,5.4内核正常工作, 5.10和5.15内核不能启动。 所以本仓库最后为R3300L可用的版本是 openwrt_s905x_k5.4.179_2022.02.15.0413.img.gz 。不再提供更新了。 如果缺插件,推荐去 https://op.supes.top/packages/aarch64_cortex-a53/ 下载ipk安装包。 R3300L 使用p212这个dtb文件,需要在TF卡修改一下Env文件。本版本支持wifi 建议关闭wifi。因为lede最新版本不知道什么地方不支持R3300的硬件驱动,所以本仓库不再编译了。旧版本“又不是不能用”。

License

Notifications You must be signed in to change notification settings

kongmadai/amlogic-s9xxx-openwrt-for-N1

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

写在前面

R3300L R3300M 算是一个不错的盒子,比N1盒子唯一的差距就是100M的网口, 所以作为网关只能跑到100Mbps 实际fast.com测试只能达到95Mbps
那么CPU本来是2Ghz的频率,但是建议在openwrt里面设置为1Ghz使用,这样可以降温,正常运行在40度,开机一个月不死机。 反正1Ghz的cpu也可以跑满100Mbps的网线了。

路由器除了性能,最主要就是要求稳定。 所以本仓库提供稳定版在release 把img文件写入tf卡就可以了。

因为lede的openwrt每天都在更新,但是对于r3300l这种老设备来说意义不大,硬件驱动如果能稳定工作其实就没必要修改。用2月15日的版本就挺好,该有的功能都有了,开机一个月都不会死机。 就算更新,也只更新插件的ipk就行了。 插件只能更新zerotier这种插件的ipk,其他的内核级包括firewall iptables这种插件万万不能更新,一更新就死。

对于盒子来说最重要就是dtb文件,依靠该文件驱动硬件。R3300L 使用p212这个dtb文件,需要在TF卡的根目录打开Env文件,把其中的dtb文件路径修改成p212。 后来lede更换了linux内核和dtb文件以后,就再也没有编译成功过,写入tf卡以后不能启动,我怀疑是dtb文件更新的问题,但是也没有时间去深究。反正现在的版本一个月不死机,该有的功能都有,升级一下也还是受限于100Mbps的网卡,又不能起飞,那还搞个啥?

记住只要程序能跑,就不要更新,生命有限,勿折腾。

OpenWrt for Amlogic s9xxx tv box

View Chinese description | 查看中文说明

Support github.com One-stop compilation, Use GitHub Action to packaging, Use github.com Releases rootfs file to packaging, Local packaging. including OpenWrt firmware install to EMMC and update related functions. Support Amlogic s9xxx tv box are s922x, s905x3, s905x2, s912, s905d, s905x, s905w, s905, etc. such as Belink GT-King, Belink GT-King Pro, UGOOS AM6 Plus, X96-Max+, HK1-Box, H96-Max-X3, Phicomm-N1, Octopus-Planet, Fiberhome HG680P, ZTE B860H, etc.

The latest version of the OpenWrt firmware can be downloaded in Releases.

This OpenWrt firmware is packaged using Flippy's Amlogic S9xxx Kernel for OpenWrt, and the Install and update scripts, etc. Welcome to use Fork for personalized OpenWrt firmware configuration. If you like it, Please click the Star.

OpenWrt Firmware instructions

SoC Device Optional kernel OpenWrt Firmware
s922x Beelink-GT-King, Beelink-GT-King-Pro, Ugoos-AM6-Plus, ODROID-N2 All openwrt_s922x_k*.img
s905x3 X96-Max+, HK1-Box, H96-Max-X3, Ugoos-X3, X96-Air, A95XF3-Air All openwrt_s905x3_k*.img
s905x2 X96Max-4G, X96Max-2G, MECOOL-KM3-4G All openwrt_s905x2_k*.img
s912 H96-Pro-Plus, Tanix-TX92, VORKE-Z6-Plus, T95Z-Plus, Octopus-Planet All openwrt_s912_k*.img
s905d MECOOL-KI-Pro, Phicomm-N1 All openwrt_s905d_k*.img
s905x HG680P, B860H All openwrt_s905x_k*.img
s905w X96-Mini, TX3-Mini 5.4.* openwrt_s905w_k*.img
s905 Beelink-Mini-MX-2G, MXQ-PRO+4K All openwrt_s905_k*.img

💡Tip: The current box of s905 can only be used in TF/SD/USB, and other types of boxes can also be used in EMMC at the same time. The s905w boxs currently only support 5.4 kernels, Cannot use kernel version 5.10 and above, Other devices can be freely selected. Please refer to the instructions for dtb and u-boot of each device.

Install to EMMC and update instructions

Choose the corresponding firmware according to your box. 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. Common for all Amlogic s9xxx tv box.

  • Install OpenWrt

Log in to the default IP: 192.168.1.1 → Login in to openwrtsystem menuAmlogic ServiceInstall OpenWrt

  • Update OpenWrt

Log in to the default IP: 192.168.1.1 → Login in to openwrtsystem menuAmlogic ServiceUpdate OpenWrt

Tip: Functions such as install/update are provided by luci-app-amlogic to provide visual operation support. Also supports command operations.

  • Use OpenWrt in TF/USB

Log in to the default IP: 192.168.1.1 → Login in to openwrtsystem menuTTYD terminal → input command

openwrt-tf

After activating the remaining space, the kernel and OpenWrt system can be upgraded in TF/USB.

  • Create swap for openwrt system

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 openwrtsystem menuTTYD terminal → input command

openwrt-swap 1
  • Backup/restore the original EMMC system

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 openwrtsystem menuTTYD terminal → input command

openwrt-ddbr

According to the prompt, enter b to perform system backup, and enter r to perform system recovery.

💡Tip: You must use the /mnt/*4/ space to store the BACKUP-arm-64-emmc.img.gz backup file, Users who have not created the TF/SD/USB extended partition must first use the openwrt-tf command to create the extended partition.

Detailed make compile command

Parameter Meaning Description
-d Defaults Compile all cores and all firmware types.
-b Build Specify the Build firmware type. Write the build firmware name individually, such as -b s905x3 . Multiple firmware use _ connect such as -b s905x3_s905d . You can use these codes: s905x3, s905x2, s905x, s905w, s905d, s905d-ki, s905, s922x, s922x-n2, s912, s912-t95z . Note: s922x-reva is s922x-gtking-pro-rev_a, s922x-n2 is s922x-odroid-n2, s912-t95z is s912-t95z-plus, s905d-ki is s912-mecool-ki-pro, s905x2-km3 is s905x2-mecool-km3.
-v Version Specify the name of the kernel version branch, Such as -v stable. The specified name must be the same as the branch directory name. The stable branch version is used by default.
-k Kernel Specify the kernel name. Write the kernel name individually such as -k 5.4.170 . Multiple kernel use _ connection such as -k 5.15.13_5.4.170
-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.4.170 version. If there is the latest version of 5.4 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 size of the ROOTFS partition in MB. The default is 1024, and the specified size must be greater than 256. Such as -s 1024
-h help View full documentation.
  • sudo ./make -d -b s905x3 -k 5.4.170: recommend. Use the default configuration, specify a kernel and a firmware for compilation.
  • sudo ./make -d -b s905x3_s905d -k 5.15.13_5.4.170: Use the default configuration, specify multiple cores, and multiple firmware for compilation. use _ to connect.
  • sudo ./make -d: Compile latest kernel versions of openwrt for all SoC with the default configuration.
  • sudo ./make -d -b s905x3 -k 5.4.170 -s 1024: Use the default configuration, specify a kernel, a firmware, and set the partition size for compilation.
  • sudo ./make -d -b s905x3 -v dev -k 5.7.19: Use the default configuration, specify the model, specify the version branch, and specify the kernel for packaging.
  • sudo ./make -d -b s905x3_s905d: Use the default configuration, specify multiple firmware, use _ to connect. compile all kernels.
  • sudo ./make -d -k 5.15.13_5.4.170: Use the default configuration. Specify multiple cores, use _ to connect.
  • sudo ./make -d -k 5.15.13_5.4.170 -a true: Use the default configuration. Specify multiple cores, use _ to connect. Auto update to the latest kernel of the same series.
  • sudo ./make -d -k latest: Use the default configuration to compile the latest kernel version of the openwrt firmware.
  • sudo ./make -d -s 1024 -k 5.4.170: Use the default configuration and set the partition size to 1024m, and only compile the openwrt firmware with the kernel version 5.4.170.
  • sudo ./make -h: Display help information and view detailed description of each parameter.
  • sudo ./make: If you are familiar with the relevant setting requirements of the s905x3 firmware, you can follow the prompts, such as selecting the firmware you want to make, the kernel version, setting the ROOTFS partition size, etc. If you don’t know these settings, just press Enter.

Compilation and packaging method

Provide multiple ways to generate the OpenWrt firmware you need. Please choose one method you like. Each method can be used independently.

  • Local packaging instructions

  1. Install the necessary packages (E.g Ubuntu 20.04 LTS user)
sudo apt-get update -y
sudo apt-get full-upgrade -y
sudo apt-get install -y $(curl -fsSL git.io/ubuntu-2004-openwrt)
  1. Clone the repository to the local. git clone --depth 1 https://github.com/ophub/amlogic-s9xxx-openwrt.git
  2. 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.
  3. Name the kernel package according to the corresponding version number, such as 5.4.170 version, and put it into the ~/amlogic-s9xxx-openwrt/amlogic-s9xxx/amlogic-kernel directory.
  4. Enter the ~/amlogic-s9xxx-openwrt root directory. And run Eg: sudo ./make to make selection settings. The generated OpenWrt firmware is in the out directory under the root directory.
  • github.com One-stop compilation instructions

You can modify the configuration file in the router-config 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.

  1. Personalized plug-in configuration in router-config directory. Workflows configuration in .yml file.
  2. Select Build OpenWrt on the Action page. Click the Run workflow button.
- name: Build OpenWrt firmware
  id: build
  run: |
    [ -d openwrt-armvirt ] || mkdir -p openwrt-armvirt
    cp -f openwrt/bin/targets/*/*/*.tar.gz openwrt-armvirt/ && sync
    sudo chmod +x make
    sudo ./make -d -b s905x3_s905x2_s905x_s905w_s905d_s922x_s912 -k 5.15.13_5.4.170
    echo "PACKAGED_OUTPUTPATH=${PWD}/out" >> $GITHUB_ENV
    echo "PACKAGED_OUTPUTDATE=$(date +"%Y.%m.%d.%H%M")" >> $GITHUB_ENV
    echo "::set-output name=status::success"

The output variable ${{ env.PACKAGED_OUTPUTPATH }} is the path where the packaged file is located.

  • Use github.com Releases rootfs file to packaging

If there is an openwrt-armvirt-64-default-rootfs.tar.gz file in a Releases in your repository, you can use this file to directly package the required firmware.

  • openwrt_s9xxx_.* is Prefix the tag_name in the Release.
  • openwrt-armvirt-64-default-rootfs.tar.gz is the firmware you are going to package, please refer to router-config for compilation method.

For more instructions please see: use-releases-file-to-packaging.yml

- name: Build OpenWrt firmware
  id: build
  run: |
    [ -d openwrt-armvirt ] || mkdir -p openwrt-armvirt
    curl -s "https://api.github.com/repos/${GITHUB_REPOSITORY}/releases" | grep -o "openwrt_s9xxx_.*/openwrt-armvirt-.*\.tar.gz" | head -n 1 > DOWNLOAD_URL
    [ -s DOWNLOAD_URL ] && wget -q -P openwrt-armvirt https://github.com/${GITHUB_REPOSITORY}/releases/download/$(cat DOWNLOAD_URL)
    sudo chmod +x make
    sudo ./make -d -b s905x3_s905x2_s905x_s905w_s905d_s922x_s912 -k 5.15.13_5.4.170
    echo "PACKAGED_OUTPUTPATH=${PWD}/out" >> $GITHUB_ENV
    echo "PACKAGED_OUTPUTDATE=$(date +"%Y.%m.%d.%H%M")" >> $GITHUB_ENV
    echo "::set-output name=status::success"

This function is suitable for the needs of replacing the kernel packaging and packaging the OpenWrt firmware of the specified amlogic-dtb separately. As long as you have the openwrt-armvirt-64-default-rootfs.tar.gz file in the Releases of your repository, you can package the OpenWrt firmware you want at any time, which is efficient and convenient.

  • Use GitHub Action to packaging instructions

For more instructions please see: .yml example

In your .github/workflows/.yml file, after completing the compilation of Subtarget is ARMv8, add the following online packaging code:

- name: Package Armvirt as OpenWrt
  uses: ophub/amlogic-s9xxx-openwrt@main
  with:
    armvirt64_path: openwrt/bin/targets/*/*/*.tar.gz
    amlogic_openwrt: s905x3_s905x2_s905x_s905w_s905d_s922x_s912
    amlogic_kernel: 5.15.13_5.4.170
  • GitHub Action Input parameter description
Parameter Defaults Description
armvirt64_path no Set the file path of openwrt-armvirt-64-default-rootfs.tar.gz , Use the path of the file in the current workflow such as openwrt/bin/targets/*/*/*.tar.gz .
amlogic_openwrt s905d_s905x3 Set the SoC of the packaging box, the default all packs all boxes, you can specify a single box such as s905x3, you can choose multiple boxes to use _ connection such as s905x3_s905d . SOC code of each box is: s905x3, s905x2, s905x, s905w, s905d, s905d-ki, s905, s922x, s922x-n2, s912, s912-t95z . Note: s922x-reva is s922x-gtking-pro-rev_a, s922x-n2 is s922x-odroid-n2, s912-t95z is s912-t95z-plus, s905d-ki is s912-mecool-ki-pro, s905x2-km3 is s905x2-mecool-km3.
version_branch stable Specify the name of the kernel version branch, Such as stable. The specified name must be the same as the branch directory name. The stable branch version is used by default.
amlogic_kernel 5.15.13_5.4.170 Set the kernel version,The kernel library contains many original kernels of Flippy, you can view and choose to specify.
auto_kernel true 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 amlogic_kernel. such as 5.4.170 version. If there is the latest version of 5.4 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
amlogic_size 1024 Set the size of the firmware ROOTFS partition
  • GitHub Action Output variable description
Parameter For example Description
${{ env.PACKAGED_OUTPUTPATH }} ${PWD}/out OpenWrt firmware storage path
${{ env.PACKAGED_OUTPUTDATE }} 2021.04.13.1058 Packing date
${{ env.PACKAGED_STATUS }} success / failure Package status
  • Uploads OpenWrt Firmware to Release:
- name: Upload OpenWrt Firmware to Release
  uses: ncipollo/release-action@v1
  with:
    tag: openwrt_s9xxx
    artifacts: ${{ env.PACKAGED_OUTPUTPATH }}/*
    allowUpdates: true
    token: ${{ secrets.GITHUB_TOKEN }}
    body: |
      This is OpenWrt firmware for Amlogic s9xxx tv box.
      More information ...

Compile a custom kernel

For the compilation method of the custom kernel, see compile-kernel

~/openwrt-armvirt/*-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: router-config

Firmware information

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

Bypass gateway settings

If used as a bypass gateway, you can add custom firewall rules as needed (Network → Firewall → Custom Rules):

iptables -t nat -I POSTROUTING -o eth0 -j MASQUERADE        #If the interface is eth0.
iptables -t nat -I POSTROUTING -o br-lan -j MASQUERADE      #If the interface is br-lan bridged.

Acknowledgments

License

LICENSE © OPHUB

About

. 注意!注意!注意! 在R3300L R3300M (芯片S905L )上实测可用的lede,5.4内核正常工作, 5.10和5.15内核不能启动。 所以本仓库最后为R3300L可用的版本是 openwrt_s905x_k5.4.179_2022.02.15.0413.img.gz 。不再提供更新了。 如果缺插件,推荐去 https://op.supes.top/packages/aarch64_cortex-a53/ 下载ipk安装包。 R3300L 使用p212这个dtb文件,需要在TF卡修改一下Env文件。本版本支持wifi 建议关闭wifi。因为lede最新版本不知道什么地方不支持R3300的硬件驱动,所以本仓库不再编译了。旧版本“又不是不能用”。

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Shell 73.5%
  • Lua 16.9%
  • Perl 5.3%
  • JavaScript 3.2%
  • Makefile 1.1%