Coder Social home page Coder Social logo

kuaner / amlogic-s9xxx-openwrt Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ophub/amlogic-s9xxx-openwrt

0.0 1.0 0.0 2.38 GB

OpenWrt for Amlogic S9xxx series boxes. Support boxes are Phicomm-N1, Octopus-Planet, X96-Max+, HK1-Box, H96-Max-X3, Belink GT-King, Belink GT-King Pro, UGOOS AM6 Plus, HG680P, B860H, etc.

License: GNU General Public License v2.0

Shell 97.80% Makefile 2.20%

amlogic-s9xxx-openwrt's Introduction

OpenWrt for Amlogic S9xxx series boxes

Support github.com One-stop compilation, github.com clone packaging, Use github.com Releases rootfs file to packaging, Local packaging. including OpenWrt firmware install to EMMC and upgrade related functions. Support Amlogic-s9xxx chip series such as S905x3, S905x2, S922x, S905x, S905d, s912, etc. Support boxes are Phicomm-N1, Octopus-Planet, X96-Max+, HK1-Box, H96-Max-X3, Belink GT-King, Belink GT-King Pro, UGOOS AM6 Plus, Fiberhome HG680P, ZTE B860H, etc.

The latest version of the OpenWrt firmware can be downloaded in Releases. Some important update instructions can be found in ChangeLog.md documents.

This OpenWrt firmware is packaged using Flippy's Amlogic S9xxx Kernel for OpenWrt, and the Install and Upgrade scripts, etc. Special thanks The maker Flippy.

Welcome to use forks for personalized OpenWrt firmware configuration. If you like it, Please click the stars.

OpenWrt Firmware instructions

  • openwrt_s905x3_v*.img: For all Amlogic-S905x3 series boxes.
  • openwrt_s905x2_v*.img: For all Amlogic-s905x2 series boxes.
  • openwrt_s905x_v*.img: For all Amlogic-s905x series boxes.
  • openwrt_s905d_v*.img: For all Amlogic-s905d series boxes.
  • openwrt_s912_v*.img: For all Amlogic-s912 series boxes.
  • openwrt_s922x_v*.img: For all Amlogic-s922x series boxes.
  • openwrt_x96_v*.img: For X96-Max+(S905x3). πŸ”
  • openwrt_hk1_v*.img: For HK1-Box(S905x3). πŸ”
  • openwrt_h96_v*.img: For H96-Max-X3(S905x3). πŸ”
  • openwrt_belink_v*.img For Belink GT-King(S922x). πŸ”
  • openwrt_belinkpro_v*.img For Belink GT-King Pro(S922x). πŸ”
  • openwrt_ugoos_v*.img For UGOOS AM6 Plus(S922x). πŸ”
  • openwrt_hg680p_v*.img: For Fiberhome HG680P(S905x). πŸ”
  • openwrt_b860h_v*.img: For ZTE B860H(S905x). πŸ”
  • openwrt_n1_v*.img: For Phicomm-N1(S905d).
  • openwrt_octopus_v*.img For Octopus-Planet(S912).

Install to EMMC partition and upgrade instructions

Choose the corresponding firmware according to your box. Then write the IMG file to the USB hard disk through software such as balenaEtcher. Insert the USB hard disk into the S9xxx-Boxs. Common for Phicomm-n1 and s9xxx-Boxes.

Install OpenWrt

  • Log in to the default IP: 192.168.1.1 β†’ Login in to openwrt β†’ system menu β†’ TTYD terminal β†’ input command:
s9xxx-install.sh

Upgrade OpenWrt

  • Log in to the default IP: 192.168.1.1 β†’ Login in to openwrt β†’ system menu β†’ file transfer β†’ upload openwrt*.img.gz (Support suffix: *.img.xz, *.img.gz, *.7z, *.zip) to /tmp/upload/, enter the system menu β†’ TTYD terminal β†’ input command:
s9xxx-update.sh

For more instructions please see: install-program

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.

  • 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.
  • Github.com clone 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: Build OpenWrt for S9xxx-Boxes
  id: build
  run: |
    git clone --depth 1 https://github.com/ophub/amlogic-s9xxx-openwrt.git
    cd amlogic-s9xxx-openwrt/
    [ -d openwrt-armvirt ] || mkdir -p openwrt-armvirt
    cp -f ../openwrt/bin/targets/*/*/*.tar.gz openwrt-armvirt/ && sync
    sudo rm -rf ../openwrt && sync
    sudo rm -rf /workdir && sync
    sudo chmod +x make
    sudo ./make -d -b n1_x96_hk1_h96_octopus_belink_belinkpro_ugoos -k 5.9.14_5.4.83
    # sudo ./make -d -b s905x3_s905x2_s905d_s922x_s912 -k 5.4.77_5.9.8
    cd out/ && sudo gzip *.img
    cp -f ../openwrt-armvirt/*.tar.gz . && sync
    echo "FILEPATH=$PWD" >> $GITHUB_ENV
    echo "::set-output name=status::success"
  • Uploads OpenWrt Firmware to Actions:
- name: Upload artifact to Actions
  uses: kittaakos/upload-artifact-as-is@master
  with:
    path: ${{ env.FILEPATH }}/
  • Uploads OpenWrt Firmware to Release:
- name: Upload OpenWrt Firmware to Release
  uses: softprops/action-gh-release@v1
  env:
    GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  with:
    tag_name: openwrt_s9xxx
    files: ${{ env.FILEPATH }}/*
    body: |
      This is OpenWrt firmware for S9xxx-Boxes and Phicomm-N1.
      More information ...
  • 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 n1_x96_hk1_h96_octopus_belink_belinkpro_ugoos -k 5.9.14_5.4.83
    # sudo ./make -d -b s905x3_s905x2_s905d_s922x_s912 -k 5.4.77_5.9.8
    cd out/ && sudo gzip *.img
    cp -f ../openwrt-armvirt/*.tar.gz . && sync
    echo "FILEPATH=$PWD" >> $GITHUB_ENV
    echo "FILE_DATE=$(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-s9xxx-Box 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.

  • Local packaging instructions

  1. Clone the warehouse 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. Enter the ~/amlogic-s9xxx-openwrt root directory. And run Eg: sudo ./make -d -b n1_x96 -k 5.4.75_5.9.5 to complete the compilation. The generated OpenWrt firmware is in the out directory under the root directory.

Detailed make compile command

  • sudo ./make -d -b n1 -k 5.9.5: recommend. Use the default configuration, specify a kernel and a firmware for compilation.
  • sudo ./make -d -b n1_hk1 -k 5.4.75_5.9.5: Use the default configuration, specify multiple cores, and multiple firmware for compilation. use _ to connect.
  • sudo ./make -d: Compile all kernel versions of openwrt with the default configuration.
  • sudo ./make -d -b n1 -k 5.9.2 -s 1024: Use the default configuration, specify a kernel, a firmware, and set the partition size for compilation.
  • sudo ./make -d -b n1_hk1: Use the default configuration, specify multiple firmware, use _ to connect. compile all kernels.
  • sudo ./make -d -k 5.4.73_5.9.2: Use the default configuration. Specify multiple cores, use _ to connect.
  • 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.7.15: Use the default configuration and set the partition size to 1024m, and only compile the openwrt firmware with the kernel version 5.7.15.
  • 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 phicomm_n1 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.
Parameter Types 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 n1 . Multiple firmware use _ connect such as -b n1_hk1 . The model represented by the relevant variable: belinkpro is Belink GT-King Pro, belink is Belink GT-King, n1 is Phicomm-N1, x96 is X96-Max+, hk1 is HK1-Box, h96 is H96-Max-X3, octopus is Octopus-Planet, ugoos is UGOOS AM6 Plus. You can also use model codes: s905x3, s905x2, s905x, s905d, s922x, s912
-k Kernel Specify the kernel type. Write the kernel name individually such as -k 5.4.50 . Multiple cores use _ connection such as -k 5.4.50_5.9.5 View the kernel library.
-s Size Specify the size of the root 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.
  • Supported Models and Boxes

The codes of the following Model and Boxes can be used in sudo ./make -d -b Your_Model_or_Boxes. The generated firmware is the same by each model and related boxes. You can enter parameters as needed.

Model Boxes
s905x3 x96, hk1, h96
s905x2 x96max4g, x96max2g
s905x hg680p, b860h
s905d n1
s922x belink, belinkpro, ugoos
s912 octopus

Build more kernel files

Flippy has shared with us dozens of versions of firmware, Brings unlimited freedom to amlogic-s9xxx series Boxes. We have stored some of the latest kernels in the kernel directory. If you think it’s not enough, or you don’t find the version you miss, you can use the kernel build tool to add the Flippy kernel to the Kernel library of the repository, and package the version of openwrt firmware you want. For more instructions please see: build_kernel

~/openwrt-armvirt/* Firmware compilation parameters

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

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

amlogic-s9xxx-openwrt's People

Contributors

kuaner avatar ophub avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.