├── .github ├── .gitkeep ├── ISSUE_TEMPLATE │ └── bug-report.md └── workflows │ ├── build-openwer-docker-image.yml │ ├── delete-older-releases-workflows.yml │ ├── compile-kernel.yml │ └── build-openwrt-using-unifreq-scripts.yml ├── make-openwrt ├── openwrt-files │ ├── different-files │ │ ├── e20c │ │ │ └── rootfs │ │ │ │ └── etc │ │ │ │ ├── modules.d │ │ │ │ ├── mt7601u │ │ │ │ ├── mt7663u │ │ │ │ ├── mt76x0u │ │ │ │ ├── mt76x2u │ │ │ │ ├── mt7921u │ │ │ │ ├── rk_gpu │ │ │ │ ├── rtl8168 │ │ │ │ └── rtw88 │ │ │ │ └── board.d │ │ │ │ ├── 00_model │ │ │ │ ├── 01_led │ │ │ │ └── 99-default_network │ │ ├── h28k │ │ │ └── rootfs │ │ │ │ └── etc │ │ │ │ ├── modules.d │ │ │ │ ├── mt7601u │ │ │ │ ├── mt7663u │ │ │ │ ├── mt76x0u │ │ │ │ ├── mt76x2u │ │ │ │ ├── mt7921u │ │ │ │ ├── rk_gpu │ │ │ │ ├── rtl8168 │ │ │ │ └── rtw88 │ │ │ │ ├── inittab │ │ │ │ └── board.d │ │ │ │ ├── 00_model │ │ │ │ ├── 01_led │ │ │ │ └── 99-default_network │ │ ├── h66k │ │ │ └── rootfs │ │ │ │ └── etc │ │ │ │ ├── modules.d │ │ │ │ ├── mt7921e │ │ │ │ ├── pwm-fan │ │ │ │ ├── ath10k-pci │ │ │ │ └── ath10k │ │ │ │ └── board.d │ │ │ │ ├── 01_led │ │ │ │ ├── 00_model │ │ │ │ └── 99-default_network │ │ ├── h68k │ │ │ └── rootfs │ │ │ │ └── etc │ │ │ │ ├── modules.d │ │ │ │ ├── mt7915e │ │ │ │ ├── mt7921e │ │ │ │ ├── pwm-fan │ │ │ │ ├── rk_crypto │ │ │ │ └── snd-rk3568 │ │ │ │ ├── board.d │ │ │ │ ├── 01_led │ │ │ │ ├── 00_model │ │ │ │ └── 99-default_network │ │ │ │ └── config │ │ │ │ └── wireless │ │ ├── h69k │ │ │ └── rootfs │ │ │ │ └── etc │ │ │ │ ├── modules.d │ │ │ │ ├── mt7915e │ │ │ │ ├── mt7921e │ │ │ │ ├── pwm-fan │ │ │ │ ├── rk_crypto │ │ │ │ ├── usb-serial-option │ │ │ │ └── snd-rk3568 │ │ │ │ ├── board.d │ │ │ │ ├── 01_leds │ │ │ │ ├── 00_model │ │ │ │ └── 99-default_network │ │ │ │ └── config │ │ │ │ └── wireless │ │ ├── rock5c │ │ │ └── rootfs │ │ │ │ └── etc │ │ │ │ ├── modules.d │ │ │ │ ├── rk_npu │ │ │ │ ├── ath10k │ │ │ │ ├── mt7921e │ │ │ │ ├── pwm_fan │ │ │ │ ├── ath10k-pci │ │ │ │ ├── ath11k-pci │ │ │ │ ├── rk_gpu │ │ │ │ ├── ath11k │ │ │ │ ├── mt7915e │ │ │ │ ├── rtw89 │ │ │ │ └── rtw88 │ │ │ │ ├── inittab │ │ │ │ └── board.d │ │ │ │ ├── 01_led │ │ │ │ ├── 00_model │ │ │ │ └── 99-default_network │ │ ├── photonicat │ │ │ └── rootfs │ │ │ │ └── etc │ │ │ │ ├── modules.d │ │ │ │ ├── rk_npu │ │ │ │ ├── mt7921e │ │ │ │ ├── pwm_fan │ │ │ │ ├── rk_gpu │ │ │ │ └── ath10k │ │ │ │ ├── inittab │ │ │ │ └── board.d │ │ │ │ ├── 00_model │ │ │ │ ├── 01_led │ │ │ │ └── 99-default_network │ │ ├── zcube1-max │ │ │ └── rootfs │ │ │ │ └── etc │ │ │ │ ├── modules.d │ │ │ │ ├── option │ │ │ │ └── usb-hub │ │ │ │ ├── board.d │ │ │ │ ├── 00_model │ │ │ │ └── 99-default_network │ │ │ │ └── balance_irq │ │ ├── bdy-g18-pro │ │ │ └── rootfs │ │ │ │ └── etc │ │ │ │ ├── modules.d │ │ │ │ ├── 50-mt7615e │ │ │ │ ├── 50-rtl8365mb │ │ │ │ ├── 60-leds-gpio │ │ │ │ ├── 49-realtek-dsa │ │ │ │ └── 30-gpio-button-hotplug │ │ │ │ ├── board.d │ │ │ │ └── 02_network │ │ │ │ └── uci-defaults │ │ │ │ └── 99-wireless │ │ ├── jp-tvbox │ │ │ └── rootfs │ │ │ │ └── etc │ │ │ │ ├── modules.d │ │ │ │ ├── brcmfmac │ │ │ │ └── brcmutil │ │ │ │ ├── board.d │ │ │ │ ├── 00_model │ │ │ │ └── 99-default_network │ │ │ │ └── balance_irq │ │ ├── ruisen-box │ │ │ └── rootfs │ │ │ │ └── etc │ │ │ │ ├── modules.d │ │ │ │ ├── mt7921e │ │ │ │ ├── pwm-fan │ │ │ │ ├── ath10k-pci │ │ │ │ └── ath10k │ │ │ │ └── board.d │ │ │ │ ├── 01_led │ │ │ │ ├── 00_model │ │ │ │ └── 99-default_network │ │ ├── nsy-g16-plus │ │ │ └── rootfs │ │ │ │ └── etc │ │ │ │ ├── modules.d │ │ │ │ ├── 50-mt7615e │ │ │ │ ├── 50-rtl8365mb │ │ │ │ ├── 60-leds-gpio │ │ │ │ ├── 49-realtek-dsa │ │ │ │ └── 30-gpio-button-hotplug │ │ │ │ ├── board.d │ │ │ │ └── 02_network │ │ │ │ └── uci-defaults │ │ │ │ └── 99-wireless │ │ ├── nsy-g68-plus │ │ │ └── rootfs │ │ │ │ └── etc │ │ │ │ ├── modules.d │ │ │ │ ├── 50-mt7921e │ │ │ │ ├── 50-rtl8365mb │ │ │ │ ├── 60-leds-gpio │ │ │ │ ├── 49-realtek-dsa │ │ │ │ └── 30-gpio-button-hotplug │ │ │ │ ├── board.d │ │ │ │ └── 02_network │ │ │ │ └── uci-defaults │ │ │ │ └── 99-wireless │ │ ├── nanopc-t6 │ │ │ └── rootfs │ │ │ │ └── etc │ │ │ │ ├── balance_irq │ │ │ │ ├── inittab │ │ │ │ └── board.d │ │ │ │ ├── 00_model │ │ │ │ └── 99-default_network │ │ ├── rock5b │ │ │ └── rootfs │ │ │ │ └── etc │ │ │ │ ├── balance_irq │ │ │ │ ├── inittab │ │ │ │ └── board.d │ │ │ │ ├── 00_model │ │ │ │ └── 99-default_network │ │ ├── panther-x2 │ │ │ └── rootfs │ │ │ │ └── etc │ │ │ │ └── inittab │ │ ├── h88k │ │ │ └── rootfs │ │ │ │ └── etc │ │ │ │ ├── inittab │ │ │ │ ├── board.d │ │ │ │ ├── 01_led │ │ │ │ ├── 00_model │ │ │ │ └── 99-default_network │ │ │ │ └── config │ │ │ │ └── wireless │ │ ├── ipc-r │ │ │ └── rootfs │ │ │ │ └── etc │ │ │ │ ├── inittab │ │ │ │ ├── board.d │ │ │ │ ├── 00_model │ │ │ │ └── 99-default_network │ │ │ │ └── config │ │ │ │ └── wireless │ │ ├── h88k-v3 │ │ │ └── rootfs │ │ │ │ └── etc │ │ │ │ ├── inittab │ │ │ │ ├── board.d │ │ │ │ ├── 00_model │ │ │ │ ├── 01_led │ │ │ │ └── 99-default_network │ │ │ │ └── config │ │ │ │ └── wireless │ │ ├── h96-max-m2 │ │ │ └── rootfs │ │ │ │ └── etc │ │ │ │ └── inittab │ │ ├── mrkaio-m68s │ │ │ └── rootfs │ │ │ │ └── etc │ │ │ │ └── board.d │ │ │ │ ├── 00_model │ │ │ │ └── 99-default_network │ │ ├── e25 │ │ │ └── rootfs │ │ │ │ └── etc │ │ │ │ └── board.d │ │ │ │ ├── 00_model │ │ │ │ └── 99-default_network │ │ ├── r66s │ │ │ └── rootfs │ │ │ │ └── etc │ │ │ │ └── board.d │ │ │ │ ├── 00_model │ │ │ │ └── 99-default_network │ │ ├── r68s │ │ │ └── rootfs │ │ │ │ └── etc │ │ │ │ └── board.d │ │ │ │ ├── 00_model │ │ │ │ └── 99-default_network │ │ ├── wxy-oect │ │ │ └── rootfs │ │ │ │ └── etc │ │ │ │ └── openwrt-board-release.conf │ │ ├── s922x-oes-plus │ │ │ └── rootfs │ │ │ │ └── etc │ │ │ │ └── openwrt-board-release.conf │ │ └── a311d-oes │ │ │ └── rootfs │ │ │ └── etc │ │ │ └── openwrt-board-release.conf │ ├── common-files │ │ ├── etc │ │ │ ├── modprobe.d │ │ │ │ └── brcmfmac.conf │ │ │ ├── fstab │ │ │ ├── banner │ │ │ ├── config │ │ │ │ ├── fstab │ │ │ │ └── amlogic │ │ │ ├── custom_service │ │ │ │ └── start_service.sh │ │ │ └── profile.d │ │ │ │ └── 30-sysinfo.sh │ │ ├── sbin │ │ │ ├── kmod │ │ │ └── firstboot │ │ ├── usr │ │ │ ├── bin │ │ │ │ ├── 7z │ │ │ │ └── cpustat │ │ │ └── sbin │ │ │ │ ├── openwrt-swap │ │ │ │ ├── openwrt-tf │ │ │ │ └── openwrt-openvfd │ │ ├── lib │ │ │ └── firmware │ │ │ │ ├── regulatory.db │ │ │ │ └── regulatory.db.p7s │ │ └── bin │ │ │ └── getcpu │ └── platform-files │ │ ├── allwinner │ │ └── rootfs │ │ │ └── etc │ │ │ └── inittab │ │ ├── amlogic │ │ └── rootfs │ │ │ └── etc │ │ │ └── inittab │ │ └── rockchip │ │ └── rootfs │ │ └── etc │ │ └── inittab ├── scripts │ ├── ubuntu2204-make-openwrt-depends │ └── ubuntu2404-make-openwrt-depends ├── README.cn.md └── README.md ├── config ├── docker │ ├── Dockerfile │ └── make_docker_image.sh ├── README.md ├── openwrt_main │ ├── diy-part1.sh │ └── diy-part2.sh ├── immortalwrt_master │ ├── diy-part1.sh │ └── diy-part2.sh └── lede_master │ ├── diy-part1.sh │ └── diy-part2.sh ├── .gitignore └── action.yml /.github/.gitkeep: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /make-openwrt/openwrt-files/different-files/e20c/rootfs/etc/modules.d/mt7601u: -------------------------------------------------------------------------------- 1 | mt7601u 2 | -------------------------------------------------------------------------------- /make-openwrt/openwrt-files/different-files/e20c/rootfs/etc/modules.d/mt7663u: -------------------------------------------------------------------------------- 1 | mt7663u 2 | -------------------------------------------------------------------------------- /make-openwrt/openwrt-files/different-files/e20c/rootfs/etc/modules.d/mt76x0u: -------------------------------------------------------------------------------- 1 | mt76x0u 2 | -------------------------------------------------------------------------------- /make-openwrt/openwrt-files/different-files/e20c/rootfs/etc/modules.d/mt76x2u: -------------------------------------------------------------------------------- 1 | mt76x2u 2 | -------------------------------------------------------------------------------- /make-openwrt/openwrt-files/different-files/e20c/rootfs/etc/modules.d/mt7921u: -------------------------------------------------------------------------------- 1 | mt7921u 2 | -------------------------------------------------------------------------------- /make-openwrt/openwrt-files/different-files/e20c/rootfs/etc/modules.d/rk_gpu: -------------------------------------------------------------------------------- 1 | mali 2 | -------------------------------------------------------------------------------- /make-openwrt/openwrt-files/different-files/e20c/rootfs/etc/modules.d/rtl8168: -------------------------------------------------------------------------------- 1 | rtl8168 2 | -------------------------------------------------------------------------------- /make-openwrt/openwrt-files/different-files/h28k/rootfs/etc/modules.d/mt7601u: -------------------------------------------------------------------------------- 1 | mt7601u 2 | -------------------------------------------------------------------------------- /make-openwrt/openwrt-files/different-files/h28k/rootfs/etc/modules.d/mt7663u: -------------------------------------------------------------------------------- 1 | mt7663u 2 | -------------------------------------------------------------------------------- /make-openwrt/openwrt-files/different-files/h28k/rootfs/etc/modules.d/mt76x0u: -------------------------------------------------------------------------------- 1 | mt76x0u 2 | -------------------------------------------------------------------------------- /make-openwrt/openwrt-files/different-files/h28k/rootfs/etc/modules.d/mt76x2u: -------------------------------------------------------------------------------- 1 | mt76x2u 2 | -------------------------------------------------------------------------------- /make-openwrt/openwrt-files/different-files/h28k/rootfs/etc/modules.d/mt7921u: -------------------------------------------------------------------------------- 1 | mt7921u 2 | -------------------------------------------------------------------------------- /make-openwrt/openwrt-files/different-files/h28k/rootfs/etc/modules.d/rk_gpu: -------------------------------------------------------------------------------- 1 | mali 2 | -------------------------------------------------------------------------------- /make-openwrt/openwrt-files/different-files/h28k/rootfs/etc/modules.d/rtl8168: -------------------------------------------------------------------------------- 1 | rtl8168 2 | -------------------------------------------------------------------------------- /make-openwrt/openwrt-files/different-files/h66k/rootfs/etc/modules.d/mt7921e: -------------------------------------------------------------------------------- 1 | mt7921e 2 | -------------------------------------------------------------------------------- /make-openwrt/openwrt-files/different-files/h66k/rootfs/etc/modules.d/pwm-fan: -------------------------------------------------------------------------------- 1 | pwm_fan 2 | -------------------------------------------------------------------------------- /make-openwrt/openwrt-files/different-files/h68k/rootfs/etc/modules.d/mt7915e: -------------------------------------------------------------------------------- 1 | mt7915e 2 | -------------------------------------------------------------------------------- /make-openwrt/openwrt-files/different-files/h68k/rootfs/etc/modules.d/mt7921e: -------------------------------------------------------------------------------- 1 | mt7921e 2 | -------------------------------------------------------------------------------- /make-openwrt/openwrt-files/different-files/h68k/rootfs/etc/modules.d/pwm-fan: -------------------------------------------------------------------------------- 1 | pwm_fan 2 | -------------------------------------------------------------------------------- /make-openwrt/openwrt-files/different-files/h69k/rootfs/etc/modules.d/mt7915e: -------------------------------------------------------------------------------- 1 | mt7915e 2 | -------------------------------------------------------------------------------- /make-openwrt/openwrt-files/different-files/h69k/rootfs/etc/modules.d/mt7921e: -------------------------------------------------------------------------------- 1 | mt7921e 2 | -------------------------------------------------------------------------------- /make-openwrt/openwrt-files/different-files/h69k/rootfs/etc/modules.d/pwm-fan: -------------------------------------------------------------------------------- 1 | pwm_fan 2 | -------------------------------------------------------------------------------- /make-openwrt/openwrt-files/different-files/rock5c/rootfs/etc/modules.d/rk_npu: -------------------------------------------------------------------------------- 1 | rknpu 2 | -------------------------------------------------------------------------------- /make-openwrt/openwrt-files/different-files/h68k/rootfs/etc/modules.d/rk_crypto: -------------------------------------------------------------------------------- 1 | rk_crypto2 2 | -------------------------------------------------------------------------------- /make-openwrt/openwrt-files/different-files/h69k/rootfs/etc/modules.d/rk_crypto: -------------------------------------------------------------------------------- 1 | rk_crypto2 2 | -------------------------------------------------------------------------------- /make-openwrt/openwrt-files/different-files/photonicat/rootfs/etc/modules.d/rk_npu: -------------------------------------------------------------------------------- 1 | rknpu 2 | -------------------------------------------------------------------------------- /make-openwrt/openwrt-files/different-files/rock5c/rootfs/etc/modules.d/ath10k: -------------------------------------------------------------------------------- 1 | ath10k_core 2 | -------------------------------------------------------------------------------- /make-openwrt/openwrt-files/different-files/rock5c/rootfs/etc/modules.d/mt7921e: -------------------------------------------------------------------------------- 1 | mt7921e 2 | -------------------------------------------------------------------------------- /make-openwrt/openwrt-files/different-files/rock5c/rootfs/etc/modules.d/pwm_fan: -------------------------------------------------------------------------------- 1 | pwm_fan 2 | -------------------------------------------------------------------------------- /make-openwrt/openwrt-files/different-files/zcube1-max/rootfs/etc/modules.d/option: -------------------------------------------------------------------------------- 1 | option 2 | -------------------------------------------------------------------------------- /make-openwrt/openwrt-files/different-files/bdy-g18-pro/rootfs/etc/modules.d/50-mt7615e: -------------------------------------------------------------------------------- 1 | mt7615e 2 | -------------------------------------------------------------------------------- /make-openwrt/openwrt-files/different-files/h66k/rootfs/etc/modules.d/ath10k-pci: -------------------------------------------------------------------------------- 1 | ath10k_pci 2 | -------------------------------------------------------------------------------- /make-openwrt/openwrt-files/different-files/h69k/rootfs/etc/modules.d/usb-serial-option: -------------------------------------------------------------------------------- 1 | option 2 | -------------------------------------------------------------------------------- /make-openwrt/openwrt-files/different-files/jp-tvbox/rootfs/etc/modules.d/brcmfmac: -------------------------------------------------------------------------------- 1 | brcmfmac 2 | -------------------------------------------------------------------------------- /make-openwrt/openwrt-files/different-files/jp-tvbox/rootfs/etc/modules.d/brcmutil: -------------------------------------------------------------------------------- 1 | brcmutil 2 | -------------------------------------------------------------------------------- /make-openwrt/openwrt-files/different-files/photonicat/rootfs/etc/modules.d/mt7921e: -------------------------------------------------------------------------------- 1 | mt7921e 2 | -------------------------------------------------------------------------------- /make-openwrt/openwrt-files/different-files/photonicat/rootfs/etc/modules.d/pwm_fan: -------------------------------------------------------------------------------- 1 | pwm_fan 2 | -------------------------------------------------------------------------------- /make-openwrt/openwrt-files/different-files/rock5c/rootfs/etc/modules.d/ath10k-pci: -------------------------------------------------------------------------------- 1 | ath10k_pci 2 | -------------------------------------------------------------------------------- /make-openwrt/openwrt-files/different-files/rock5c/rootfs/etc/modules.d/ath11k-pci: -------------------------------------------------------------------------------- 1 | ath11k_pci 2 | -------------------------------------------------------------------------------- /make-openwrt/openwrt-files/different-files/rock5c/rootfs/etc/modules.d/rk_gpu: -------------------------------------------------------------------------------- 1 | bifrost_kbase 2 | -------------------------------------------------------------------------------- /make-openwrt/openwrt-files/different-files/ruisen-box/rootfs/etc/modules.d/mt7921e: -------------------------------------------------------------------------------- 1 | mt7921e 2 | -------------------------------------------------------------------------------- /make-openwrt/openwrt-files/different-files/ruisen-box/rootfs/etc/modules.d/pwm-fan: -------------------------------------------------------------------------------- 1 | pwm_fan 2 | -------------------------------------------------------------------------------- /make-openwrt/openwrt-files/different-files/bdy-g18-pro/rootfs/etc/modules.d/50-rtl8365mb: -------------------------------------------------------------------------------- 1 | rtl8365mb 2 | -------------------------------------------------------------------------------- /make-openwrt/openwrt-files/different-files/bdy-g18-pro/rootfs/etc/modules.d/60-leds-gpio: -------------------------------------------------------------------------------- 1 | leds-gpio 2 | -------------------------------------------------------------------------------- /make-openwrt/openwrt-files/different-files/nsy-g16-plus/rootfs/etc/modules.d/50-mt7615e: -------------------------------------------------------------------------------- 1 | mt7615e 2 | -------------------------------------------------------------------------------- /make-openwrt/openwrt-files/different-files/nsy-g16-plus/rootfs/etc/modules.d/50-rtl8365mb: -------------------------------------------------------------------------------- 1 | rtl8365mb 2 | -------------------------------------------------------------------------------- /make-openwrt/openwrt-files/different-files/nsy-g16-plus/rootfs/etc/modules.d/60-leds-gpio: -------------------------------------------------------------------------------- 1 | leds-gpio 2 | -------------------------------------------------------------------------------- /make-openwrt/openwrt-files/different-files/nsy-g68-plus/rootfs/etc/modules.d/50-mt7921e: -------------------------------------------------------------------------------- 1 | mt7921e 2 | -------------------------------------------------------------------------------- /make-openwrt/openwrt-files/different-files/nsy-g68-plus/rootfs/etc/modules.d/50-rtl8365mb: -------------------------------------------------------------------------------- 1 | rtl8365mb 2 | -------------------------------------------------------------------------------- /make-openwrt/openwrt-files/different-files/nsy-g68-plus/rootfs/etc/modules.d/60-leds-gpio: -------------------------------------------------------------------------------- 1 | leds-gpio 2 | -------------------------------------------------------------------------------- /make-openwrt/openwrt-files/different-files/photonicat/rootfs/etc/modules.d/rk_gpu: -------------------------------------------------------------------------------- 1 | bifrost_kbase 2 | -------------------------------------------------------------------------------- /make-openwrt/openwrt-files/different-files/rock5c/rootfs/etc/modules.d/ath11k: -------------------------------------------------------------------------------- 1 | ath11k frame_mode=2 2 | -------------------------------------------------------------------------------- /make-openwrt/openwrt-files/different-files/rock5c/rootfs/etc/modules.d/mt7915e: -------------------------------------------------------------------------------- 1 | mt7915e wed_enable=Y 2 | -------------------------------------------------------------------------------- /make-openwrt/openwrt-files/different-files/ruisen-box/rootfs/etc/modules.d/ath10k-pci: -------------------------------------------------------------------------------- 1 | ath10k_pci 2 | -------------------------------------------------------------------------------- /make-openwrt/openwrt-files/different-files/zcube1-max/rootfs/etc/modules.d/usb-hub: -------------------------------------------------------------------------------- 1 | onboard_usb_hub 2 | -------------------------------------------------------------------------------- /make-openwrt/openwrt-files/different-files/bdy-g18-pro/rootfs/etc/modules.d/49-realtek-dsa: -------------------------------------------------------------------------------- 1 | realtek_dsa 2 | -------------------------------------------------------------------------------- /make-openwrt/openwrt-files/different-files/h66k/rootfs/etc/modules.d/ath10k: -------------------------------------------------------------------------------- 1 | ath10k_core frame_mode=2 2 | -------------------------------------------------------------------------------- /make-openwrt/openwrt-files/different-files/nsy-g16-plus/rootfs/etc/modules.d/49-realtek-dsa: -------------------------------------------------------------------------------- 1 | realtek_dsa 2 | -------------------------------------------------------------------------------- /make-openwrt/openwrt-files/different-files/nsy-g68-plus/rootfs/etc/modules.d/49-realtek-dsa: -------------------------------------------------------------------------------- 1 | realtek_dsa 2 | -------------------------------------------------------------------------------- /make-openwrt/openwrt-files/different-files/photonicat/rootfs/etc/modules.d/ath10k: -------------------------------------------------------------------------------- 1 | ath10k_core 2 | ath10k_pci 3 | -------------------------------------------------------------------------------- /make-openwrt/openwrt-files/different-files/ruisen-box/rootfs/etc/modules.d/ath10k: -------------------------------------------------------------------------------- 1 | ath10k_core frame_mode=2 2 | -------------------------------------------------------------------------------- /make-openwrt/openwrt-files/common-files/etc/modprobe.d/brcmfmac.conf: -------------------------------------------------------------------------------- 1 | options brcmfmac feature_disable=0x282000 2 | -------------------------------------------------------------------------------- /make-openwrt/openwrt-files/different-files/nanopc-t6/rootfs/etc/balance_irq: -------------------------------------------------------------------------------- 1 | xhci-hcd:usb5 6 2 | xhci-hcd:usb7 8 3 | -------------------------------------------------------------------------------- /make-openwrt/openwrt-files/different-files/rock5b/rootfs/etc/balance_irq: -------------------------------------------------------------------------------- 1 | xhci-hcd:usb5 6 2 | xhci-hcd:usb7 8 3 | -------------------------------------------------------------------------------- /make-openwrt/openwrt-files/different-files/bdy-g18-pro/rootfs/etc/modules.d/30-gpio-button-hotplug: -------------------------------------------------------------------------------- 1 | gpio-button-hotplug 2 | -------------------------------------------------------------------------------- /make-openwrt/openwrt-files/different-files/nsy-g16-plus/rootfs/etc/modules.d/30-gpio-button-hotplug: -------------------------------------------------------------------------------- 1 | gpio-button-hotplug 2 | -------------------------------------------------------------------------------- /make-openwrt/openwrt-files/different-files/nsy-g68-plus/rootfs/etc/modules.d/30-gpio-button-hotplug: -------------------------------------------------------------------------------- 1 | gpio-button-hotplug 2 | -------------------------------------------------------------------------------- /make-openwrt/openwrt-files/different-files/e20c/rootfs/etc/modules.d/rtw88: -------------------------------------------------------------------------------- 1 | rtw88_8821cu 2 | rtw88_8822bu 3 | rtw88_8822cu 4 | -------------------------------------------------------------------------------- /make-openwrt/openwrt-files/different-files/h28k/rootfs/etc/modules.d/rtw88: -------------------------------------------------------------------------------- 1 | rtw88_8821cu 2 | rtw88_8822bu 3 | rtw88_8822cu 4 | -------------------------------------------------------------------------------- /make-openwrt/openwrt-files/different-files/rock5c/rootfs/etc/modules.d/rtw89: -------------------------------------------------------------------------------- 1 | rtw89_8852ae 2 | rtw89_8852be 3 | rtw89_8852ce 4 | -------------------------------------------------------------------------------- /config/docker/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM scratch 2 | ADD openwrt-docker-armsr-armv8-default-rootfs.tar.gz / 3 | EXPOSE 22 53 80 443 7681 4 | ENTRYPOINT ["/sbin/init"] -------------------------------------------------------------------------------- /make-openwrt/openwrt-files/different-files/h68k/rootfs/etc/modules.d/snd-rk3568: -------------------------------------------------------------------------------- 1 | snd_soc_simple_card_utils 2 | snd_soc_simple_card 3 | snd_soc_rockchip_i2s 4 | -------------------------------------------------------------------------------- /make-openwrt/openwrt-files/different-files/h69k/rootfs/etc/modules.d/snd-rk3568: -------------------------------------------------------------------------------- 1 | snd_soc_simple_card_utils 2 | snd_soc_simple_card 3 | snd_soc_rockchip_i2s 4 | -------------------------------------------------------------------------------- /make-openwrt/openwrt-files/common-files/sbin/kmod: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ophub/amlogic-s9xxx-openwrt/HEAD/make-openwrt/openwrt-files/common-files/sbin/kmod -------------------------------------------------------------------------------- /make-openwrt/openwrt-files/common-files/usr/bin/7z: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ophub/amlogic-s9xxx-openwrt/HEAD/make-openwrt/openwrt-files/common-files/usr/bin/7z -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | !.gitignore 2 | /make-openwrt/kernel 3 | /make-openwrt/u-boot 4 | /openwrt 5 | /openwrt-armsr 6 | /out 7 | /tmp 8 | .DS_Store 9 | npm-debug.log* 10 | -------------------------------------------------------------------------------- /make-openwrt/openwrt-files/common-files/etc/fstab: -------------------------------------------------------------------------------- 1 | LABEL=ROOTFS / btrfs compress=zstd:6 0 1 2 | LABEL=BOOT /boot vfat defaults 0 2 3 | #tmpfs /tmp tmpfs defaults,nosuid 0 0 4 | -------------------------------------------------------------------------------- /make-openwrt/openwrt-files/different-files/rock5c/rootfs/etc/modules.d/rtw88: -------------------------------------------------------------------------------- 1 | rtw88_8821ce 2 | rtw88_8821cu 3 | rtw88_8822be 4 | rtw88_8822bu 5 | rtw88_8822ce 6 | rtw88_8822cu 7 | -------------------------------------------------------------------------------- /make-openwrt/openwrt-files/platform-files/allwinner/rootfs/etc/inittab: -------------------------------------------------------------------------------- 1 | ::sysinit:/etc/init.d/rcS S boot 2 | ::shutdown:/etc/init.d/rcS K shutdown 3 | ttyS0::askfirst:/usr/libexec/login.sh 4 | -------------------------------------------------------------------------------- /make-openwrt/openwrt-files/common-files/lib/firmware/regulatory.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ophub/amlogic-s9xxx-openwrt/HEAD/make-openwrt/openwrt-files/common-files/lib/firmware/regulatory.db -------------------------------------------------------------------------------- /make-openwrt/openwrt-files/common-files/lib/firmware/regulatory.db.p7s: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ophub/amlogic-s9xxx-openwrt/HEAD/make-openwrt/openwrt-files/common-files/lib/firmware/regulatory.db.p7s -------------------------------------------------------------------------------- /make-openwrt/openwrt-files/platform-files/amlogic/rootfs/etc/inittab: -------------------------------------------------------------------------------- 1 | ::sysinit:/etc/init.d/rcS S boot 2 | ::shutdown:/etc/init.d/rcS K shutdown 3 | ttyAML0::askfirst:/usr/libexec/login.sh 4 | tty0::askfirst:/usr/libexec/login.sh 5 | -------------------------------------------------------------------------------- /make-openwrt/openwrt-files/different-files/panther-x2/rootfs/etc/inittab: -------------------------------------------------------------------------------- 1 | ::sysinit:/etc/init.d/rcS S boot 2 | ::shutdown:/etc/init.d/rcS K shutdown 3 | tty0::askfirst:/usr/libexec/login.sh 4 | ttyS02::askfirst:/usr/libexec/login.sh 5 | -------------------------------------------------------------------------------- /make-openwrt/openwrt-files/different-files/h28k/rootfs/etc/inittab: -------------------------------------------------------------------------------- 1 | ::sysinit:/etc/init.d/rcS S boot 2 | ::shutdown:/etc/init.d/rcS K shutdown 3 | tty1::askfirst:/usr/libexec/login.sh 4 | ttyS0::askfirst:/usr/libexec/login.sh 5 | ttyFIQ0::askfirst:/usr/libexec/login.sh 6 | -------------------------------------------------------------------------------- /make-openwrt/openwrt-files/different-files/h88k/rootfs/etc/inittab: -------------------------------------------------------------------------------- 1 | ::sysinit:/etc/init.d/rcS S boot 2 | ::shutdown:/etc/init.d/rcS K shutdown 3 | tty1::askfirst:/usr/libexec/login.sh 4 | ttyS2::askfirst:/usr/libexec/login.sh 5 | ttyFIQ0::askfirst:/usr/libexec/login.sh 6 | -------------------------------------------------------------------------------- /make-openwrt/openwrt-files/different-files/ipc-r/rootfs/etc/inittab: -------------------------------------------------------------------------------- 1 | ::sysinit:/etc/init.d/rcS S boot 2 | ::shutdown:/etc/init.d/rcS K shutdown 3 | tty1::askfirst:/usr/libexec/login.sh 4 | ttyS2::askfirst:/usr/libexec/login.sh 5 | ttyFIQ0::askfirst:/usr/libexec/login.sh 6 | -------------------------------------------------------------------------------- /make-openwrt/openwrt-files/different-files/h88k-v3/rootfs/etc/inittab: -------------------------------------------------------------------------------- 1 | ::sysinit:/etc/init.d/rcS S boot 2 | ::shutdown:/etc/init.d/rcS K shutdown 3 | tty1::askfirst:/usr/libexec/login.sh 4 | ttyS2::askfirst:/usr/libexec/login.sh 5 | ttyFIQ0::askfirst:/usr/libexec/login.sh 6 | -------------------------------------------------------------------------------- /make-openwrt/openwrt-files/different-files/h96-max-m2/rootfs/etc/inittab: -------------------------------------------------------------------------------- 1 | ::sysinit:/etc/init.d/rcS S boot 2 | ::shutdown:/etc/init.d/rcS K shutdown 3 | tty1::askfirst:/usr/libexec/login.sh 4 | ttyS0::askfirst:/usr/libexec/login.sh 5 | ttyFIQ0::askfirst:/usr/libexec/login.sh 6 | -------------------------------------------------------------------------------- /make-openwrt/openwrt-files/different-files/nanopc-t6/rootfs/etc/inittab: -------------------------------------------------------------------------------- 1 | ::sysinit:/etc/init.d/rcS S boot 2 | ::shutdown:/etc/init.d/rcS K shutdown 3 | tty1::askfirst:/usr/libexec/login.sh 4 | ttyS2::askfirst:/usr/libexec/login.sh 5 | ttyFIQ0::askfirst:/usr/libexec/login.sh 6 | -------------------------------------------------------------------------------- /make-openwrt/openwrt-files/different-files/photonicat/rootfs/etc/inittab: -------------------------------------------------------------------------------- 1 | ::sysinit:/etc/init.d/rcS S boot 2 | ::shutdown:/etc/init.d/rcS K shutdown 3 | tty1::askfirst:/usr/libexec/login.sh 4 | ttyS2::askfirst:/usr/libexec/login.sh 5 | ttyFIQ0::askfirst:/usr/libexec/login.sh 6 | -------------------------------------------------------------------------------- /make-openwrt/openwrt-files/different-files/rock5b/rootfs/etc/inittab: -------------------------------------------------------------------------------- 1 | ::sysinit:/etc/init.d/rcS S boot 2 | ::shutdown:/etc/init.d/rcS K shutdown 3 | tty1::askfirst:/usr/libexec/login.sh 4 | ttyS2::askfirst:/usr/libexec/login.sh 5 | ttyFIQ0::askfirst:/usr/libexec/login.sh 6 | -------------------------------------------------------------------------------- /make-openwrt/openwrt-files/different-files/rock5c/rootfs/etc/inittab: -------------------------------------------------------------------------------- 1 | ::sysinit:/etc/init.d/rcS S boot 2 | ::shutdown:/etc/init.d/rcS K shutdown 3 | tty1::askfirst:/usr/libexec/login.sh 4 | ttyS2::askfirst:/usr/libexec/login.sh 5 | ttyFIQ0::askfirst:/usr/libexec/login.sh 6 | -------------------------------------------------------------------------------- /make-openwrt/openwrt-files/platform-files/rockchip/rootfs/etc/inittab: -------------------------------------------------------------------------------- 1 | ::sysinit:/etc/init.d/rcS S boot 2 | ::shutdown:/etc/init.d/rcS K shutdown 3 | tty1::askfirst:/usr/libexec/login.sh 4 | ttyS2::askfirst:/usr/libexec/login.sh 5 | ttyFIQ0::askfirst:/usr/libexec/login.sh 6 | -------------------------------------------------------------------------------- /make-openwrt/openwrt-files/different-files/h66k/rootfs/etc/board.d/01_led: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # Copyright (C) 2015 OpenWrt.org 4 | # 5 | 6 | . /lib/functions/uci-defaults.sh 7 | 8 | board_config_update 9 | 10 | ucidef_set_led_netdev "wan" "WAN" "blue:wan" "eth0" 11 | 12 | board_config_flush 13 | 14 | exit 0 15 | -------------------------------------------------------------------------------- /make-openwrt/openwrt-files/different-files/h68k/rootfs/etc/board.d/01_led: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # Copyright (C) 2015 OpenWrt.org 4 | # 5 | 6 | . /lib/functions/uci-defaults.sh 7 | 8 | board_config_update 9 | 10 | ucidef_set_led_netdev "wan" "WAN" "blue:wan" "eth0" 11 | 12 | board_config_flush 13 | 14 | exit 0 15 | -------------------------------------------------------------------------------- /make-openwrt/openwrt-files/different-files/h69k/rootfs/etc/board.d/01_leds: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # Copyright (C) 2015 OpenWrt.org 4 | # 5 | 6 | . /lib/functions/uci-defaults.sh 7 | 8 | board_config_update 9 | 10 | ucidef_set_led_netdev "wan" "WAN" "blue:wan" "eth0" 11 | 12 | board_config_flush 13 | 14 | exit 0 15 | -------------------------------------------------------------------------------- /make-openwrt/openwrt-files/different-files/h88k/rootfs/etc/board.d/01_led: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # Copyright (C) 2015 OpenWrt.org 4 | # 5 | 6 | . /lib/functions/uci-defaults.sh 7 | 8 | board_config_update 9 | 10 | ucidef_set_led_netdev "wan" "WAN" "blue:net" "eth1" 11 | 12 | board_config_flush 13 | 14 | exit 0 15 | -------------------------------------------------------------------------------- /make-openwrt/openwrt-files/different-files/photonicat/rootfs/etc/board.d/00_model: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2015 OpenWrt.org 2 | 3 | . /lib/functions/uci-defaults.sh 4 | 5 | board_config_update 6 | 7 | ucidef_set_board_id "Photonicat" 8 | ucidef_set_model_name "Photonicat" 9 | 10 | board_config_flush 11 | 12 | exit 0 13 | -------------------------------------------------------------------------------- /make-openwrt/openwrt-files/different-files/photonicat/rootfs/etc/board.d/01_led: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # Copyright (C) 2015 OpenWrt.org 4 | # 5 | 6 | . /lib/functions/uci-defaults.sh 7 | 8 | board_config_update 9 | 10 | ucidef_set_led_netdev "lan" "LAN" "blue:lan" "eth0" 11 | 12 | board_config_flush 13 | 14 | exit 0 15 | -------------------------------------------------------------------------------- /make-openwrt/openwrt-files/different-files/rock5c/rootfs/etc/board.d/01_led: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # Copyright (C) 2015 OpenWrt.org 4 | # 5 | 6 | . /lib/functions/uci-defaults.sh 7 | 8 | board_config_update 9 | 10 | ucidef_set_led_netdev "lan" "LAN" "blue:lan" "eth0" 11 | 12 | board_config_flush 13 | 14 | exit 0 15 | -------------------------------------------------------------------------------- /make-openwrt/openwrt-files/different-files/ruisen-box/rootfs/etc/board.d/01_led: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # Copyright (C) 2015 OpenWrt.org 4 | # 5 | 6 | . /lib/functions/uci-defaults.sh 7 | 8 | board_config_update 9 | 10 | ucidef_set_led_netdev "wan" "WAN" "blue:wan" "eth0" 11 | 12 | board_config_flush 13 | 14 | exit 0 15 | -------------------------------------------------------------------------------- /make-openwrt/openwrt-files/different-files/mrkaio-m68s/rootfs/etc/board.d/00_model: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2015 OpenWrt.org 2 | 3 | . /lib/functions/uci-defaults.sh 4 | 5 | board_config_update 6 | 7 | ucidef_set_board_id "ezpro,mrkaio-m68s" 8 | ucidef_set_model_name "EZPRO Mrkaio M68S" 9 | 10 | board_config_flush 11 | 12 | exit 0 13 | -------------------------------------------------------------------------------- /make-openwrt/openwrt-files/different-files/e25/rootfs/etc/board.d/00_model: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2015 OpenWrt.org 2 | # Copyright (C) 2016 Yousong Zhou 3 | 4 | . /lib/functions/uci-defaults.sh 5 | 6 | board_config_update 7 | 8 | ucidef_set_board_id "radxa,e25" 9 | ucidef_set_model_name "Radxa E25" 10 | 11 | board_config_flush 12 | 13 | exit 0 14 | -------------------------------------------------------------------------------- /make-openwrt/openwrt-files/different-files/e20c/rootfs/etc/board.d/00_model: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2015 OpenWrt.org 2 | # Copyright (C) 2016 Yousong Zhou 3 | 4 | . /lib/functions/uci-defaults.sh 5 | 6 | board_config_update 7 | 8 | ucidef_set_board_id "radxa,e20c" 9 | ucidef_set_model_name "Radxa E20C" 10 | 11 | board_config_flush 12 | 13 | exit 0 14 | -------------------------------------------------------------------------------- /make-openwrt/openwrt-files/different-files/e20c/rootfs/etc/board.d/01_led: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # Copyright (C) 2015 OpenWrt.org 4 | # 5 | 6 | . /lib/functions/uci-defaults.sh 7 | 8 | board_config_update 9 | 10 | ucidef_set_led_netdev "wan" "WAN" "green:wan" "eth1" 11 | ucidef_set_led_netdev "lan" "LAN" "green:lan" "eth0" 12 | 13 | board_config_flush 14 | 15 | exit 0 16 | -------------------------------------------------------------------------------- /make-openwrt/openwrt-files/different-files/h28k/rootfs/etc/board.d/00_model: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2015 OpenWrt.org 2 | # Copyright (C) 2016 Yousong Zhou 3 | 4 | . /lib/functions/uci-defaults.sh 5 | 6 | board_config_update 7 | 8 | ucidef_set_board_id "hlink,h28k" 9 | ucidef_set_model_name "Hlink H28K" 10 | 11 | board_config_flush 12 | 13 | exit 0 14 | -------------------------------------------------------------------------------- /make-openwrt/openwrt-files/different-files/h66k/rootfs/etc/board.d/00_model: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2015 OpenWrt.org 2 | # Copyright (C) 2016 Yousong Zhou 3 | 4 | . /lib/functions/uci-defaults.sh 5 | 6 | board_config_update 7 | 8 | ucidef_set_board_id "hlink,h66k" 9 | ucidef_set_model_name "Hlink H66K" 10 | 11 | board_config_flush 12 | 13 | exit 0 14 | -------------------------------------------------------------------------------- /make-openwrt/openwrt-files/different-files/h68k/rootfs/etc/board.d/00_model: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2015 OpenWrt.org 2 | # Copyright (C) 2016 Yousong Zhou 3 | 4 | . /lib/functions/uci-defaults.sh 5 | 6 | board_config_update 7 | 8 | ucidef_set_board_id "hlink,h68k" 9 | ucidef_set_model_name "Hlink H68K" 10 | 11 | board_config_flush 12 | 13 | exit 0 14 | -------------------------------------------------------------------------------- /make-openwrt/openwrt-files/different-files/h69k/rootfs/etc/board.d/00_model: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2015 OpenWrt.org 2 | # Copyright (C) 2016 Yousong Zhou 3 | 4 | . /lib/functions/uci-defaults.sh 5 | 6 | board_config_update 7 | 8 | ucidef_set_board_id "hlink,h69k" 9 | ucidef_set_model_name "Hlink H69K" 10 | 11 | board_config_flush 12 | 13 | exit 0 14 | -------------------------------------------------------------------------------- /make-openwrt/openwrt-files/different-files/h88k/rootfs/etc/board.d/00_model: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2015 OpenWrt.org 2 | # Copyright (C) 2016 Yousong Zhou 3 | 4 | . /lib/functions/uci-defaults.sh 5 | 6 | board_config_update 7 | 8 | ucidef_set_board_id "hlink,h88k" 9 | ucidef_set_model_name "Hlink H88K" 10 | 11 | board_config_flush 12 | 13 | exit 0 14 | -------------------------------------------------------------------------------- /make-openwrt/openwrt-files/different-files/r66s/rootfs/etc/board.d/00_model: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2015 OpenWrt.org 2 | # Copyright (C) 2016 Yousong Zhou 3 | 4 | . /lib/functions/uci-defaults.sh 5 | 6 | board_config_update 7 | 8 | ucidef_set_board_id "rockchip" 9 | ucidef_set_model_name "FastRhino R66S" 10 | 11 | board_config_flush 12 | 13 | exit 0 14 | -------------------------------------------------------------------------------- /make-openwrt/openwrt-files/different-files/r68s/rootfs/etc/board.d/00_model: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2015 OpenWrt.org 2 | # Copyright (C) 2016 Yousong Zhou 3 | 4 | . /lib/functions/uci-defaults.sh 5 | 6 | board_config_update 7 | 8 | ucidef_set_board_id "rockchip" 9 | ucidef_set_model_name "FastRhino R68S" 10 | 11 | board_config_flush 12 | 13 | exit 0 14 | -------------------------------------------------------------------------------- /make-openwrt/openwrt-files/different-files/h88k-v3/rootfs/etc/board.d/00_model: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2015 OpenWrt.org 2 | # Copyright (C) 2016 Yousong Zhou 3 | 4 | . /lib/functions/uci-defaults.sh 5 | 6 | board_config_update 7 | 8 | ucidef_set_board_id "hlink,h88k-v3" 9 | ucidef_set_model_name "Hlink H88K-V3" 10 | 11 | board_config_flush 12 | 13 | exit 0 14 | -------------------------------------------------------------------------------- /make-openwrt/openwrt-files/different-files/rock5b/rootfs/etc/board.d/00_model: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2015 OpenWrt.org 2 | # Copyright (C) 2016 Yousong Zhou 3 | 4 | . /lib/functions/uci-defaults.sh 5 | 6 | board_config_update 7 | 8 | ucidef_set_board_id "radxa,rock-5b" 9 | ucidef_set_model_name "Radxa ROCK 5B" 10 | 11 | board_config_flush 12 | 13 | exit 0 14 | -------------------------------------------------------------------------------- /make-openwrt/openwrt-files/different-files/rock5c/rootfs/etc/board.d/00_model: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2015 OpenWrt.org 2 | # Copyright (C) 2016 Yousong Zhou 3 | 4 | . /lib/functions/uci-defaults.sh 5 | 6 | board_config_update 7 | 8 | ucidef_set_board_id "radxa,rock-5c" 9 | ucidef_set_model_name "Radxa ROCK 5C" 10 | 11 | board_config_flush 12 | 13 | exit 0 14 | -------------------------------------------------------------------------------- /make-openwrt/openwrt-files/different-files/ruisen-box/rootfs/etc/board.d/00_model: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2015 OpenWrt.org 2 | # Copyright (C) 2016 Yousong Zhou 3 | 4 | . /lib/functions/uci-defaults.sh 5 | 6 | board_config_update 7 | 8 | ucidef_set_board_id "ruisen-box" 9 | ucidef_set_model_name "RUISEN Board" 10 | 11 | board_config_flush 12 | 13 | exit 0 14 | -------------------------------------------------------------------------------- /make-openwrt/openwrt-files/different-files/zcube1-max/rootfs/etc/board.d/00_model: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2015 OpenWrt.org 2 | # Copyright (C) 2016 Yousong Zhou 3 | 4 | . /lib/functions/uci-defaults.sh 5 | 6 | board_config_update 7 | 8 | ucidef_set_board_id "zimo,zcube1-max" 9 | ucidef_set_model_name "ZCuble1 Max" 10 | 11 | board_config_flush 12 | 13 | exit 0 14 | -------------------------------------------------------------------------------- /make-openwrt/openwrt-files/different-files/ipc-r/rootfs/etc/board.d/00_model: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2015 OpenWrt.org 2 | # Copyright (C) 2016 Yousong Zhou 3 | 4 | . /lib/functions/uci-defaults.sh 5 | 6 | board_config_update 7 | 8 | ucidef_set_board_id "rockchip,rk3588-ipc-v1" 9 | ucidef_set_model_name "IPC V1 Board" 10 | 11 | board_config_flush 12 | 13 | exit 0 14 | -------------------------------------------------------------------------------- /make-openwrt/openwrt-files/different-files/jp-tvbox/rootfs/etc/board.d/00_model: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2015 OpenWrt.org 2 | # Copyright (C) 2016 Yousong Zhou 3 | 4 | . /lib/functions/uci-defaults.sh 5 | 6 | board_config_update 7 | 8 | ucidef_set_board_id "jianpian,jptv-3566" 9 | ucidef_set_model_name "JP TVbox 3566" 10 | 11 | board_config_flush 12 | 13 | exit 0 14 | -------------------------------------------------------------------------------- /make-openwrt/openwrt-files/different-files/nanopc-t6/rootfs/etc/board.d/00_model: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2015 OpenWrt.org 2 | # Copyright (C) 2016 Yousong Zhou 3 | 4 | . /lib/functions/uci-defaults.sh 5 | 6 | board_config_update 7 | 8 | ucidef_set_board_id "rockchip" 9 | ucidef_set_model_name "FriendlyElec NanoPC-T6" 10 | 11 | board_config_flush 12 | 13 | exit 0 14 | -------------------------------------------------------------------------------- /make-openwrt/openwrt-files/different-files/h28k/rootfs/etc/board.d/01_led: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # Copyright (C) 2015 OpenWrt.org 4 | # 5 | 6 | . /lib/functions/uci-defaults.sh 7 | 8 | board_config_update 9 | 10 | ucidef_set_led_default "work" "WORK" "led_green" "1" 11 | ucidef_set_led_netdev "wan" "WAN" "led_amber" "eth1" 12 | ucidef_set_led_netdev "lan" "LAN" "led_blue" "eth0" 13 | 14 | board_config_flush 15 | 16 | exit 0 17 | -------------------------------------------------------------------------------- /make-openwrt/openwrt-files/different-files/jp-tvbox/rootfs/etc/balance_irq: -------------------------------------------------------------------------------- 1 | # /etc/balance_irq 2 | # 用于中断设备的负载均衡 3 | # 用法: 4 | # 首先, 用 cat /proc/interrupts 进行观察 5 | # 如果某个cpu负载过重,可以把对应的中断设备迁移到其它cpu 6 | # /proc/interrupt格式: 7 | # 最左列:中断号 8 | # 第 2 至第 2+cpus 列:cpu单核上产生的中断数量 9 | # 最右列:对应的设备名 10 | # 11 | # 本配置文件格式: 12 | # 第1列: 设备名 13 | # 第2列: 期望绑定在第几个cpu (从1开始) 14 | # 15 | # 配置文件改好,运行 balethirq.pl 即时生效 16 | 17 | # gmac1 18 | eth0 4 19 | -------------------------------------------------------------------------------- /make-openwrt/openwrt-files/different-files/zcube1-max/rootfs/etc/balance_irq: -------------------------------------------------------------------------------- 1 | # /etc/balance_irq 2 | # 用于中断设备的负载均衡 3 | # 用法: 4 | # 首先, 用 cat /proc/interrupts 进行观察 5 | # 如果某个cpu负载过重,可以把对应的中断设备迁移到其它cpu 6 | # /proc/interrupt格式: 7 | # 最左列:中断号 8 | # 第 2 至第 2+cpus 列:cpu单核上产生的中断数量 9 | # 最右列:对应的设备名 10 | # 11 | # 本配置文件格式: 12 | # 第1列: 设备名 13 | # 第2列: 期望绑定在第几个cpu (从1开始) 14 | # 15 | # 配置文件改好,运行 balethirq.pl 即时生效 16 | 17 | eth0 6 18 | xhci-hcd:usb3 5 19 | xhci-hcd:usb1 4 20 | -------------------------------------------------------------------------------- /make-openwrt/openwrt-files/different-files/ipc-r/rootfs/etc/config/wireless: -------------------------------------------------------------------------------- 1 | 2 | config wifi-device 'radio0' 3 | option type 'mac80211' 4 | option path 'platform/fe2d0000.mmc/mmc_host/mmc2/mmc2:0001/mmc2:0001:2' 5 | option legacy_rates '1' 6 | option mu_beamformer '0' 7 | option country 'SG' 8 | option band '5g' 9 | option channel '36' 10 | 11 | config wifi-iface 'default_radio0' 12 | option device 'radio0' 13 | option network 'lan' 14 | option mode 'ap' 15 | option ssid 'OpenWrt' 16 | option encryption 'none' 17 | 18 | -------------------------------------------------------------------------------- /make-openwrt/openwrt-files/common-files/etc/banner: -------------------------------------------------------------------------------- 1 | ____ _ __ __ __ ___ ____ 2 | / __ \____ ___ ____| | / /____/ /_ / / / | / __ ) 3 | / / / / __ \/ _ \/ __ \ | /| / / ___/ __/ / / / /| | / __ | 4 | / /_/ / /_/ / __/ / / / |/ |/ / / / /_ / /___/ ___ |/ /_/ / 5 | \____/ .___/\___/_/ /_/|__/|__/_/ \__/ /_____/_/ |_/_____/ 6 | /_/ H E L L O - W O R L D @ W I R E L E S S - F R E E D O M 7 | ─────────────────────────────────────────────────────────────────────── 8 | -------------------------------------------------------------------------------- /make-openwrt/openwrt-files/common-files/etc/config/fstab: -------------------------------------------------------------------------------- 1 | config global 2 | option anon_swap '0' 3 | option anon_mount '1' 4 | option auto_swap '0' 5 | option auto_mount '1' 6 | option delay_root '5' 7 | option check_fs '0' 8 | 9 | config mount 10 | option enabled '1' 11 | option target '/boot' 12 | option label 'BOOT' 13 | option fstype 'vfat' 14 | option enabled_fsck '1' 15 | 16 | config mount 17 | option enabled '1' 18 | option target '/rom' 19 | option label 'ROOTFS' 20 | option fstype 'btrfs' 21 | option options 'compress=zstd:6' 22 | option enabled_fsck '1' 23 | -------------------------------------------------------------------------------- /make-openwrt/openwrt-files/different-files/h68k/rootfs/etc/config/wireless: -------------------------------------------------------------------------------- 1 | 2 | config wifi-device 'radio0' 3 | option type 'mac80211' 4 | option path '3c0000000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0' 5 | option band '5g' 6 | option country 'US' 7 | option legacy_rates '1' 8 | option mu_beamformer '0' 9 | option channel '36' 10 | option htmode 'HE80' 11 | 12 | config wifi-iface 'default_radio0' 13 | option device 'radio0' 14 | option network 'lan' 15 | option mode 'ap' 16 | option ssid 'H68K_Wireless' 17 | option encryption 'psk2' 18 | option key 'password' 19 | 20 | -------------------------------------------------------------------------------- /make-openwrt/openwrt-files/different-files/h69k/rootfs/etc/config/wireless: -------------------------------------------------------------------------------- 1 | 2 | config wifi-device 'radio0' 3 | option type 'mac80211' 4 | option path '3c0000000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0' 5 | option band '5g' 6 | option country 'US' 7 | option legacy_rates '1' 8 | option mu_beamformer '0' 9 | option channel '36' 10 | option htmode 'HE80' 11 | 12 | config wifi-iface 'default_radio0' 13 | option device 'radio0' 14 | option network 'lan' 15 | option mode 'ap' 16 | option ssid 'H69K_Wireless' 17 | option encryption 'psk2' 18 | option key 'password' 19 | 20 | -------------------------------------------------------------------------------- /make-openwrt/openwrt-files/common-files/etc/config/amlogic: -------------------------------------------------------------------------------- 1 | 2 | config amlogic 'config' 3 | option enable '1' 4 | option amlogic_firmware_repo 'https://github.com/ophub/amlogic-s9xxx-openwrt' 5 | option amlogic_firmware_tag '_openwrt_main_' 6 | option amlogic_firmware_suffix '.img.gz' 7 | option amlogic_kernel_path 'https://github.com/ophub/kernel' 8 | option amlogic_kernel_tags '' 9 | option amlogic_kernel_branch '' 10 | option amlogic_firmware_config '1' 11 | option amlogic_write_bootloader '0' 12 | option amlogic_shared_fstype 'btrfs' 13 | 14 | config settings 'armcpu' 15 | option governor0 'schedutil' 16 | option minfreq0 '1000000' 17 | option maxfreq0 '1800000' 18 | -------------------------------------------------------------------------------- /config/README.md: -------------------------------------------------------------------------------- 1 | # Instructions / 使用说明 2 | 3 | Please refer to the relevant instructions in the [user manual](../documents) for customizing OpenWrt. 4 | 5 | OpenWrt 的个性化定制方法,请参考 [使用文档](../documents/README.cn.md) 中的相关说明。 6 | 7 | ## Naming Rules for Configuration Directories / 配置目录命名规则 8 | 9 | Use `sourceRepositoryName_branchName` as the naming convention for the configuration directory. For example, `openwrt_openwrt-24.10` indicates that the build is compiled using the `openwrt-24.10` branch from the https://github.com/openwrt/openwrt repository. 10 | 11 | 使用 OpenWrt 在 github.com 上的 `源码仓库名_分支名` 作为配置目录命名规则,例如使用 `openwrt_openwrt-24.10` 的方式表示使用 https://github.com/openwrt/openwrt 的源码分支 `openwrt-24.10` 进行编译。 12 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug-report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help us improve 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | --- 8 | 9 | **Device Information | 设备信息** 10 | - SOC: [e.g. S095x3] 11 | - Model [e.g. HK1] 12 | 13 | **OpenWrt Version | 系统版本** 14 | - Kernel Version: [e.g. 5.15.100] 15 | - Release: [e.g. official/lede/immortalwrt] 16 | 17 | **Describe the bug | 问题描述** 18 | All issues will only remain open for one week to prioritize resolving them. 19 | After that period, they will be closed but can still continue to be discussed in the thread. 20 | 所有的问题都只保留一周的开启状态供重点关注解决,超时将关闭,但仍然可以长期继续跟帖讨论。 21 | 22 | Please provide a detailed description of the issue and, if necessary, attach a screenshot. 23 | 详细描述问题,并在必要时附上屏幕截图。 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /config/openwrt_main/diy-part1.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #======================================================================================================================== 3 | # https://github.com/ophub/amlogic-s9xxx-openwrt 4 | # Description: Automatically Build OpenWrt 5 | # Function: Diy script (Before Update feeds, Modify the default IP, hostname, theme, add/remove software packages, etc.) 6 | # Source code repository: https://github.com/openwrt/openwrt / Branch: main 7 | #======================================================================================================================== 8 | 9 | # Add a feed source 10 | # sed -i '$a src-git lienol https://github.com/Lienol/openwrt-package' feeds.conf.default 11 | 12 | # other 13 | # rm -rf package/utils/{ucode,fbtest} 14 | 15 | -------------------------------------------------------------------------------- /make-openwrt/scripts/ubuntu2204-make-openwrt-depends: -------------------------------------------------------------------------------- 1 | ack antlr3 aria2 asciidoc autoconf automake autopoint binutils bison btrfs-progs build-essential bzip2 ca-certificates ccache cmake coreutils cpio curl device-tree-compiler fastjar flex g++-multilib gawk gcc-multilib gettext git git-core gperf gzip haveged help2man intltool jq libc6-dev-i386 libelf-dev libfuse-dev libglib2.0-dev libgmp3-dev libltdl-dev libmpc-dev libmpfr-dev libncurses5-dev libncursesw5-dev libpython3-dev libreadline-dev libssl-dev libtool libz-dev lrzsz mkisofs msmtp nano ninja-build ntpdate p7zip p7zip-full patch pigz pkgconf python2.7 python3 python3-pip python3-pyelftools python3-setuptools qemu-utils rsync scons squashfs-tools swig tar texinfo uglifyjs unzip upx upx-ucl vim wget xmlto xsltproc xxd xz-utils yasm zip zlib1g-dev zstd -------------------------------------------------------------------------------- /config/immortalwrt_master/diy-part1.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #======================================================================================================================== 3 | # https://github.com/ophub/amlogic-s9xxx-openwrt 4 | # Description: Automatically Build OpenWrt 5 | # Function: Diy script (Before Update feeds, Modify the default IP, hostname, theme, add/remove software packages, etc.) 6 | # Source code repository: https://github.com/immortalwrt/immortalwrt / Branch: master 7 | #======================================================================================================================== 8 | 9 | # Add a feed source 10 | # sed -i '$a src-git lienol https://github.com/Lienol/openwrt-package' feeds.conf.default 11 | 12 | # other 13 | # rm -rf package/emortal/{autosamba,ipv6-helper} 14 | 15 | -------------------------------------------------------------------------------- /config/lede_master/diy-part1.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #======================================================================================================================== 3 | # https://github.com/ophub/amlogic-s9xxx-openwrt 4 | # Description: Automatically Build OpenWrt for Amlogic s9xxx tv box 5 | # Function: Diy script (Before Update feeds, Modify the default IP, hostname, theme, add/remove software packages, etc.) 6 | # Source code repository: https://github.com/coolsnowwolf/lede / Branch: master 7 | #======================================================================================================================== 8 | 9 | # Add a feed source 10 | # sed -i '$a src-git lienol https://github.com/Lienol/openwrt-package' feeds.conf.default 11 | 12 | # other 13 | # rm -rf package/lean/{samba4,luci-app-samba4,luci-app-ttyd} 14 | 15 | -------------------------------------------------------------------------------- /make-openwrt/openwrt-files/common-files/bin/getcpu: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env perl 2 | #use strict; 3 | 4 | sub get_stat { 5 | open IN, "<", "/proc/stat"; 6 | $_ = ; 7 | chomp; 8 | close(IN); 9 | my ($cpu, $user, $nice, $system, $idle, $iowait, $irq, $softirq, $steal, $guest, $guest_nice) = split; 10 | my $Idle = $idle + $iowait; 11 | my $Non_Idle = $user + $nice + $system + $irq + $softirq + $steal + $guest + $guest_nice; 12 | return ($Idle, $Non_Idle); 13 | } 14 | 15 | my($prev_idle, $prev_non_idle) = &get_stat; 16 | my $prev_total = $prev_idle + $prev_non_idle; 17 | sleep(3); 18 | my($idle, $non_idle) = &get_stat; 19 | my $total = $idle + $non_idle; 20 | 21 | my $totald = $total - $prev_total; 22 | my $idled = $idle - $prev_idle; 23 | my $cpu_percentage = ($totald - $idled) / $totald * 100; 24 | 25 | $| = 1; 26 | open OUT, ">", "/tmp/cpuusage"; 27 | printf OUT "%0.1f\%", $cpu_percentage; 28 | close(OUT); 29 | 30 | exit(0); 31 | -------------------------------------------------------------------------------- /make-openwrt/openwrt-files/different-files/h88k-v3/rootfs/etc/board.d/01_led: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # Copyright (C) 2015 OpenWrt.org 4 | # 5 | 6 | . /lib/functions/uci-defaults.sh 7 | 8 | board_config_update 9 | 10 | machine_model=$(cat /proc/device-tree/model|tr -d "\000") 11 | 12 | case $machine_model in 13 | "Hlink H88K V3.1") 14 | ucidef_set_led_default "work" "WORK" "red:ai" "1" 15 | ucidef_set_led_netdev "wan" "WAN" "green:work" "eth0" 16 | ucidef_set_led_netdev "lan1" "LAN1" "blue:sata" "eth1" 17 | ucidef_set_led_netdev "lan2" "LAN2" "amber:net" "eth2" 18 | ;; 19 | "Hlink H88K-V3") 20 | ucidef_set_led_default "work" "WORK" "red:work" "1" 21 | ucidef_set_led_netdev "lan1" "LAN1" "green:user" "eth0" 22 | ucidef_set_led_netdev "lan2" "LAN2" "amber:sata" "eth1" 23 | ucidef_set_led_netdev "wan" "WAN" "blue:net" "eth2" 24 | ;; 25 | esac 26 | 27 | board_config_flush 28 | 29 | exit 0 30 | -------------------------------------------------------------------------------- /make-openwrt/scripts/ubuntu2404-make-openwrt-depends: -------------------------------------------------------------------------------- 1 | ack antlr3 aria2 asciidoc autoconf automake autopoint binutils bison btrfs-progs build-essential bzip2 ca-certificates ccache clang cmake coreutils cpio curl device-tree-compiler ecj fakeroot fastjar flex g++-multilib gawk gcc-multilib genisoimage gettext git gnutls-dev gperf gzip haveged help2man intltool irqbalance jq lib32gcc-s1 libc6-dev-i386 libelf-dev libfuse-dev libglib2.0-dev libgmp3-dev libltdl-dev libmpc-dev libmpfr-dev libncurses-dev libncurses5-dev libncursesw5-dev libnsl-dev libpython3-dev libreadline-dev libssl-dev libtool libyaml-dev libz-dev llvm lrzsz msmtp nano ninja-build ntpdate p7zip p7zip-full patch pigz pkgconf python3 python3-cryptography python3-docutils python3-pip python3-ply python3-pyelftools python3-requests python3-setuptools qemu-utils quilt re2c rsync scons sharutils squashfs-tools subversion swig tar texinfo uglifyjs unzip upx-ucl vim wget xmlto xsltproc xxd xz-utils yasm zip zlib1g-dev zstd -------------------------------------------------------------------------------- /make-openwrt/openwrt-files/different-files/wxy-oect/rootfs/etc/openwrt-board-release.conf: -------------------------------------------------------------------------------- 1 | #=========================================================================== 2 | # 3 | # This file is a part of the Remake OpenWrt 4 | # https://github.com/ophub/amlogic-s9xxx-openwrt 5 | # 6 | # WXY-OEC-turbo-4g(Original-Edition), 4GB-LPDDR4,8G-eMMC,1xSATA,1Gb-Nic 7 | # 8 | # Configuration: /etc/model_database.conf 9 | # MODEL_ID="r306" 10 | # MODEL_BOARD="wxy-oect" 11 | # 12 | #=========================================================================== 13 | 14 | # Set the partition value of a special board (fixed parameter) 15 | skip_mb="180" 16 | 17 | # Set the bootloader write command for a special board (fixed parameters) 18 | write_board_file="yes" 19 | write_board_bootloader() { 20 | dd if="${bootloader_path}/env.bin" of="${loop_new}" conv=fsync,notrunc bs=512 seek=294912 2>/dev/null 21 | # echo -e "${INFO} For [ ${board} ] write special bootloader: ${bootloader_path}/env.bin" 22 | } 23 | 24 | # Set the kernel file adjustment command for a special board (fixed parameters) 25 | adjust_kernel_files="yes" 26 | adjust_kernel_files_cmd() { 27 | (cd ${tag_bootfs} && ln -sf initrd.img-${kernel_name} uInitrd) 28 | } 29 | -------------------------------------------------------------------------------- /make-openwrt/README.cn.md: -------------------------------------------------------------------------------- 1 | # 目录说明 2 | 3 | 查看英文说明 | [View English description](README.md) 4 | 5 | 在相关目录中存储了一些编译 OpenWrt 所需的文件。 6 | 7 | ## openwrt-files 8 | 9 | 这里存放的文件是打包 OpenWrt 时需要使用的相关文件。其中 `common-files` 目录下的是通用文件,`platform-files` 目录下是各平台的文件,`different-files` 目录下是针对不同设备的差异化文件。 10 | 11 | - 需要系统文件将从 [ophub/amlogic-s9xxx-armbian](https://github.com/ophub/amlogic-s9xxx-armbian/tree/main/build-armbian/armbian-files) 仓库自动下载至 `platform-files` 和 `different-files` 目录。 12 | 13 | - 需要的固件将从 [ophub/firmware](https://github.com/ophub/firmware) 仓库自动下载至 `common-files/lib/firmware` 目录。 14 | 15 | - 需要的安装/更新等脚本将从 [ophub/luci-app-amlogic](https://github.com/ophub/luci-app-amlogic) 仓库自动下载至 `common-files/usr/sbin` 目录。 16 | 17 | ## kernel 18 | 19 | 在 `kernel` 目录下创建版本号对应的文件夹,如 `stable/5.10.125` 。多个内核依次创建目录并放入对应的内核文件。内核文件可以从 [kernel](https://github.com/ophub/kernel) 仓库下载,也可以[自定义编译](https://github.com/ophub/amlogic-s9xxx-armbian/tree/main/compile-kernel)。如果没有手动下载存放内核文件,在编译时脚本也会自动从 kernel 仓库下载。 20 | 21 | ## u-boot 22 | 23 | 系统启动引导文件,根据不同版本的内核,在需要使用时将由安装/更新等相关脚本自动化完成。需要的 u-boot 将从 [ophub/u-boot](https://github.com/ophub/u-boot) 仓库自动下载至 `u-boot` 目录。 24 | 25 | ## scripts 26 | 27 | 在执行 `remake` 时会自动安装当前服务器环境所需的依赖软件包。其他脚本文件用于辅助编译或制作 OpenWrt 系统。 28 | -------------------------------------------------------------------------------- /make-openwrt/openwrt-files/different-files/h88k/rootfs/etc/config/wireless: -------------------------------------------------------------------------------- 1 | 2 | config wifi-device 'radio0' 3 | option type 'mac80211' 4 | option path 'fe170000.pcie/pci0002:20/0002:20:00.0/0002:21:00.0' 5 | option country 'US' 6 | option legacy_rates '1' 7 | option mu_beamformer '0' 8 | option band '2g' 9 | option htmode 'HT40' 10 | option channel '11' 11 | option noscan '1' 12 | 13 | config wifi-iface 'default_radio0' 14 | option device 'radio0' 15 | option network 'lan' 16 | option mode 'ap' 17 | option ssid 'H88K_Wireless_2.4G' 18 | option encryption 'psk2' 19 | option key 'password' 20 | 21 | config wifi-device 'radio1' 22 | option type 'mac80211' 23 | option path 'fe170000.pcie/pci0002:20/0002:20:00.0/0002:21:00.0+1' 24 | option channel '36' 25 | option band '5g' 26 | option country 'US' 27 | option legacy_rates '1' 28 | option mu_beamformer '0' 29 | option htmode 'HE80' 30 | 31 | config wifi-iface 'default_radio1' 32 | option device 'radio1' 33 | option network 'lan' 34 | option mode 'ap' 35 | option key 'password' 36 | option ssid 'H88K_Wireless_5G' 37 | option encryption 'psk2' 38 | -------------------------------------------------------------------------------- /make-openwrt/openwrt-files/different-files/h88k-v3/rootfs/etc/config/wireless: -------------------------------------------------------------------------------- 1 | 2 | config wifi-device 'radio0' 3 | option type 'mac80211' 4 | option path 'fe170000.pcie/pci0002:20/0002:20:00.0/0002:21:00.0' 5 | option country 'US' 6 | option legacy_rates '1' 7 | option mu_beamformer '0' 8 | option band '2g' 9 | option htmode 'HT40' 10 | option channel '11' 11 | option noscan '1' 12 | 13 | config wifi-iface 'default_radio0' 14 | option device 'radio0' 15 | option network 'lan' 16 | option mode 'ap' 17 | option ssid 'H88K_Wireless_2.4G' 18 | option encryption 'psk2' 19 | option key 'password' 20 | 21 | config wifi-device 'radio1' 22 | option type 'mac80211' 23 | option path 'fe170000.pcie/pci0002:20/0002:20:00.0/0002:21:00.0+1' 24 | option channel '36' 25 | option band '5g' 26 | option country 'US' 27 | option legacy_rates '1' 28 | option mu_beamformer '0' 29 | option htmode 'HE80' 30 | 31 | config wifi-iface 'default_radio1' 32 | option device 'radio1' 33 | option network 'lan' 34 | option mode 'ap' 35 | option key 'password' 36 | option ssid 'H88K_Wireless_5G' 37 | option encryption 'psk2' 38 | -------------------------------------------------------------------------------- /make-openwrt/openwrt-files/different-files/r66s/rootfs/etc/board.d/99-default_network: -------------------------------------------------------------------------------- 1 | # The phy interfaces for r66s is 2 | # eth0(2.5G) for lan 3 | # eth1(2.5G) for wan 4 | 5 | . /lib/functions/uci-defaults.sh 6 | . /lib/functions/system.sh 7 | 8 | board_config_update 9 | 10 | generate_mac() 11 | { 12 | # https://gist.githubusercontent.com/aallan/b4bb86db86079509e6159810ae9bd3e4/raw/846ae1b646ab0f4d646af9115e47365f4118e5f6/mac-vendor.txt 13 | # The MAC address range registered by realtek manufacturers is as follows: 14 | local mac_grp_0="00:20:18:" 15 | local mac_grp_1="00:4f:49:" 16 | local mac_grp_2="00:60:52:" 17 | local mac_grp_3="00:e0:4c:" 18 | local mac_grp_4="52:54:00:" 19 | local mac_grp_5="52:54:ab:" 20 | local mac_grp_cnt=6 21 | 22 | # get the sd/emmc unique id 23 | local sd_hash=$(sha256sum /sys/class/block/mmcblk0/device/cid | cut -f1) 24 | 25 | # get mac address head 26 | local dice=${mac_grp_cnt}$(echo $sd_hash | tr -d '[a-f]' | cut -b 1-6) 27 | local idx=$((dice % mac_grp_cnt)) 28 | eval local mac_head="\$mac_grp_${idx}" 29 | 30 | # get mac address tail 31 | # sd_hash length: max 64 32 | local mac_tail=$(echo $sd_hash|cut -b 16-17)":"$(echo $sd_hash|cut -b 26-27)":"$(echo $sd_hash|cut -b 42-43) 33 | 34 | echo "${mac_head}${mac_tail}" 35 | } 36 | 37 | # Init LAN and WAN 38 | json_is_a network object && exit 0 39 | LAN_MAC=$(generate_mac) 40 | WAN_MAC=$(macaddr_add $LAN_MAC +1) 41 | ucidef_set_interfaces_lan_wan 'eth0' 'eth1' 42 | ucidef_set_interface_macaddr "lan" $LAN_MAC 43 | ucidef_set_interface_macaddr "wan" $WAN_MAC 44 | 45 | board_config_flush 46 | 47 | exit 0 48 | -------------------------------------------------------------------------------- /make-openwrt/openwrt-files/different-files/nanopc-t6/rootfs/etc/board.d/99-default_network: -------------------------------------------------------------------------------- 1 | # The phy interfaces for nanopc-t6 is 2 | # eth0(2.5G) for lan 3 | # eth1(2.5G) for wan 4 | 5 | . /lib/functions/uci-defaults.sh 6 | . /lib/functions/system.sh 7 | 8 | board_config_update 9 | 10 | generate_mac() 11 | { 12 | # https://gist.githubusercontent.com/aallan/b4bb86db86079509e6159810ae9bd3e4/raw/846ae1b646ab0f4d646af9115e47365f4118e5f6/mac-vendor.txt 13 | # The MAC address range registered by realtek manufacturers is as follows: 14 | local mac_grp_0="00:20:18:" 15 | local mac_grp_1="00:4f:49:" 16 | local mac_grp_2="00:60:52:" 17 | local mac_grp_3="00:e0:4c:" 18 | local mac_grp_4="52:54:00:" 19 | local mac_grp_5="52:54:ab:" 20 | local mac_grp_cnt=6 21 | 22 | # get the sd/emmc unique id 23 | local sd_hash=$(sha256sum /sys/class/block/mmcblk0/device/cid | cut -f1) 24 | 25 | # get mac address head 26 | local dice=${mac_grp_cnt}$(echo $sd_hash | tr -d '[a-f]' | cut -b 1-6) 27 | local idx=$((dice % mac_grp_cnt)) 28 | eval local mac_head="\$mac_grp_${idx}" 29 | 30 | # get mac address tail 31 | # sd_hash length: max 64 32 | local mac_tail=$(echo $sd_hash|cut -b 16-17)":"$(echo $sd_hash|cut -b 26-27)":"$(echo $sd_hash|cut -b 42-43) 33 | 34 | echo "${mac_head}${mac_tail}" 35 | } 36 | 37 | # Init LAN and WAN 38 | json_is_a network object && exit 0 39 | LAN_MAC=$(generate_mac) 40 | WAN_MAC=$(macaddr_add $LAN_MAC +1) 41 | ucidef_set_interfaces_lan_wan 'eth0' 'eth1' 42 | ucidef_set_interface_macaddr "lan" $LAN_MAC 43 | ucidef_set_interface_macaddr "wan" $WAN_MAC 44 | 45 | board_config_flush 46 | 47 | exit 0 48 | -------------------------------------------------------------------------------- /make-openwrt/openwrt-files/different-files/h68k/rootfs/etc/board.d/99-default_network: -------------------------------------------------------------------------------- 1 | # The default order of phy interfaces for r68s is 2 | # eth1(1G) eth0(1G) eth3(2.5G) eth2(2.5G) 3 | # Reset to 0 1 2 3 for intuitive 4 | 5 | . /lib/functions/uci-defaults.sh 6 | . /lib/functions/system.sh 7 | 8 | board_config_update 9 | 10 | generate_mac() 11 | { 12 | # https://gist.githubusercontent.com/aallan/b4bb86db86079509e6159810ae9bd3e4/raw/846ae1b646ab0f4d646af9115e47365f4118e5f6/mac-vendor.txt 13 | # The MAC address range registered by realtek manufacturers is as follows: 14 | local mac_grp_0="00:20:18:" 15 | local mac_grp_1="00:4f:49:" 16 | local mac_grp_2="00:60:52:" 17 | local mac_grp_3="00:e0:4c:" 18 | local mac_grp_4="52:54:00:" 19 | local mac_grp_5="52:54:ab:" 20 | local mac_grp_cnt=6 21 | 22 | # get the sd/emmc unique id 23 | local sd_hash 24 | if [ -f "/sys/class/block/mmcblk1/device/cid" ];then 25 | sd_hash=$(sha256sum /sys/class/block/mmcblk1/device/cid | cut -f1) 26 | elif [ -f "/sys/class/block/mmcblk0/device/cid" ];then 27 | sd_hash=$(sha256sum /sys/class/block/mmcblk0/device/cid | cut -f1) 28 | else 29 | sd_hash=$(dd if=/dev/zero bs=1 count=68 | sha256sum | cut -f1) 30 | fi 31 | 32 | # get mac address head 33 | local dice=${mac_grp_cnt}$(echo $sd_hash | tr -d '[a-f]' | cut -b 1-6) 34 | local idx=$((dice % mac_grp_cnt)) 35 | eval local mac_head="\$mac_grp_${idx}" 36 | 37 | # get mac address tail 38 | # sd_hash length: max 64 39 | local mac_tail=$(echo $sd_hash|cut -b 16-17)":"$(echo $sd_hash|cut -b 26-27)":"$(echo $sd_hash|cut -b 42-43) 40 | 41 | echo "${mac_head}${mac_tail}" 42 | } 43 | 44 | # Init LAN and WAN 45 | json_is_a network object && exit 0 46 | 47 | LAN_MAC=$(generate_mac) 48 | WAN_MAC=$(macaddr_add $LAN_MAC +1) 49 | 50 | ucidef_set_interfaces_lan_wan 'eth0 eth1 eth2' 'eth3' 51 | ucidef_set_interface_macaddr "lan" $LAN_MAC 52 | ucidef_set_interface_macaddr "wan" $WAN_MAC 53 | 54 | board_config_flush 55 | 56 | exit 0 57 | -------------------------------------------------------------------------------- /make-openwrt/openwrt-files/different-files/jp-tvbox/rootfs/etc/board.d/99-default_network: -------------------------------------------------------------------------------- 1 | # The phy interfaces for Radxa CM3 RPI CM4 IO: 2 | # eth0(1gb) rockchip gmac for wan 3 | # eth1(1gb) pcie realtek rtl81111h for lan 4 | 5 | . /lib/functions/uci-defaults.sh 6 | . /lib/functions/system.sh 7 | 8 | board_config_update 9 | 10 | generate_mac() 11 | { 12 | # https://gist.githubusercontent.com/aallan/b4bb86db86079509e6159810ae9bd3e4/raw/846ae1b646ab0f4d646af9115e47365f4118e5f6/mac-vendor.txt 13 | # The MAC address range registered by realtek manufacturers is as follows: 14 | local mac_grp_0="00:20:18:" 15 | local mac_grp_1="00:4f:49:" 16 | local mac_grp_2="00:60:52:" 17 | local mac_grp_3="00:e0:4c:" 18 | local mac_grp_4="52:54:00:" 19 | local mac_grp_5="52:54:ab:" 20 | local mac_grp_cnt=6 21 | 22 | # get the sd/emmc unique id 23 | local sd_hash 24 | if [ -f "/sys/class/block/mmcblk1/device/cid" ];then 25 | sd_hash=$(sha256sum /sys/class/block/mmcblk1/device/cid | cut -f1) 26 | elif [ -f "/sys/class/block/mmcblk0/device/cid" ];then 27 | sd_hash=$(sha256sum /sys/class/block/mmcblk0/device/cid | cut -f1) 28 | else 29 | sd_hash=$(dd if=/dev/zero bs=1 count=68 | sha256sum | cut -f1) 30 | fi 31 | 32 | # get mac address head 33 | local dice=${mac_grp_cnt}$(echo $sd_hash | tr -d '[a-f]' | cut -b 1-6) 34 | local idx=$((dice % mac_grp_cnt)) 35 | eval local mac_head="\$mac_grp_${idx}" 36 | 37 | # get mac address tail 38 | # sd_hash length: max 64 39 | local mac_tail=$(echo $sd_hash|cut -b 16-17)":"$(echo $sd_hash|cut -b 26-27)":"$(echo $sd_hash|cut -b 42-43) 40 | 41 | echo "${mac_head}${mac_tail}" 42 | } 43 | 44 | # Init LAN and WAN 45 | json_is_a network object && exit 0 46 | 47 | LAN_MAC=$(generate_mac) 48 | ucidef_set_interface_lan 'eth0' 49 | ucidef_set_interface_macaddr "lan" $LAN_MAC 50 | if [ -d "/sys/class/net/eth1" ];then 51 | ucidef_set_interface_wan 'eth1' 52 | ucidef_set_interface_macaddr "wan" $WAN_MAC 53 | fi 54 | 55 | board_config_flush 56 | 57 | exit 0 58 | -------------------------------------------------------------------------------- /make-openwrt/openwrt-files/common-files/sbin/firstboot: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #======================================================================== 3 | # 4 | # This file is licensed under the terms of the GNU General Public 5 | # License version 2. This program is licensed "as is" without any 6 | # warranty of any kind, whether express or implied. 7 | # 8 | # This file is a part of the make OpenWrt for Amlogic s9xxx tv box 9 | # https://github.com/ophub/amlogic-s9xxx-openwrt 10 | # 11 | # Description: Restoring the system initialization state 12 | # Copyright (C) 2021- https://github.com/ophub/amlogic-s9xxx-openwrt 13 | # 14 | # Command: firstboot 15 | # 16 | #======================================================================= 17 | # 18 | STEPS="[\033[95m STEPS \033[0m]" 19 | INFO="[\033[94m INFO \033[0m]" 20 | SUCCESS="[\033[92m SUCCESS \033[0m]" 21 | OPTIONS="[\033[93m OPTIONS \033[0m]" 22 | ERROR="[\033[91m ERROR \033[0m]" 23 | 24 | # Encountered a serious error, abort the script execution 25 | error_msg() { 26 | echo -e "${ERROR} ${1}" 27 | exit 1 28 | } 29 | 30 | # Perform recovery 31 | do_recovery() { 32 | snap_name=".snapshots/etc-000" 33 | if btrfs subvolume list -rt / | grep "${snap_name}" >/dev/null; then 34 | cd / 35 | rm -rf etc.backup && mv etc etc.backup 36 | if [[ "${?}" -eq "0" ]]; then 37 | echo -e "${INFO} Start restoring initialization..." 38 | btrfs subvolume snapshot "${snap_name}" etc 39 | [[ "${?}" -eq "0" ]] && rm -rf etc.backup 40 | 41 | sync && sleep 3 42 | echo -e "${SUCCESS} Recovery successful, restarting..." && reboot 43 | else 44 | rm -rf etc && mv etc.backup etc && sync 45 | error_msg "Failed to move /etc directory, give up initialization!" 46 | fi 47 | else 48 | error_msg "Missing initialization snapshot: [ /${snap_name} ], cannot restore!" 49 | fi 50 | } 51 | 52 | echo -e "${STEPS} Welcome to the Recovery Initialization Tool." 53 | [[ -x "/sbin/firstboot" ]] || error_msg "Please grant execution permission: [ chmod +x /sbin/firstboot ]" 54 | 55 | # Perform recovery 56 | do_recovery 57 | -------------------------------------------------------------------------------- /make-openwrt/README.md: -------------------------------------------------------------------------------- 1 | # Directory Description 2 | 3 | View Chinese description | [查看中文说明](README.cn.md) 4 | 5 | In the related directories, some files needed for compiling OpenWrt are stored. 6 | 7 | ## openwrt-files 8 | 9 | The files stored here are related files needed when packaging OpenWrt. Among them, the files under the `common-files` directory are general files, the files under the `platform-files` directory are files for each platform, and the files under the `different-files` directory are differential files for different devices. 10 | 11 | - System files needed will be automatically downloaded from the [ophub/amlogic-s9xxx-armbian](https://github.com/ophub/amlogic-s9xxx-armbian/tree/main/build-armbian/armbian-files) repository to the `platform-files` and `different-files` directories. 12 | 13 | - The firmware needed will be automatically downloaded from the [ophub/firmware](https://github.com/ophub/firmware) repository to the `common-files/lib/firmware` directory. 14 | 15 | - The necessary installation/update scripts will be automatically downloaded from the [ophub/luci-app-amlogic](https://github.com/ophub/luci-app-amlogic) repository to the `common-files/usr/sbin` directory. 16 | 17 | ## kernel 18 | 19 | Create a folder corresponding to the version number under the `kernel` directory, such as `stable/5.10.125`. Multiple kernels create directories in sequence and put the corresponding kernel files into them. Kernel files can be downloaded from the [kernel](https://github.com/ophub/kernel) repository, or you can [customize the compilation](https://github.com/ophub/amlogic-s9xxx-armbian/tree/main/compile-kernel). If the kernel files are not manually downloaded and stored, the script will automatically download from the kernel repository during compilation. 20 | 21 | ## u-boot 22 | 23 | System boot files, according to different versions of the kernel, will be automated by installation/update and other related scripts when needed. The necessary u-boot will be automatically downloaded from the [ophub/u-boot](https://github.com/ophub/u-boot) repository to the `u-boot` directory. 24 | 25 | ## scripts 26 | 27 | When executing `remake`, the required dependency packages for the current server environment will be installed automatically. Other script files are used to assist with compiling or building the OpenWrt system. 28 | -------------------------------------------------------------------------------- /make-openwrt/openwrt-files/different-files/zcube1-max/rootfs/etc/board.d/99-default_network: -------------------------------------------------------------------------------- 1 | # The default order of phy interfaces for watermelon-pi-v3 is 2 | # eth0 1gb (lan) 3 | # eth1 1gb (wan) 4 | 5 | . /lib/functions/uci-defaults.sh 6 | . /lib/functions/system.sh 7 | 8 | board_config_update 9 | 10 | generate_mac() 11 | { 12 | # https://gist.githubusercontent.com/aallan/b4bb86db86079509e6159810ae9bd3e4/raw/846ae1b646ab0f4d646af9115e47365f4118e5f6/mac-vendor.txt 13 | # The MAC address range registered by realtek manufacturers is as follows: 14 | local mac_grp_0="00:20:18:" 15 | local mac_grp_1="00:4f:49:" 16 | local mac_grp_2="00:60:52:" 17 | local mac_grp_3="00:e0:4c:" 18 | local mac_grp_4="52:54:00:" 19 | local mac_grp_5="52:54:ab:" 20 | local mac_grp_cnt=6 21 | 22 | # get the sd/emmc unique id 23 | local sd_hash 24 | if [ -f "/sys/class/block/mmcblk1/device/cid" ];then 25 | sd_hash=$(sha256sum /sys/class/block/mmcblk1/device/cid | cut -f1) 26 | elif [ -f "/sys/class/block/mmcblk0/device/cid" ];then 27 | sd_hash=$(sha256sum /sys/class/block/mmcblk0/device/cid | cut -f1) 28 | else 29 | sd_hash=$(dd if=/dev/zero bs=1 count=68 | sha256sum | cut -f1) 30 | fi 31 | 32 | # get mac address head 33 | local dice=${mac_grp_cnt}$(echo $sd_hash | tr -d '[a-f]' | cut -b 1-6) 34 | local idx=$((dice % mac_grp_cnt)) 35 | eval local mac_head="\$mac_grp_${idx}" 36 | 37 | # get mac address tail 38 | # sd_hash length: max 64 39 | local mac_tail=$(echo $sd_hash|cut -b 16-17)":"$(echo $sd_hash|cut -b 26-27)":"$(echo $sd_hash|cut -b 42-43) 40 | 41 | echo "${mac_head}${mac_tail}" 42 | } 43 | 44 | swap_interface() 45 | { 46 | local eth_a=$1 47 | local eth_b=$2 48 | ip link set dev $eth_a down 49 | ip link set dev $eth_b down 50 | ip link set $eth_a name eth-rename-tmp 51 | ip link set $eth_b name $eth_a 52 | ip link set eth-rename-tmp name $eth_b 53 | ip link set dev $eth_a up 54 | ip link set dev $eth_b up 55 | } 56 | 57 | # Init LAN and WAN 58 | json_is_a network object && exit 0 59 | LAN_MAC=$(generate_mac) 60 | ucidef_set_interfaces_lan_wan 'eth0' 61 | ucidef_set_interface_macaddr "lan" $LAN_MAC 62 | 63 | board_config_flush 64 | 65 | exit 0 66 | -------------------------------------------------------------------------------- /make-openwrt/openwrt-files/different-files/ipc-r/rootfs/etc/board.d/99-default_network: -------------------------------------------------------------------------------- 1 | # The default order of phy interfaces for ipc is 2 | # eth1(1G) eth0(2.5G) eth3(1G) eth2(2.5G)eth4(1G)eth5(1G) 3 | # Reset to 0 1 2 3 for intuitive 4 | 5 | . /lib/functions/uci-defaults.sh 6 | . /lib/functions/system.sh 7 | 8 | board_config_update 9 | 10 | generate_mac() 11 | { 12 | # https://gist.githubusercontent.com/aallan/b4bb86db86079509e6159810ae9bd3e4/raw/846ae1b646ab0f4d646af9115e47365f4118e5f6/mac-vendor.txt 13 | # The MAC address range registered by realtek manufacturers is as follows: 14 | local mac_grp_0="00:20:18:" 15 | local mac_grp_1="00:4f:49:" 16 | local mac_grp_2="00:60:52:" 17 | local mac_grp_3="00:e0:4c:" 18 | local mac_grp_4="52:54:00:" 19 | local mac_grp_5="52:54:ab:" 20 | local mac_grp_cnt=6 21 | 22 | # get the sd/emmc unique id 23 | local sd_hash=$(sha256sum /sys/class/block/mmcblk1/device/cid | cut -f1) 24 | 25 | # get mac address head 26 | local dice=${mac_grp_cnt}$(echo $sd_hash | tr -d '[a-f]' | cut -b 1-6) 27 | local idx=$((dice % mac_grp_cnt)) 28 | eval local mac_head="\$mac_grp_${idx}" 29 | 30 | # get mac address tail 31 | # sd_hash length: max 64 32 | local mac_tail=$(echo $sd_hash|cut -b 16-17)":"$(echo $sd_hash|cut -b 26-27)":"$(echo $sd_hash|cut -b 42-43) 33 | 34 | echo "${mac_head}${mac_tail}" 35 | } 36 | 37 | swap_interface() 38 | { 39 | local eth_a=$1 40 | local eth_b=$2 41 | ip link set dev $eth_a down 42 | ip link set dev $eth_b down 43 | ip link set $eth_a name eth-rename-tmp 44 | ip link set $eth_b name $eth_a 45 | ip link set eth-rename-tmp name $eth_b 46 | ip link set dev $eth_a up 47 | ip link set dev $eth_b up 48 | } 49 | 50 | # Swap eth0 & eth1, eth2 & eth3 51 | [ -d /sys/devices/platform/fe160000.pcie/pci0001:10/0001:10:00.0/0001:11:00.0/0001:12:01.0/0001:13:00.0/net/eth0 ] && swap_interface "eth0" "eth1" 52 | 53 | # Init LAN and WAN 54 | json_is_a network object && exit 0 55 | LAN_MAC=$(generate_mac) 56 | WAN_MAC=$(macaddr_add $LAN_MAC +1) 57 | ucidef_set_interfaces_lan_wan 'eth3 eth1 eth2 eth4 eth5' 'eth0' 58 | ucidef_set_interface_macaddr "lan" $LAN_MAC 59 | ucidef_set_interface_macaddr "wan" $WAN_MAC 60 | 61 | board_config_flush 62 | 63 | exit 0 64 | -------------------------------------------------------------------------------- /make-openwrt/openwrt-files/different-files/photonicat/rootfs/etc/board.d/99-default_network: -------------------------------------------------------------------------------- 1 | . /lib/functions/uci-defaults.sh 2 | . /lib/functions/system.sh 3 | 4 | board_config_update 5 | 6 | generate_mac() { 7 | # https://gist.githubusercontent.com/aallan/b4bb86db86079509e6159810ae9bd3e4/raw/846ae1b646ab0f4d646af9115e47365f4118e5f6/mac-vendor.txt 8 | # The MAC address range registered by realtek manufacturers is as follows: 9 | local mac_grp_0="00:20:18:" 10 | local mac_grp_1="00:4f:49:" 11 | local mac_grp_2="00:60:52:" 12 | local mac_grp_3="00:e0:4c:" 13 | local mac_grp_4="52:54:00:" 14 | local mac_grp_5="52:54:ab:" 15 | local mac_grp_cnt=6 16 | 17 | # get the cpu/emmc/sd unique id 18 | local sd_hash 19 | if [ -f "/sys/class/block/mmcblk1/device/cid" ]; then 20 | sd_hash=$(sha256sum /sys/class/block/mmcblk1/device/cid | cut -f1) 21 | elif [ -f "/sys/class/block/mmcblk0/device/cid" ]; then 22 | sd_hash=$(sha256sum /sys/class/block/mmcblk0/device/cid | cut -f1) 23 | else 24 | sd_hash=$(dd if=/dev/zero bs=1 count=68 | sha256sum | cut -f1) 25 | fi 26 | 27 | # get mac address head 28 | local dice=${mac_grp_cnt}$(echo $sd_hash | tr -d '[a-f]' | cut -b 1-6) 29 | local idx=$((dice % mac_grp_cnt)) 30 | eval local mac_head="\$mac_grp_${idx}" 31 | 32 | # get mac address tail 33 | # sd_hash length: max 64 34 | local mac_tail=$(echo $sd_hash | cut -b 16-17)":"$(echo $sd_hash | cut -b 26-27)":"$(echo $sd_hash | cut -b 42-43) 35 | 36 | echo "${mac_head}${mac_tail}" 37 | } 38 | 39 | swap_interface() { 40 | local eth_a=$1 41 | local eth_b=$2 42 | ip link set dev $eth_a down 43 | ip link set dev $eth_b down 44 | ip link set $eth_a name eth-rename-tmp 45 | ip link set $eth_b name $eth_a 46 | ip link set eth-rename-tmp name $eth_b 47 | ip link set dev $eth_a up 48 | ip link set dev $eth_b up 49 | } 50 | 51 | json_is_a network object && exit 0 52 | 53 | # Init LAN and WAN 54 | LAN_MAC=$(generate_mac) 55 | WAN_MAC=$(macaddr_add $LAN_MAC +1) 56 | ucidef_set_interface_lan 'eth0' 57 | ucidef_set_interface_macaddr "lan" $LAN_MAC 58 | if [ -d "/sys/class/net/eth1" ]; then 59 | ucidef_set_interface_wan 'eth1' 60 | ucidef_set_interface_macaddr "wan" $WAN_MAC 61 | fi 62 | 63 | board_config_flush 64 | 65 | exit 0 66 | -------------------------------------------------------------------------------- /make-openwrt/openwrt-files/different-files/r68s/rootfs/etc/board.d/99-default_network: -------------------------------------------------------------------------------- 1 | # The default order of phy interfaces for r68s is 2 | # eth1(1G) eth0(1G) eth3(2.5G) eth2(2.5G) 3 | # Reset to 0 1 2 3 for intuitive 4 | 5 | . /lib/functions/uci-defaults.sh 6 | . /lib/functions/system.sh 7 | 8 | board_config_update 9 | 10 | generate_mac() 11 | { 12 | # https://gist.githubusercontent.com/aallan/b4bb86db86079509e6159810ae9bd3e4/raw/846ae1b646ab0f4d646af9115e47365f4118e5f6/mac-vendor.txt 13 | # The MAC address range registered by realtek manufacturers is as follows: 14 | local mac_grp_0="00:20:18:" 15 | local mac_grp_1="00:4f:49:" 16 | local mac_grp_2="00:60:52:" 17 | local mac_grp_3="00:e0:4c:" 18 | local mac_grp_4="52:54:00:" 19 | local mac_grp_5="52:54:ab:" 20 | local mac_grp_cnt=6 21 | 22 | # get the sd/emmc unique id 23 | local sd_hash=$(sha256sum /sys/class/block/mmcblk0/device/cid | cut -f1) 24 | 25 | # get mac address head 26 | local dice=${mac_grp_cnt}$(echo $sd_hash | tr -d '[a-f]' | cut -b 1-6) 27 | local idx=$((dice % mac_grp_cnt)) 28 | eval local mac_head="\$mac_grp_${idx}" 29 | 30 | # get mac address tail 31 | # sd_hash length: max 64 32 | local mac_tail=$(echo $sd_hash|cut -b 16-17)":"$(echo $sd_hash|cut -b 26-27)":"$(echo $sd_hash|cut -b 42-43) 33 | 34 | echo "${mac_head}${mac_tail}" 35 | } 36 | 37 | swap_interface() 38 | { 39 | local eth_a=$1 40 | local eth_b=$2 41 | ip link set dev $eth_a down 42 | ip link set dev $eth_b down 43 | ip link set $eth_a name eth-rename-tmp 44 | ip link set $eth_b name $eth_a 45 | ip link set eth-rename-tmp name $eth_b 46 | ip link set dev $eth_a up 47 | ip link set dev $eth_b up 48 | } 49 | 50 | # Swap eth0 & eth1, eth2 & eth3 51 | [ -d /sys/devices/platform/fe010000.ethernet/net/eth0 ] && swap_interface "eth2" "eth3" 52 | [ -d /sys/devices/platform/fe010000.ethernet/net/eth0 ] && swap_interface "eth0" "eth1" 53 | 54 | # Init LAN and WAN 55 | json_is_a network object && exit 0 56 | LAN_MAC=$(generate_mac) 57 | WAN_MAC=$(macaddr_add $LAN_MAC +1) 58 | ucidef_set_interfaces_lan_wan 'eth0 eth1 eth2' 'eth3' 59 | ucidef_set_interface_macaddr "lan" $LAN_MAC 60 | ucidef_set_interface_macaddr "wan" $WAN_MAC 61 | 62 | board_config_flush 63 | 64 | exit 0 65 | -------------------------------------------------------------------------------- /make-openwrt/openwrt-files/different-files/nsy-g16-plus/rootfs/etc/board.d/02_network: -------------------------------------------------------------------------------- 1 | . /lib/functions/uci-defaults.sh 2 | . /lib/functions/system.sh 3 | 4 | # Function to check MAC address format 5 | check_mac_format() { 6 | local mac="$1" 7 | echo "${mac}" | grep -E -q "^([0-9a-fA-F]{2}:){5}[0-9a-fA-F]{2}$" 8 | return $? 9 | } 10 | 11 | # Set up network interfaces for Rockchip-based boards 12 | rockchip_setup_interfaces() { 13 | local board="$1" 14 | ucidef_set_interfaces_lan_wan "lan1 lan2 lan3" "wan" 15 | } 16 | 17 | # Set up MAC addresses for Rockchip-based boards 18 | rockchip_setup_macs() { 19 | local board="$1" 20 | local base_mac="" 21 | local lan_mac="" 22 | local wan_mac="" 23 | local tmp_mac="" 24 | 25 | # Try to get MAC from mmcblk0 CID 26 | if [ -b "/dev/mmcblk0" ] || [ -e "/sys/block/mmcblk0" ]; then 27 | tmp_mac="$(macaddr_generate_from_mmc_cid mmcblk0 2>/dev/null)" 28 | if check_mac_format "${tmp_mac}"; then 29 | base_mac="${tmp_mac}" 30 | echo "Used mmcblk0 MAC: ${base_mac}" >/dev/console 31 | fi 32 | fi 33 | 34 | # Fallback to eth0 MAC 35 | if [ -z "${base_mac}" ] && [ -f /sys/class/net/eth0/address ]; then 36 | tmp_mac="$(cat /sys/class/net/eth0/address)" 37 | if check_mac_format "${tmp_mac}"; then 38 | base_mac="${tmp_mac}" 39 | echo "Used eth0 MAC: ${base_mac}" >/dev/console 40 | fi 41 | fi 42 | 43 | # Final fallback to random MAC 44 | if [ -z "${base_mac}" ]; then 45 | echo "WARNING: Failed to get valid MAC, generating random one" >/dev/console 46 | base_mac="$(macaddr_random)" 47 | fi 48 | 49 | # Ensure MAC is uppercase 50 | base_mac="$(echo "${base_mac}" | tr 'a-z' 'A-Z')" 51 | 52 | # Derive LAN and WAN MACs 53 | lan_mac="${base_mac}" 54 | wan_mac="$(macaddr_add "${base_mac}" 1)" 55 | 56 | # Write MAC addresses to configuration 57 | [ -n "${lan_mac}" ] && ucidef_set_interface_macaddr "lan" "${lan_mac}" 58 | [ -n "${wan_mac}" ] && ucidef_set_interface_macaddr "wan" "${wan_mac}" 59 | [ -n "${lan_mac}" ] && ucidef_set_label_macaddr "${lan_mac}" 60 | } 61 | 62 | board_config_update 63 | # Set board name 64 | board="nsy,g16-plus" 65 | 66 | rockchip_setup_interfaces ${board} 67 | rockchip_setup_macs ${board} 68 | 69 | board_config_flush 70 | 71 | exit 0 72 | -------------------------------------------------------------------------------- /make-openwrt/openwrt-files/different-files/bdy-g18-pro/rootfs/etc/board.d/02_network: -------------------------------------------------------------------------------- 1 | . /lib/functions/uci-defaults.sh 2 | . /lib/functions/system.sh 3 | 4 | # Function to check MAC address format 5 | check_mac_format() { 6 | local mac="$1" 7 | echo "${mac}" | grep -E -q "^([0-9a-fA-F]{2}:){5}[0-9a-fA-F]{2}$" 8 | return $? 9 | } 10 | 11 | # Set up network interfaces for Rockchip-based boards 12 | rockchip_setup_interfaces() { 13 | local board="$1" 14 | ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 lan4" "wan" 15 | } 16 | 17 | # Set up MAC addresses for Rockchip-based boards 18 | rockchip_setup_macs() { 19 | local board="$1" 20 | local base_mac="" 21 | local lan_mac="" 22 | local wan_mac="" 23 | local tmp_mac="" 24 | 25 | # Try to get MAC from mmcblk0 CID 26 | if [ -b "/dev/mmcblk0" ] || [ -e "/sys/block/mmcblk0" ]; then 27 | tmp_mac="$(macaddr_generate_from_mmc_cid mmcblk0 2>/dev/null)" 28 | if check_mac_format "${tmp_mac}"; then 29 | base_mac="${tmp_mac}" 30 | echo "Used mmcblk0 MAC: ${base_mac}" >/dev/console 31 | fi 32 | fi 33 | 34 | # Fallback to eth0 MAC 35 | if [ -z "${base_mac}" ] && [ -f /sys/class/net/eth0/address ]; then 36 | tmp_mac="$(cat /sys/class/net/eth0/address)" 37 | if check_mac_format "${tmp_mac}"; then 38 | base_mac="${tmp_mac}" 39 | echo "Used eth0 MAC: ${base_mac}" >/dev/console 40 | fi 41 | fi 42 | 43 | # Final fallback to random MAC 44 | if [ -z "${base_mac}" ]; then 45 | echo "WARNING: Failed to get valid MAC, generating random one" >/dev/console 46 | base_mac="$(macaddr_random)" 47 | fi 48 | 49 | # Ensure MAC is uppercase 50 | base_mac="$(echo "${base_mac}" | tr 'a-z' 'A-Z')" 51 | 52 | # Derive LAN and WAN MACs 53 | lan_mac="${base_mac}" 54 | wan_mac="$(macaddr_add "${base_mac}" 1)" 55 | 56 | # Write MAC addresses to configuration 57 | [ -n "${lan_mac}" ] && ucidef_set_interface_macaddr "lan" "${lan_mac}" 58 | [ -n "${wan_mac}" ] && ucidef_set_interface_macaddr "wan" "${wan_mac}" 59 | [ -n "${lan_mac}" ] && ucidef_set_label_macaddr "${lan_mac}" 60 | } 61 | 62 | board_config_update 63 | # Set board name 64 | board="bdy,g18-pro" 65 | 66 | rockchip_setup_interfaces ${board} 67 | rockchip_setup_macs ${board} 68 | 69 | board_config_flush 70 | 71 | exit 0 72 | -------------------------------------------------------------------------------- /make-openwrt/openwrt-files/different-files/e20c/rootfs/etc/board.d/99-default_network: -------------------------------------------------------------------------------- 1 | # The default order of phy interfaces for h66k is 2 | # eth0(2.5G) eth1(2.5G) 3 | 4 | . /lib/functions/uci-defaults.sh 5 | . /lib/functions/system.sh 6 | 7 | board_config_update 8 | 9 | generate_mac() 10 | { 11 | # https://gist.githubusercontent.com/aallan/b4bb86db86079509e6159810ae9bd3e4/raw/846ae1b646ab0f4d646af9115e47365f4118e5f6/mac-vendor.txt 12 | # The MAC address range registered by realtek manufacturers is as follows: 13 | local mac_grp_0="00:20:18:" 14 | local mac_grp_1="00:4f:49:" 15 | local mac_grp_2="00:60:52:" 16 | local mac_grp_3="00:e0:4c:" 17 | local mac_grp_4="52:54:00:" 18 | local mac_grp_5="52:54:ab:" 19 | local mac_grp_cnt=6 20 | 21 | # get the sd/emmc unique id 22 | local sd_hash 23 | if [ -f "/sys/class/block/mmcblk1/device/cid" ];then 24 | sd_hash=$(sha256sum /sys/class/block/mmcblk1/device/cid | cut -f1) 25 | elif [ -f "/sys/class/block/mmcblk0/device/cid" ];then 26 | sd_hash=$(sha256sum /sys/class/block/mmcblk0/device/cid | cut -f1) 27 | else 28 | sd_hash=$(dd if=/dev/zero bs=1 count=68 | sha256sum | cut -f1) 29 | fi 30 | 31 | # get mac address head 32 | local dice=${mac_grp_cnt}$(echo $sd_hash | tr -d '[a-f]' | cut -b 1-6) 33 | local idx=$((dice % mac_grp_cnt)) 34 | eval local mac_head="\$mac_grp_${idx}" 35 | 36 | # get mac address tail 37 | # sd_hash length: max 64 38 | local mac_tail=$(echo $sd_hash|cut -b 16-17)":"$(echo $sd_hash|cut -b 26-27)":"$(echo $sd_hash|cut -b 42-43) 39 | 40 | echo "${mac_head}${mac_tail}" 41 | } 42 | 43 | swap_interface() 44 | { 45 | local eth_a=$1 46 | local eth_b=$2 47 | ip link set dev $eth_a down 48 | ip link set dev $eth_b down 49 | ip link set $eth_a name eth-rename-tmp 50 | ip link set $eth_b name $eth_a 51 | ip link set eth-rename-tmp name $eth_b 52 | ip link set dev $eth_a up 53 | ip link set dev $eth_b up 54 | } 55 | 56 | # Init LAN and WAN 57 | json_is_a network object && exit 0 58 | 59 | LAN_MAC=$(generate_mac) 60 | WAN_MAC=$(macaddr_add $LAN_MAC +1) 61 | ucidef_set_interfaces_lan_wan 'eth0' 'eth1' 62 | ucidef_set_interface_macaddr "lan" $LAN_MAC 63 | ucidef_set_interface_macaddr "wan" $WAN_MAC 64 | 65 | board_config_flush 66 | 67 | exit 0 68 | -------------------------------------------------------------------------------- /make-openwrt/openwrt-files/different-files/h28k/rootfs/etc/board.d/99-default_network: -------------------------------------------------------------------------------- 1 | # The default order of phy interfaces for h66k is 2 | # eth0(2.5G) eth1(2.5G) 3 | 4 | . /lib/functions/uci-defaults.sh 5 | . /lib/functions/system.sh 6 | 7 | board_config_update 8 | 9 | generate_mac() 10 | { 11 | # https://gist.githubusercontent.com/aallan/b4bb86db86079509e6159810ae9bd3e4/raw/846ae1b646ab0f4d646af9115e47365f4118e5f6/mac-vendor.txt 12 | # The MAC address range registered by realtek manufacturers is as follows: 13 | local mac_grp_0="00:20:18:" 14 | local mac_grp_1="00:4f:49:" 15 | local mac_grp_2="00:60:52:" 16 | local mac_grp_3="00:e0:4c:" 17 | local mac_grp_4="52:54:00:" 18 | local mac_grp_5="52:54:ab:" 19 | local mac_grp_cnt=6 20 | 21 | # get the sd/emmc unique id 22 | local sd_hash 23 | if [ -f "/sys/class/block/mmcblk1/device/cid" ];then 24 | sd_hash=$(sha256sum /sys/class/block/mmcblk1/device/cid | cut -f1) 25 | elif [ -f "/sys/class/block/mmcblk0/device/cid" ];then 26 | sd_hash=$(sha256sum /sys/class/block/mmcblk0/device/cid | cut -f1) 27 | else 28 | sd_hash=$(dd if=/dev/zero bs=1 count=68 | sha256sum | cut -f1) 29 | fi 30 | 31 | # get mac address head 32 | local dice=${mac_grp_cnt}$(echo $sd_hash | tr -d '[a-f]' | cut -b 1-6) 33 | local idx=$((dice % mac_grp_cnt)) 34 | eval local mac_head="\$mac_grp_${idx}" 35 | 36 | # get mac address tail 37 | # sd_hash length: max 64 38 | local mac_tail=$(echo $sd_hash|cut -b 16-17)":"$(echo $sd_hash|cut -b 26-27)":"$(echo $sd_hash|cut -b 42-43) 39 | 40 | echo "${mac_head}${mac_tail}" 41 | } 42 | 43 | swap_interface() 44 | { 45 | local eth_a=$1 46 | local eth_b=$2 47 | ip link set dev $eth_a down 48 | ip link set dev $eth_b down 49 | ip link set $eth_a name eth-rename-tmp 50 | ip link set $eth_b name $eth_a 51 | ip link set eth-rename-tmp name $eth_b 52 | ip link set dev $eth_a up 53 | ip link set dev $eth_b up 54 | } 55 | 56 | # Init LAN and WAN 57 | json_is_a network object && exit 0 58 | 59 | LAN_MAC=$(generate_mac) 60 | WAN_MAC=$(macaddr_add $LAN_MAC +1) 61 | ucidef_set_interfaces_lan_wan 'eth0' 'eth1' 62 | ucidef_set_interface_macaddr "lan" $LAN_MAC 63 | ucidef_set_interface_macaddr "wan" $WAN_MAC 64 | 65 | board_config_flush 66 | 67 | exit 0 68 | -------------------------------------------------------------------------------- /make-openwrt/openwrt-files/different-files/nsy-g68-plus/rootfs/etc/board.d/02_network: -------------------------------------------------------------------------------- 1 | . /lib/functions/uci-defaults.sh 2 | . /lib/functions/system.sh 3 | 4 | # Function to check MAC address format 5 | check_mac_format() { 6 | local mac="$1" 7 | echo "${mac}" | grep -E -q "^([0-9a-fA-F]{2}:){5}[0-9a-fA-F]{2}$" 8 | return $? 9 | } 10 | 11 | # Set up network interfaces for Rockchip-based boards 12 | rockchip_setup_interfaces() { 13 | local board="$1" 14 | ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 lan4" "wan" 15 | } 16 | 17 | # Set up MAC addresses for Rockchip-based boards 18 | rockchip_setup_macs() { 19 | local board="$1" 20 | local base_mac="" 21 | local lan_mac="" 22 | local wan_mac="" 23 | local tmp_mac="" 24 | 25 | # Try to get MAC from mmcblk0 CID 26 | if [ -b "/dev/mmcblk0" ] || [ -e "/sys/block/mmcblk0" ]; then 27 | tmp_mac="$(macaddr_generate_from_mmc_cid mmcblk0 2>/dev/null)" 28 | if check_mac_format "${tmp_mac}"; then 29 | base_mac="${tmp_mac}" 30 | echo "Used mmcblk0 MAC: ${base_mac}" >/dev/console 31 | fi 32 | fi 33 | 34 | # Fallback to eth0 MAC 35 | if [ -z "${base_mac}" ] && [ -f /sys/class/net/eth0/address ]; then 36 | tmp_mac="$(cat /sys/class/net/eth0/address)" 37 | if check_mac_format "${tmp_mac}"; then 38 | base_mac="${tmp_mac}" 39 | echo "Used eth0 MAC: ${base_mac}" >/dev/console 40 | fi 41 | fi 42 | 43 | # Final fallback to random MAC 44 | if [ -z "${base_mac}" ]; then 45 | echo "WARNING: Failed to get valid MAC, generating random one" >/dev/console 46 | base_mac="$(macaddr_random)" 47 | fi 48 | 49 | # Ensure MAC is uppercase 50 | base_mac="$(echo "${base_mac}" | tr 'a-z' 'A-Z')" 51 | 52 | # Derive LAN and WAN MACs 53 | lan_mac="${base_mac}" 54 | wan_mac="$(macaddr_add "${base_mac}" 1)" 55 | 56 | # Write MAC addresses to configuration 57 | [ -n "${lan_mac}" ] && ucidef_set_interface_macaddr "lan" "${lan_mac}" 58 | [ -n "${wan_mac}" ] && ucidef_set_interface_macaddr "wan" "${wan_mac}" 59 | [ -n "${lan_mac}" ] && ucidef_set_label_macaddr "${lan_mac}" 60 | } 61 | 62 | board_config_update 63 | # Set board name 64 | board="nsy,g68-plus" 65 | 66 | rockchip_setup_interfaces ${board} 67 | rockchip_setup_macs ${board} 68 | 69 | board_config_flush 70 | 71 | exit 0 72 | -------------------------------------------------------------------------------- /make-openwrt/openwrt-files/different-files/bdy-g18-pro/rootfs/etc/uci-defaults/99-wireless: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | . /lib/functions.sh 4 | 5 | # ======================================================= 6 | # 1. Configure wireless settings 7 | # ======================================================= 8 | if [ ! -f /etc/config/wireless ]; then 9 | wifi config 10 | fi 11 | 12 | # ----------------------------------------------------------- 13 | # 2. Configure 2G (radio0) - HT20 (N mode) 14 | # ----------------------------------------------------------- 15 | # Check if radio0 exists to avoid errors 16 | if uci get wireless.radio0 >/dev/null 2>&1; then 17 | uci set wireless.radio0.disabled='0' 18 | uci set wireless.radio0.country='CN' 19 | uci set wireless.radio0.band='2g' 20 | uci set wireless.radio0.channel='6' 21 | uci set wireless.radio0.htmode='HT20' 22 | uci set wireless.radio0.cell_density='0' 23 | uci set wireless.radio0.legacy_rates='0' 24 | 25 | # Interface settings 26 | uci set wireless.default_radio0.device='radio0' 27 | uci set wireless.default_radio0.network='lan' 28 | uci set wireless.default_radio0.mode='ap' 29 | uci set wireless.default_radio0.ssid='OpenWrt' 30 | uci set wireless.default_radio0.encryption='none' 31 | fi 32 | 33 | # ----------------------------------------------------------- 34 | # 3. Configure 5G (radio1) - VHT80 (AC mode) 35 | # ----------------------------------------------------------- 36 | # Check if radio1 exists to avoid errors 37 | if uci get wireless.radio1 >/dev/null 2>&1; then 38 | uci set wireless.radio1.disabled='0' 39 | uci set wireless.radio1.country='CN' 40 | uci set wireless.radio1.band='5g' 41 | uci set wireless.radio1.channel='149' 42 | uci set wireless.radio1.htmode='VHT80' 43 | uci set wireless.radio1.cell_density='1' 44 | uci set wireless.radio1.legacy_rates='0' 45 | 46 | # Interface settings 47 | uci set wireless.default_radio1.device='radio1' 48 | uci set wireless.default_radio1.network='lan' 49 | uci set wireless.default_radio1.mode='ap' 50 | uci set wireless.default_radio1.ssid='OpenWrt' 51 | uci set wireless.default_radio1.encryption='none' 52 | fi 53 | 54 | # ----------------------------------------------------------- 55 | # 4. Apply changes 56 | # ----------------------------------------------------------- 57 | uci commit wireless 58 | wifi reload 59 | 60 | exit 0 61 | -------------------------------------------------------------------------------- /make-openwrt/openwrt-files/different-files/nsy-g16-plus/rootfs/etc/uci-defaults/99-wireless: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | . /lib/functions.sh 4 | 5 | # ======================================================= 6 | # 1. Configure wireless settings 7 | # ======================================================= 8 | if [ ! -f /etc/config/wireless ]; then 9 | wifi config 10 | fi 11 | 12 | # ----------------------------------------------------------- 13 | # 2. Configure 2G (radio0) - HT20 (N mode) 14 | # ----------------------------------------------------------- 15 | # Check if radio0 exists to avoid errors 16 | if uci get wireless.radio0 >/dev/null 2>&1; then 17 | uci set wireless.radio0.disabled='0' 18 | uci set wireless.radio0.country='CN' 19 | uci set wireless.radio0.band='2g' 20 | uci set wireless.radio0.channel='6' 21 | uci set wireless.radio0.htmode='HT20' 22 | uci set wireless.radio0.cell_density='0' 23 | uci set wireless.radio0.legacy_rates='0' 24 | 25 | # Interface settings 26 | uci set wireless.default_radio0.device='radio0' 27 | uci set wireless.default_radio0.network='lan' 28 | uci set wireless.default_radio0.mode='ap' 29 | uci set wireless.default_radio0.ssid='OpenWrt' 30 | uci set wireless.default_radio0.encryption='none' 31 | fi 32 | 33 | # ----------------------------------------------------------- 34 | # 3. Configure 5G (radio1) - VHT80 (AC mode) 35 | # ----------------------------------------------------------- 36 | # Check if radio1 exists to avoid errors 37 | if uci get wireless.radio1 >/dev/null 2>&1; then 38 | uci set wireless.radio1.disabled='0' 39 | uci set wireless.radio1.country='CN' 40 | uci set wireless.radio1.band='5g' 41 | uci set wireless.radio1.channel='149' 42 | uci set wireless.radio1.htmode='VHT80' 43 | uci set wireless.radio1.cell_density='1' 44 | uci set wireless.radio1.legacy_rates='0' 45 | 46 | # Interface settings 47 | uci set wireless.default_radio1.device='radio1' 48 | uci set wireless.default_radio1.network='lan' 49 | uci set wireless.default_radio1.mode='ap' 50 | uci set wireless.default_radio1.ssid='OpenWrt' 51 | uci set wireless.default_radio1.encryption='none' 52 | fi 53 | 54 | # ----------------------------------------------------------- 55 | # 4. Apply changes 56 | # ----------------------------------------------------------- 57 | uci commit wireless 58 | wifi reload 59 | 60 | exit 0 61 | -------------------------------------------------------------------------------- /make-openwrt/openwrt-files/different-files/nsy-g68-plus/rootfs/etc/uci-defaults/99-wireless: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | . /lib/functions.sh 4 | 5 | # ======================================================= 6 | # 1. Configure wireless settings 7 | # ======================================================= 8 | if [ ! -f /etc/config/wireless ]; then 9 | wifi config 10 | fi 11 | 12 | # ----------------------------------------------------------- 13 | # 2. Configure 2G (radio0) - HT20 (N mode) 14 | # ----------------------------------------------------------- 15 | # Check if radio0 exists to avoid errors 16 | if uci get wireless.radio0 >/dev/null 2>&1; then 17 | uci set wireless.radio0.disabled='0' 18 | uci set wireless.radio0.country='CN' 19 | uci set wireless.radio0.band='2g' 20 | uci set wireless.radio0.channel='6' 21 | uci set wireless.radio0.htmode='HT20' 22 | uci set wireless.radio0.cell_density='0' 23 | uci set wireless.radio0.legacy_rates='0' 24 | 25 | # Interface settings 26 | uci set wireless.default_radio0.device='radio0' 27 | uci set wireless.default_radio0.network='lan' 28 | uci set wireless.default_radio0.mode='ap' 29 | uci set wireless.default_radio0.ssid='OpenWrt' 30 | uci set wireless.default_radio0.encryption='none' 31 | fi 32 | 33 | # ----------------------------------------------------------- 34 | # 3. Configure 5G (radio1) - VHT80 (AC mode) 35 | # ----------------------------------------------------------- 36 | # Check if radio1 exists to avoid errors 37 | if uci get wireless.radio1 >/dev/null 2>&1; then 38 | uci set wireless.radio1.disabled='0' 39 | uci set wireless.radio1.country='CN' 40 | uci set wireless.radio1.band='5g' 41 | uci set wireless.radio1.channel='149' 42 | uci set wireless.radio1.htmode='VHT80' 43 | uci set wireless.radio1.cell_density='1' 44 | uci set wireless.radio1.legacy_rates='0' 45 | 46 | # Interface settings 47 | uci set wireless.default_radio1.device='radio1' 48 | uci set wireless.default_radio1.network='lan' 49 | uci set wireless.default_radio1.mode='ap' 50 | uci set wireless.default_radio1.ssid='OpenWrt' 51 | uci set wireless.default_radio1.encryption='none' 52 | fi 53 | 54 | # ----------------------------------------------------------- 55 | # 4. Apply changes 56 | # ----------------------------------------------------------- 57 | uci commit wireless 58 | wifi reload 59 | 60 | exit 0 61 | -------------------------------------------------------------------------------- /make-openwrt/openwrt-files/different-files/rock5b/rootfs/etc/board.d/99-default_network: -------------------------------------------------------------------------------- 1 | # The default order of phy interfaces for Radxa ROCK5B is 2 | # eth0(2.5G) 3 | 4 | . /lib/functions/uci-defaults.sh 5 | . /lib/functions/system.sh 6 | 7 | board_config_update 8 | 9 | generate_mac() { 10 | # https://gist.githubusercontent.com/aallan/b4bb86db86079509e6159810ae9bd3e4/raw/846ae1b646ab0f4d646af9115e47365f4118e5f6/mac-vendor.txt 11 | # The MAC address range registered by realtek manufacturers is as follows: 12 | local mac_grp_0="00:20:18:" 13 | local mac_grp_1="00:4f:49:" 14 | local mac_grp_2="00:60:52:" 15 | local mac_grp_3="00:e0:4c:" 16 | local mac_grp_4="52:54:00:" 17 | local mac_grp_5="52:54:ab:" 18 | local mac_grp_cnt=6 19 | 20 | # get the cpu/emmc/sd unique id 21 | local sd_hash 22 | if [ -f "/sys/class/block/mmcblk1/device/cid" ]; then 23 | sd_hash=$(sha256sum /sys/class/block/mmcblk1/device/cid | cut -f1) 24 | elif [ -f "/sys/class/block/mmcblk0/device/cid" ]; then 25 | sd_hash=$(sha256sum /sys/class/block/mmcblk0/device/cid | cut -f1) 26 | else 27 | sd_hash=$(dd if=/dev/zero bs=1 count=68 | sha256sum | cut -f1) 28 | fi 29 | 30 | # get mac address head 31 | local dice=${mac_grp_cnt}$(echo $sd_hash | tr -d '[a-f]' | cut -b 1-6) 32 | local idx=$((dice % mac_grp_cnt)) 33 | eval local mac_head="\$mac_grp_${idx}" 34 | 35 | # get mac address tail 36 | # sd_hash length: max 64 37 | local mac_tail=$(echo $sd_hash | cut -b 16-17)":"$(echo $sd_hash | cut -b 26-27)":"$(echo $sd_hash | cut -b 42-43) 38 | 39 | echo "${mac_head}${mac_tail}" 40 | } 41 | 42 | swap_interface() { 43 | local eth_a=$1 44 | local eth_b=$2 45 | ip link set dev $eth_a down 46 | ip link set dev $eth_b down 47 | ip link set $eth_a name eth-rename-tmp 48 | ip link set $eth_b name $eth_a 49 | ip link set eth-rename-tmp name $eth_b 50 | ip link set dev $eth_a up 51 | ip link set dev $eth_b up 52 | } 53 | 54 | json_is_a network object && exit 0 55 | 56 | # Init LAN and WAN 57 | LAN_MAC=$(generate_mac) 58 | WAN_MAC=$(macaddr_add $LAN_MAC +1) 59 | ucidef_set_interface_lan 'eth0' 60 | ucidef_set_interface_macaddr "lan" $LAN_MAC 61 | if [ -d "/sys/class/net/eth1" ]; then 62 | ucidef_set_interface_wan 'eth1' 63 | ucidef_set_interface_macaddr "wan" $WAN_MAC 64 | fi 65 | 66 | board_config_flush 67 | 68 | exit 0 69 | -------------------------------------------------------------------------------- /make-openwrt/openwrt-files/different-files/rock5c/rootfs/etc/board.d/99-default_network: -------------------------------------------------------------------------------- 1 | # The default order of phy interfaces for Radxa ROCK5B is 2 | # eth0(2.5G) 3 | 4 | . /lib/functions/uci-defaults.sh 5 | . /lib/functions/system.sh 6 | 7 | board_config_update 8 | 9 | generate_mac() { 10 | # https://gist.githubusercontent.com/aallan/b4bb86db86079509e6159810ae9bd3e4/raw/846ae1b646ab0f4d646af9115e47365f4118e5f6/mac-vendor.txt 11 | # The MAC address range registered by realtek manufacturers is as follows: 12 | local mac_grp_0="00:20:18:" 13 | local mac_grp_1="00:4f:49:" 14 | local mac_grp_2="00:60:52:" 15 | local mac_grp_3="00:e0:4c:" 16 | local mac_grp_4="52:54:00:" 17 | local mac_grp_5="52:54:ab:" 18 | local mac_grp_cnt=6 19 | 20 | # get the cpu/emmc/sd unique id 21 | local sd_hash 22 | if [ -f "/sys/class/block/mmcblk1/device/cid" ]; then 23 | sd_hash=$(sha256sum /sys/class/block/mmcblk1/device/cid | cut -f1) 24 | elif [ -f "/sys/class/block/mmcblk0/device/cid" ]; then 25 | sd_hash=$(sha256sum /sys/class/block/mmcblk0/device/cid | cut -f1) 26 | else 27 | sd_hash=$(dd if=/dev/zero bs=1 count=68 | sha256sum | cut -f1) 28 | fi 29 | 30 | # get mac address head 31 | local dice=${mac_grp_cnt}$(echo $sd_hash | tr -d '[a-f]' | cut -b 1-6) 32 | local idx=$((dice % mac_grp_cnt)) 33 | eval local mac_head="\$mac_grp_${idx}" 34 | 35 | # get mac address tail 36 | # sd_hash length: max 64 37 | local mac_tail=$(echo $sd_hash | cut -b 16-17)":"$(echo $sd_hash | cut -b 26-27)":"$(echo $sd_hash | cut -b 42-43) 38 | 39 | echo "${mac_head}${mac_tail}" 40 | } 41 | 42 | swap_interface() { 43 | local eth_a=$1 44 | local eth_b=$2 45 | ip link set dev $eth_a down 46 | ip link set dev $eth_b down 47 | ip link set $eth_a name eth-rename-tmp 48 | ip link set $eth_b name $eth_a 49 | ip link set eth-rename-tmp name $eth_b 50 | ip link set dev $eth_a up 51 | ip link set dev $eth_b up 52 | } 53 | 54 | json_is_a network object && exit 0 55 | 56 | # Init LAN and WAN 57 | LAN_MAC=$(generate_mac) 58 | WAN_MAC=$(macaddr_add $LAN_MAC +1) 59 | ucidef_set_interface_lan 'eth0' 60 | ucidef_set_interface_macaddr "lan" $LAN_MAC 61 | if [ -d "/sys/class/net/eth1" ]; then 62 | ucidef_set_interface_wan 'eth1' 63 | ucidef_set_interface_macaddr "wan" $WAN_MAC 64 | fi 65 | 66 | board_config_flush 67 | 68 | exit 0 69 | -------------------------------------------------------------------------------- /make-openwrt/openwrt-files/different-files/e25/rootfs/etc/board.d/99-default_network: -------------------------------------------------------------------------------- 1 | # The phy interfaces for Radxa E25 is 2 | # eth0(2.5G) for lan 3 | # eth1(2.5G) for wan 4 | 5 | . /lib/functions/uci-defaults.sh 6 | . /lib/functions/system.sh 7 | 8 | board_config_update 9 | 10 | generate_mac() { 11 | # https://gist.githubusercontent.com/aallan/b4bb86db86079509e6159810ae9bd3e4/raw/846ae1b646ab0f4d646af9115e47365f4118e5f6/mac-vendor.txt 12 | # The MAC address range registered by realtek manufacturers is as follows: 13 | local mac_grp_0="00:20:18:" 14 | local mac_grp_1="00:4f:49:" 15 | local mac_grp_2="00:60:52:" 16 | local mac_grp_3="00:e0:4c:" 17 | local mac_grp_4="52:54:00:" 18 | local mac_grp_5="52:54:ab:" 19 | local mac_grp_cnt=6 20 | 21 | # get the cpu/emmc/sd unique id 22 | local sd_hash 23 | if [ -f "/sys/class/block/mmcblk1/device/cid" ]; then 24 | sd_hash=$(sha256sum /sys/class/block/mmcblk1/device/cid | cut -f1) 25 | elif [ -f "/sys/class/block/mmcblk0/device/cid" ]; then 26 | sd_hash=$(sha256sum /sys/class/block/mmcblk0/device/cid | cut -f1) 27 | else 28 | sd_hash=$(dd if=/dev/zero bs=1 count=68 | sha256sum | cut -f1) 29 | fi 30 | 31 | # get mac address head 32 | local dice=${mac_grp_cnt}$(echo $sd_hash | tr -d '[a-f]' | cut -b 1-6) 33 | local idx=$((dice % mac_grp_cnt)) 34 | eval local mac_head="\$mac_grp_${idx}" 35 | 36 | # get mac address tail 37 | # sd_hash length: max 64 38 | local mac_tail=$(echo $sd_hash | cut -b 16-17)":"$(echo $sd_hash | cut -b 26-27)":"$(echo $sd_hash | cut -b 42-43) 39 | 40 | echo "${mac_head}${mac_tail}" 41 | } 42 | 43 | swap_interface() { 44 | local eth_a=$1 45 | local eth_b=$2 46 | ip link set dev $eth_a down 47 | ip link set dev $eth_b down 48 | ip link set $eth_a name eth-rename-tmp 49 | ip link set $eth_b name $eth_a 50 | ip link set eth-rename-tmp name $eth_b 51 | ip link set dev $eth_a up 52 | ip link set dev $eth_b up 53 | } 54 | 55 | # Init LAN and WAN 56 | json_is_a network object && exit 0 57 | LAN_MAC=$(generate_mac) 58 | WAN_MAC=$(macaddr_add $LAN_MAC +1) 59 | 60 | # pcie3x2: eth0 3c080000 61 | # pcie2x1: eth1 3c000000 62 | if [ -d '/sys/devices/platform/3c0000000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0/net/eth0' ]; then 63 | swap_interface "eth0" "eth1" 64 | fi 65 | ucidef_set_interfaces_lan_wan 'eth0' 'eth1' 66 | ucidef_set_interface_macaddr "lan" $LAN_MAC 67 | ucidef_set_interface_macaddr "wan" $WAN_MAC 68 | 69 | board_config_flush 70 | 71 | exit 0 72 | -------------------------------------------------------------------------------- /make-openwrt/openwrt-files/different-files/mrkaio-m68s/rootfs/etc/board.d/99-default_network: -------------------------------------------------------------------------------- 1 | # The phy interfaces for EZPRO Mrkaio M68S is 2 | # eth0(1G) for lan 3 | # eth1(1G) for wan 4 | 5 | . /lib/functions/uci-defaults.sh 6 | . /lib/functions/system.sh 7 | 8 | board_config_update 9 | 10 | generate_mac() { 11 | # https://gist.githubusercontent.com/aallan/b4bb86db86079509e6159810ae9bd3e4/raw/846ae1b646ab0f4d646af9115e47365f4118e5f6/mac-vendor.txt 12 | # The MAC address range registered by realtek manufacturers is as follows: 13 | local mac_grp_0="00:20:18:" 14 | local mac_grp_1="00:4f:49:" 15 | local mac_grp_2="00:60:52:" 16 | local mac_grp_3="00:e0:4c:" 17 | local mac_grp_4="52:54:00:" 18 | local mac_grp_5="52:54:ab:" 19 | local mac_grp_cnt=6 20 | 21 | # get the cpu/emmc/sd unique id 22 | local sd_hash 23 | if [ -f "/sys/class/block/mmcblk1/device/cid" ]; then 24 | sd_hash=$(sha256sum /sys/class/block/mmcblk1/device/cid | cut -f1) 25 | elif [ -f "/sys/class/block/mmcblk0/device/cid" ]; then 26 | sd_hash=$(sha256sum /sys/class/block/mmcblk0/device/cid | cut -f1) 27 | else 28 | sd_hash=$(dd if=/dev/zero bs=1 count=68 | sha256sum | cut -f1) 29 | fi 30 | 31 | # get mac address head 32 | local dice=${mac_grp_cnt}$(echo $sd_hash | tr -d '[a-f]' | cut -b 1-6) 33 | local idx=$((dice % mac_grp_cnt)) 34 | eval local mac_head="\$mac_grp_${idx}" 35 | 36 | # get mac address tail 37 | # sd_hash length: max 64 38 | local mac_tail=$(echo $sd_hash | cut -b 16-17)":"$(echo $sd_hash | cut -b 26-27)":"$(echo $sd_hash | cut -b 42-43) 39 | 40 | echo "${mac_head}${mac_tail}" 41 | } 42 | 43 | swap_interface() { 44 | local eth_a=$1 45 | local eth_b=$2 46 | ip link set dev $eth_a down 47 | ip link set dev $eth_b down 48 | ip link set $eth_a name eth-rename-tmp 49 | ip link set $eth_b name $eth_a 50 | ip link set eth-rename-tmp name $eth_b 51 | ip link set dev $eth_a up 52 | ip link set dev $eth_b up 53 | } 54 | 55 | # Init LAN and WAN 56 | json_is_a network object && exit 0 57 | LAN_MAC=$(generate_mac) 58 | WAN_MAC=$(macaddr_add $LAN_MAC +1) 59 | 60 | # pcie3x2: eth0 3c080000 61 | # pcie2x1: eth1 3c000000 62 | if [ -d '/sys/devices/platform/3c0000000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0/net/eth0' ]; then 63 | swap_interface "eth0" "eth1" 64 | fi 65 | ucidef_set_interfaces_lan_wan 'eth0' 'eth1' 66 | ucidef_set_interface_macaddr "lan" $LAN_MAC 67 | ucidef_set_interface_macaddr "wan" $WAN_MAC 68 | 69 | board_config_flush 70 | 71 | exit 0 72 | -------------------------------------------------------------------------------- /make-openwrt/openwrt-files/different-files/s922x-oes-plus/rootfs/etc/openwrt-board-release.conf: -------------------------------------------------------------------------------- 1 | #=========================================================================== 2 | # 3 | # This file is a part of the Remake OpenWrt 4 | # https://github.com/ophub/amlogic-s9xxx-openwrt 5 | # 6 | # WXY-OES-Plus, 4GB-Mem,8GB-eMMC,3xSATA,1Gb-Nic,300MB-Nic 7 | # 8 | # Configuration: /etc/model_database.conf 9 | # MODEL_ID="410" 10 | # MODEL_BOARD="s922x-oes-plus" 11 | # SOC="s922x" 12 | # 13 | # ampart /dev/mmcblk2 14 | # IO seek EPT: Seeking to 37748736 15 | # EPT report: 5 partitions in the table: 16 | # =================================================================================== 17 | # ID| name | offset|( human)| size|( human)| masks 18 | # ----------------------------------------------------------------------------------- 19 | # 0: bootloader 0 ( 0.00B) 400000 ( 4.00M) 0 20 | # (GAP) 2000000 ( 32.00M) 21 | # 1: reserved 2400000 ( 36.00M) 4000000 ( 64.00M) 0 22 | # (GAP) 800000 ( 8.00M) 23 | # 2: cache 6c00000 ( 108.00M) 0 ( 0.00B) 0 24 | # (GAP) 800000 ( 8.00M) 25 | # 3: env 7400000 ( 116.00M) 800000 ( 8.00M) 0 26 | # (GAP) 800000 ( 8.00M) 27 | # 4: data 8400000 ( 132.00M) 1c9c00000 ( 7.15G) 4 28 | # =================================================================================== 29 | # EPT report: Minumum block in table: 0x400000, 4194304, 4.000000M 30 | # CLI dispatcher: invalid mode 31 | # 32 | #=========================================================================== 33 | # Set the partition value of a special board (fixed parameter) 34 | skip_mb="117" 35 | 36 | # Set the bootloader write command for a special board (fixed parameters) 37 | write_board_file="yes" 38 | write_board_bootloader() { 39 | dd if="${bootloader_path}/${board}/bootloader.bin" of="${loop_new}" conv=fsync,notrunc bs=512 skip=1 seek=1 count=8191 2>/dev/null 40 | dd if="${bootloader_path}/${board}/reserved.bin" of="${loop_new}" conv=fsync,notrunc bs=1M seek=36 count=8 2>/dev/null 41 | dd if="${bootloader_path}/${board}/env.bin" of="${loop_new}" conv=fsync,notrunc bs=1M seek=116 count=1 2>/dev/null 42 | # echo -e "${INFO} For [ ${board} ] write special bootloader: ${bootloader_path}/${board}/bootloader.bin" 43 | } 44 | -------------------------------------------------------------------------------- /make-openwrt/openwrt-files/different-files/h88k-v3/rootfs/etc/board.d/99-default_network: -------------------------------------------------------------------------------- 1 | # The default order of phy interfaces for H88K is 2 | # eth1(2.5G) eth0(1G) 3 | # swap to eth0(2.5G) eth1(1G) 4 | 5 | . /lib/functions/uci-defaults.sh 6 | . /lib/functions/system.sh 7 | 8 | board_config_update 9 | 10 | generate_mac() { 11 | # https://gist.githubusercontent.com/aallan/b4bb86db86079509e6159810ae9bd3e4/raw/846ae1b646ab0f4d646af9115e47365f4118e5f6/mac-vendor.txt 12 | # The MAC address range registered by realtek manufacturers is as follows: 13 | local mac_grp_0="00:20:18:" 14 | local mac_grp_1="00:4f:49:" 15 | local mac_grp_2="00:60:52:" 16 | local mac_grp_3="00:e0:4c:" 17 | local mac_grp_4="52:54:00:" 18 | local mac_grp_5="52:54:ab:" 19 | local mac_grp_cnt=6 20 | 21 | # get the cpu/emmc/sd unique id 22 | local sd_hash 23 | if [ -f "/sys/class/block/mmcblk1/device/cid" ]; then 24 | sd_hash=$(sha256sum /sys/class/block/mmcblk1/device/cid | cut -f1) 25 | elif [ -f "/sys/class/block/mmcblk0/device/cid" ]; then 26 | sd_hash=$(sha256sum /sys/class/block/mmcblk0/device/cid | cut -f1) 27 | else 28 | sd_hash=$(dd if=/dev/zero bs=1 count=68 | sha256sum | cut -f1) 29 | fi 30 | 31 | # get mac address head 32 | local dice=${mac_grp_cnt}$(echo $sd_hash | tr -d '[a-f]' | cut -b 1-6) 33 | local idx=$((dice % mac_grp_cnt)) 34 | eval local mac_head="\$mac_grp_${idx}" 35 | 36 | # get mac address tail 37 | # sd_hash length: max 64 38 | local mac_tail=$(echo $sd_hash | cut -b 16-17)":"$(echo $sd_hash | cut -b 26-27)":"$(echo $sd_hash | cut -b 42-43) 39 | 40 | echo "${mac_head}${mac_tail}" 41 | } 42 | 43 | swap_interface() { 44 | local eth_a=$1 45 | local eth_b=$2 46 | ip link set dev $eth_a down 47 | ip link set dev $eth_b down 48 | ip link set $eth_a name eth-rename-tmp 49 | ip link set $eth_b name $eth_a 50 | ip link set eth-rename-tmp name $eth_b 51 | ip link set dev $eth_a up 52 | ip link set dev $eth_b up 53 | } 54 | 55 | json_is_a network object && exit 0 56 | 57 | # Init LAN and WAN 58 | LAN_MAC=$(generate_mac) 59 | WAN_MAC=$(macaddr_add $LAN_MAC +1) 60 | 61 | machine_model=$(cat /proc/device-tree/model | tr -d "\000") 62 | case $machine_model in 63 | "Hlink H88K V3.1") 64 | ucidef_set_interfaces_lan_wan 'eth1 eth2' 'eth0' 65 | ;; 66 | "Hlink H88K-V3") 67 | ucidef_set_interfaces_lan_wan 'eth0 eth1' 'eth2' 68 | ;; 69 | *) 70 | ucidef_set_interfaces_lan_wan 'eth0' 'eth1' 71 | ;; 72 | esac 73 | ucidef_set_interface_macaddr "lan" $LAN_MAC 74 | ucidef_set_interface_macaddr "wan" $WAN_MAC 75 | 76 | board_config_flush 77 | 78 | exit 0 79 | -------------------------------------------------------------------------------- /make-openwrt/openwrt-files/different-files/h66k/rootfs/etc/board.d/99-default_network: -------------------------------------------------------------------------------- 1 | # The default order of phy interfaces for h66k is 2 | # eth0(2.5G) eth1(2.5G) 3 | 4 | . /lib/functions/uci-defaults.sh 5 | . /lib/functions/system.sh 6 | 7 | board_config_update 8 | 9 | generate_mac() 10 | { 11 | # https://gist.githubusercontent.com/aallan/b4bb86db86079509e6159810ae9bd3e4/raw/846ae1b646ab0f4d646af9115e47365f4118e5f6/mac-vendor.txt 12 | # The MAC address range registered by realtek manufacturers is as follows: 13 | local mac_grp_0="00:20:18:" 14 | local mac_grp_1="00:4f:49:" 15 | local mac_grp_2="00:60:52:" 16 | local mac_grp_3="00:e0:4c:" 17 | local mac_grp_4="52:54:00:" 18 | local mac_grp_5="52:54:ab:" 19 | local mac_grp_cnt=6 20 | 21 | # get the sd/emmc unique id 22 | local sd_hash 23 | if [ -f "/sys/class/block/mmcblk1/device/cid" ];then 24 | sd_hash=$(sha256sum /sys/class/block/mmcblk1/device/cid | cut -f1) 25 | elif [ -f "/sys/class/block/mmcblk0/device/cid" ];then 26 | sd_hash=$(sha256sum /sys/class/block/mmcblk0/device/cid | cut -f1) 27 | else 28 | sd_hash=$(dd if=/dev/zero bs=1 count=68 | sha256sum | cut -f1) 29 | fi 30 | 31 | # get mac address head 32 | local dice=${mac_grp_cnt}$(echo $sd_hash | tr -d '[a-f]' | cut -b 1-6) 33 | local idx=$((dice % mac_grp_cnt)) 34 | eval local mac_head="\$mac_grp_${idx}" 35 | 36 | # get mac address tail 37 | # sd_hash length: max 64 38 | local mac_tail=$(echo $sd_hash|cut -b 16-17)":"$(echo $sd_hash|cut -b 26-27)":"$(echo $sd_hash|cut -b 42-43) 39 | 40 | echo "${mac_head}${mac_tail}" 41 | } 42 | 43 | swap_interface() 44 | { 45 | local eth_a=$1 46 | local eth_b=$2 47 | ip link set dev $eth_a down 48 | ip link set dev $eth_b down 49 | ip link set $eth_a name eth-rename-tmp 50 | ip link set $eth_b name $eth_a 51 | ip link set eth-rename-tmp name $eth_b 52 | ip link set dev $eth_a up 53 | ip link set dev $eth_b up 54 | } 55 | 56 | # Swap eth0 & eth1, or eth0 & eth2(when have ext pcie eth) 57 | ext_pcie_eth="0" 58 | if [ -d "/sys/class/pci_bus/0000:01/device/0000:01:00.0" ];then 59 | pcie2_class=$(cat "/sys/class/pci_bus/0000:01/device/0000:01:00.0/class") 60 | if [ "${pcie2_class}" == "0x020000" ];then 61 | ext_pcie_eth="1" 62 | fi 63 | fi 64 | 65 | # Init LAN and WAN 66 | json_is_a network object && exit 0 67 | LAN_MAC=$(generate_mac) 68 | WAN_MAC=$(macaddr_add $LAN_MAC +1) 69 | 70 | if [ $ext_pcie_eth -eq 1 ];then 71 | ucidef_set_interfaces_lan_wan 'eth1 eth2' 'eth0' 72 | else 73 | ucidef_set_interfaces_lan_wan 'eth1' 'eth0' 74 | fi 75 | 76 | ucidef_set_interface_macaddr "lan" $LAN_MAC 77 | ucidef_set_interface_macaddr "wan" $WAN_MAC 78 | 79 | board_config_flush 80 | 81 | exit 0 82 | -------------------------------------------------------------------------------- /make-openwrt/openwrt-files/different-files/ruisen-box/rootfs/etc/board.d/99-default_network: -------------------------------------------------------------------------------- 1 | # The default order of phy interfaces for RUISEN Board is 2 | # eth0(1G) eth1(1G) 3 | 4 | . /lib/functions/uci-defaults.sh 5 | . /lib/functions/system.sh 6 | 7 | board_config_update 8 | 9 | generate_mac() 10 | { 11 | # https://gist.githubusercontent.com/aallan/b4bb86db86079509e6159810ae9bd3e4/raw/846ae1b646ab0f4d646af9115e47365f4118e5f6/mac-vendor.txt 12 | # The MAC address range registered by realtek manufacturers is as follows: 13 | local mac_grp_0="00:20:18:" 14 | local mac_grp_1="00:4f:49:" 15 | local mac_grp_2="00:60:52:" 16 | local mac_grp_3="00:e0:4c:" 17 | local mac_grp_4="52:54:00:" 18 | local mac_grp_5="52:54:ab:" 19 | local mac_grp_cnt=6 20 | 21 | # get the sd/emmc unique id 22 | local sd_hash 23 | if [ -f "/sys/class/block/mmcblk1/device/cid" ];then 24 | sd_hash=$(sha256sum /sys/class/block/mmcblk1/device/cid | cut -f1) 25 | elif [ -f "/sys/class/block/mmcblk0/device/cid" ];then 26 | sd_hash=$(sha256sum /sys/class/block/mmcblk0/device/cid | cut -f1) 27 | else 28 | sd_hash=$(dd if=/dev/zero bs=1 count=68 | sha256sum | cut -f1) 29 | fi 30 | 31 | # get mac address head 32 | local dice=${mac_grp_cnt}$(echo $sd_hash | tr -d '[a-f]' | cut -b 1-6) 33 | local idx=$((dice % mac_grp_cnt)) 34 | eval local mac_head="\$mac_grp_${idx}" 35 | 36 | # get mac address tail 37 | # sd_hash length: max 64 38 | local mac_tail=$(echo $sd_hash|cut -b 16-17)":"$(echo $sd_hash|cut -b 26-27)":"$(echo $sd_hash|cut -b 42-43) 39 | 40 | echo "${mac_head}${mac_tail}" 41 | } 42 | 43 | swap_interface() 44 | { 45 | local eth_a=$1 46 | local eth_b=$2 47 | ip link set dev $eth_a down 48 | ip link set dev $eth_b down 49 | ip link set $eth_a name eth-rename-tmp 50 | ip link set $eth_b name $eth_a 51 | ip link set eth-rename-tmp name $eth_b 52 | ip link set dev $eth_a up 53 | ip link set dev $eth_b up 54 | } 55 | 56 | # Swap eth0 & eth1, or eth0 & eth2(when have ext pcie eth) 57 | ext_pcie_eth="0" 58 | if [ -d "/sys/class/pci_bus/0000:01/device/0000:01:00.0" ];then 59 | pcie2_class=$(cat "/sys/class/pci_bus/0000:01/device/0000:01:00.0/class") 60 | if [ "${pcie2_class}" == "0x020000" ];then 61 | ext_pcie_eth="1" 62 | fi 63 | fi 64 | 65 | # Init LAN and WAN 66 | json_is_a network object && exit 0 67 | LAN_MAC=$(generate_mac) 68 | WAN_MAC=$(macaddr_add $LAN_MAC +1) 69 | 70 | if [ $ext_pcie_eth -eq 1 ];then 71 | ucidef_set_interfaces_lan_wan 'eth1 eth2' 'eth0' 72 | else 73 | ucidef_set_interfaces_lan_wan 'eth1' 'eth0' 74 | fi 75 | 76 | ucidef_set_interface_macaddr "lan" $LAN_MAC 77 | ucidef_set_interface_macaddr "wan" $WAN_MAC 78 | 79 | board_config_flush 80 | 81 | exit 0 82 | -------------------------------------------------------------------------------- /config/openwrt_main/diy-part2.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #======================================================================================================================== 3 | # https://github.com/ophub/amlogic-s9xxx-openwrt 4 | # Description: Automatically Build OpenWrt 5 | # Function: Diy script (After Update feeds, Modify the default IP, hostname, theme, add/remove software packages, etc.) 6 | # Source code repository: https://github.com/openwrt/openwrt / Branch: main 7 | #======================================================================================================================== 8 | 9 | # ------------------------------- Main source started ------------------------------- 10 | # 11 | # Set default IP address 12 | default_ip="192.168.1.1" 13 | ip_regex="^((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$" 14 | # Modify default IP if an argument is provided and it matches the IP format 15 | [[ -n "${1}" && "${1}" != "${default_ip}" && "${1}" =~ ${ip_regex} ]] && { 16 | echo "Modify default IP address to: ${1}" 17 | sed -i "/lan) ipad=\${ipaddr:-/s/\${ipaddr:-\"[^\"]*\"}/\${ipaddr:-\"${1}\"}/" package/base-files/*/bin/config_generate 18 | } 19 | 20 | # Add the default password for the 'root' user(Change the empty password to 'password') 21 | sed -i 's/root:::0:99999:7:::/root:$1$V4UetPzk$CYXluq4wUazHjmCDBCqXF.::0:99999:7:::/g' package/base-files/files/etc/shadow 22 | 23 | # Set etc/openwrt_release 24 | sed -i "s|DISTRIB_REVISION='.*'|DISTRIB_REVISION='R$(date +%Y.%m.%d)'|g" package/base-files/files/etc/openwrt_release 25 | echo "DISTRIB_SOURCEREPO='github.com/openwrt/openwrt'" >>package/base-files/files/etc/openwrt_release 26 | echo "DISTRIB_SOURCECODE='openwrt'" >>package/base-files/files/etc/openwrt_release 27 | echo "DISTRIB_SOURCEBRANCH='main'" >>package/base-files/files/etc/openwrt_release 28 | 29 | # Set ccache 30 | # Remove existing ccache settings 31 | sed -i '/CONFIG_DEVEL/d' .config 32 | sed -i '/CONFIG_CCACHE/d' .config 33 | # Apply new ccache configuration 34 | if [[ "${2}" == "true" ]]; then 35 | echo "CONFIG_DEVEL=y" >>.config 36 | echo "CONFIG_CCACHE=y" >>.config 37 | echo 'CONFIG_CCACHE_DIR="$(TOPDIR)/.ccache"' >>.config 38 | else 39 | echo '# CONFIG_DEVEL is not set' >>.config 40 | echo "# CONFIG_CCACHE is not set" >>.config 41 | echo 'CONFIG_CCACHE_DIR=""' >>.config 42 | fi 43 | # 44 | # ------------------------------- Main source ends ------------------------------- 45 | 46 | # ------------------------------- Other started ------------------------------- 47 | # 48 | # Add luci-app-amlogic 49 | rm -rf package/luci-app-amlogic 50 | git clone https://github.com/ophub/luci-app-amlogic.git package/luci-app-amlogic 51 | # 52 | # Apply patch 53 | # git apply ../config/patches/{0001*,0002*}.patch --directory=feeds/luci 54 | # 55 | # ------------------------------- Other ends ------------------------------- 56 | -------------------------------------------------------------------------------- /config/immortalwrt_master/diy-part2.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #======================================================================================================================== 3 | # https://github.com/ophub/amlogic-s9xxx-openwrt 4 | # Description: Automatically Build OpenWrt 5 | # Function: Diy script (After Update feeds, Modify the default IP, hostname, theme, add/remove software packages, etc.) 6 | # Source code repository: https://github.com/immortalwrt/immortalwrt / Branch: master 7 | #======================================================================================================================== 8 | 9 | # ------------------------------- Main source started ------------------------------- 10 | # 11 | # Set default IP address 12 | default_ip="192.168.1.1" 13 | ip_regex="^((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$" 14 | # Modify default IP if an argument is provided and it matches the IP format 15 | [[ -n "${1}" && "${1}" != "${default_ip}" && "${1}" =~ ${ip_regex} ]] && { 16 | echo "Modify default IP address to: ${1}" 17 | sed -i "/lan) ipad=\${ipaddr:-/s/\${ipaddr:-\"[^\"]*\"}/\${ipaddr:-\"${1}\"}/" package/base-files/*/bin/config_generate 18 | } 19 | 20 | # Add the default password for the 'root' user(Change the empty password to 'password') 21 | sed -i 's/root:::0:99999:7:::/root:$1$V4UetPzk$CYXluq4wUazHjmCDBCqXF.::0:99999:7:::/g' package/base-files/files/etc/shadow 22 | 23 | # Set etc/openwrt_release 24 | sed -i "s|DISTRIB_REVISION='.*'|DISTRIB_REVISION='R$(date +%Y.%m.%d)'|g" package/base-files/files/etc/openwrt_release 25 | echo "DISTRIB_SOURCEREPO='github.com/immortalwrt/immortalwrt'" >>package/base-files/files/etc/openwrt_release 26 | echo "DISTRIB_SOURCECODE='immortalwrt'" >>package/base-files/files/etc/openwrt_release 27 | echo "DISTRIB_SOURCEBRANCH='master'" >>package/base-files/files/etc/openwrt_release 28 | 29 | # Set ccache 30 | # Remove existing ccache settings 31 | sed -i '/CONFIG_DEVEL/d' .config 32 | sed -i '/CONFIG_CCACHE/d' .config 33 | # Apply new ccache configuration 34 | if [[ "${2}" == "true" ]]; then 35 | echo "CONFIG_DEVEL=y" >>.config 36 | echo "CONFIG_CCACHE=y" >>.config 37 | echo 'CONFIG_CCACHE_DIR="$(TOPDIR)/.ccache"' >>.config 38 | else 39 | echo '# CONFIG_DEVEL is not set' >>.config 40 | echo "# CONFIG_CCACHE is not set" >>.config 41 | echo 'CONFIG_CCACHE_DIR=""' >>.config 42 | fi 43 | # 44 | # ------------------------------- Main source ends ------------------------------- 45 | 46 | # ------------------------------- Other started ------------------------------- 47 | # 48 | # Add luci-app-amlogic 49 | rm -rf package/luci-app-amlogic 50 | git clone https://github.com/ophub/luci-app-amlogic.git package/luci-app-amlogic 51 | # 52 | # Apply patch 53 | # git apply ../config/patches/{0001*,0002*}.patch --directory=feeds/luci 54 | # 55 | # ------------------------------- Other ends ------------------------------- 56 | -------------------------------------------------------------------------------- /config/lede_master/diy-part2.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #======================================================================================================================== 3 | # https://github.com/ophub/amlogic-s9xxx-openwrt 4 | # Description: Automatically Build OpenWrt for Amlogic s9xxx tv box 5 | # Function: Diy script (After Update feeds, Modify the default IP, hostname, theme, add/remove software packages, etc.) 6 | # Source code repository: https://github.com/coolsnowwolf/lede / Branch: master 7 | #======================================================================================================================== 8 | 9 | # ------------------------------- Main source started ------------------------------- 10 | # 11 | # Set default IP address 12 | default_ip="192.168.1.1" 13 | ip_regex="^((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$" 14 | # Modify default IP if an argument is provided and it matches the IP format 15 | [[ -n "${1}" && "${1}" != "${default_ip}" && "${1}" =~ ${ip_regex} ]] && { 16 | echo "Modify default IP address to: ${1}" 17 | sed -i "/lan) ipad=\${ipaddr:-/s/\${ipaddr:-\"[^\"]*\"}/\${ipaddr:-\"${1}\"}/" package/base-files/*/bin/config_generate 18 | } 19 | 20 | # Modify default theme(FROM uci-theme-bootstrap CHANGE TO luci-theme-material) 21 | # sed -i 's/luci-theme-bootstrap/luci-theme-material/g' ./feeds/luci/collections/luci/Makefile 22 | 23 | # Add autocore support for armsr-armv8 24 | sed -i 's/TARGET_rockchip/TARGET_rockchip\|\|TARGET_armsr/g' package/lean/autocore/Makefile 25 | 26 | # Set etc/openwrt_release 27 | sed -i "s|DISTRIB_REVISION='.*'|DISTRIB_REVISION='R$(date +%Y.%m.%d)'|g" package/lean/default-settings/files/zzz-default-settings 28 | echo "DISTRIB_SOURCEREPO='github.com/coolsnowwolf/lede'" >>package/base-files/files/etc/openwrt_release 29 | echo "DISTRIB_SOURCECODE='lede'" >>package/base-files/files/etc/openwrt_release 30 | echo "DISTRIB_SOURCEBRANCH='master'" >>package/base-files/files/etc/openwrt_release 31 | 32 | # Set ccache 33 | # Remove existing ccache settings 34 | sed -i '/CONFIG_DEVEL/d' .config 35 | sed -i '/CONFIG_CCACHE/d' .config 36 | # Apply new ccache configuration 37 | if [[ "${2}" == "true" ]]; then 38 | echo "CONFIG_DEVEL=y" >>.config 39 | echo "CONFIG_CCACHE=y" >>.config 40 | echo 'CONFIG_CCACHE_DIR="$(TOPDIR)/.ccache"' >>.config 41 | else 42 | echo '# CONFIG_DEVEL is not set' >>.config 43 | echo "# CONFIG_CCACHE is not set" >>.config 44 | echo 'CONFIG_CCACHE_DIR=""' >>.config 45 | fi 46 | # 47 | # ------------------------------- Main source ends ------------------------------- 48 | 49 | # ------------------------------- Other started ------------------------------- 50 | # 51 | # Add luci-app-amlogic 52 | rm -rf package/luci-app-amlogic 53 | git clone https://github.com/ophub/luci-app-amlogic.git package/luci-app-amlogic 54 | # 55 | # Apply patch 56 | # git apply ../config/patches/{0001*,0002*}.patch --directory=feeds/luci 57 | # 58 | # ------------------------------- Other ends ------------------------------- 59 | -------------------------------------------------------------------------------- /make-openwrt/openwrt-files/different-files/h69k/rootfs/etc/board.d/99-default_network: -------------------------------------------------------------------------------- 1 | # The default order of phy interfaces for H69k is 2 | # eth1(1G) eth0(1G) eth3(2.5G) eth2(2.5G) 3 | # Reset to 0 1 2 3 for intuitive 4 | 5 | . /lib/functions/uci-defaults.sh 6 | . /lib/functions/system.sh 7 | 8 | board_config_update 9 | 10 | generate_mac() 11 | { 12 | # https://gist.githubusercontent.com/aallan/b4bb86db86079509e6159810ae9bd3e4/raw/846ae1b646ab0f4d646af9115e47365f4118e5f6/mac-vendor.txt 13 | # The MAC address range registered by realtek manufacturers is as follows: 14 | local mac_grp_0="00:20:18:" 15 | local mac_grp_1="00:4f:49:" 16 | local mac_grp_2="00:60:52:" 17 | local mac_grp_3="00:e0:4c:" 18 | local mac_grp_4="52:54:00:" 19 | local mac_grp_5="52:54:ab:" 20 | local mac_grp_cnt=6 21 | 22 | # get the sd/emmc unique id 23 | local sd_hash 24 | if [ -f "/sys/class/block/mmcblk1/device/cid" ];then 25 | sd_hash=$(sha256sum /sys/class/block/mmcblk1/device/cid | cut -f1) 26 | elif [ -f "/sys/class/block/mmcblk0/device/cid" ];then 27 | sd_hash=$(sha256sum /sys/class/block/mmcblk0/device/cid | cut -f1) 28 | else 29 | sd_hash=$(dd if=/dev/zero bs=1 count=68 | sha256sum | cut -f1) 30 | fi 31 | 32 | # get mac address head 33 | local dice=${mac_grp_cnt}$(echo $sd_hash | tr -d '[a-f]' | cut -b 1-6) 34 | local idx=$((dice % mac_grp_cnt)) 35 | eval local mac_head="\$mac_grp_${idx}" 36 | 37 | # get mac address tail 38 | # sd_hash length: max 64 39 | local mac_tail=$(echo $sd_hash|cut -b 16-17)":"$(echo $sd_hash|cut -b 26-27)":"$(echo $sd_hash|cut -b 42-43) 40 | 41 | echo "${mac_head}${mac_tail}" 42 | } 43 | 44 | swap_interface() 45 | { 46 | local eth_a=$1 47 | local eth_b=$2 48 | ip link set dev $eth_a down 49 | ip link set dev $eth_b down 50 | ip link set $eth_a name eth-rename-tmp 51 | ip link set $eth_b name $eth_a 52 | ip link set eth-rename-tmp name $eth_b 53 | ip link set dev $eth_a up 54 | ip link set dev $eth_b up 55 | } 56 | 57 | # Checking if gmac0 is disabled 58 | gmac0_status=$(cat /proc/device-tree/ethernet@fe2a0000/status | tr -d '\000') 59 | # Fixed PCIe Ethernet port order 60 | if [ "${gmac0_status}" == "disabled" ];then 61 | # pcie3x1 -> eth1 62 | # pcie3x2 -> eth2 63 | if [ -d "/sys/devices/platform/3c0400000.pcie/pci0001:10/0001:10:00.0/0001:11:00.0/net/eth2" ];then 64 | swap_interface "eth2" "eth1" 65 | fi 66 | else 67 | # pcie3x1 -> eth2 68 | # pcie3x2 -> eth3 69 | if [ -d "/sys/devices/platform/3c0400000.pcie/pci0001:10/0001:10:00.0/0001:11:00.0/net/eth3" ];then 70 | swap_interface "eth3" "eth2" 71 | fi 72 | fi 73 | 74 | json_is_a network object && exit 0 75 | 76 | # Init LAN and WAN 77 | LAN_MAC=$(generate_mac) 78 | WAN_MAC=$(macaddr_add $LAN_MAC +1) 79 | 80 | if [ "${gmac0_status}" == "disabled" ];then 81 | ucidef_set_interfaces_lan_wan 'eth0 eth1' 'eth2' 82 | else 83 | ucidef_set_interfaces_lan_wan 'eth0 eth1 eth2' 'eth3' 84 | fi 85 | 86 | ucidef_set_interface_macaddr "lan" $LAN_MAC 87 | ucidef_set_interface_macaddr "wan" $WAN_MAC 88 | 89 | board_config_flush 90 | 91 | exit 0 92 | -------------------------------------------------------------------------------- /make-openwrt/openwrt-files/different-files/h88k/rootfs/etc/board.d/99-default_network: -------------------------------------------------------------------------------- 1 | # The default order of phy interfaces for H88K is 2 | # eth1(2.5G) eth0(1G) 3 | # swap to eth0(2.5G) eth1(1G) 4 | 5 | . /lib/functions/uci-defaults.sh 6 | . /lib/functions/system.sh 7 | 8 | board_config_update 9 | 10 | generate_mac() { 11 | # https://gist.githubusercontent.com/aallan/b4bb86db86079509e6159810ae9bd3e4/raw/846ae1b646ab0f4d646af9115e47365f4118e5f6/mac-vendor.txt 12 | # The MAC address range registered by realtek manufacturers is as follows: 13 | local mac_grp_0="00:20:18:" 14 | local mac_grp_1="00:4f:49:" 15 | local mac_grp_2="00:60:52:" 16 | local mac_grp_3="00:e0:4c:" 17 | local mac_grp_4="52:54:00:" 18 | local mac_grp_5="52:54:ab:" 19 | local mac_grp_cnt=6 20 | 21 | # get the cpu/emmc/sd unique id 22 | local sd_hash 23 | if [ -f "/sys/class/block/mmcblk1/device/cid" ]; then 24 | sd_hash=$(sha256sum /sys/class/block/mmcblk1/device/cid | cut -f1) 25 | elif [ -f "/sys/class/block/mmcblk0/device/cid" ]; then 26 | sd_hash=$(sha256sum /sys/class/block/mmcblk0/device/cid | cut -f1) 27 | else 28 | sd_hash=$(dd if=/dev/zero bs=1 count=68 | sha256sum | cut -f1) 29 | fi 30 | 31 | # get mac address head 32 | local dice=${mac_grp_cnt}$(echo $sd_hash | tr -d '[a-f]' | cut -b 1-6) 33 | local idx=$((dice % mac_grp_cnt)) 34 | eval local mac_head="\$mac_grp_${idx}" 35 | 36 | # get mac address tail 37 | # sd_hash length: max 64 38 | local mac_tail=$(echo $sd_hash | cut -b 16-17)":"$(echo $sd_hash | cut -b 26-27)":"$(echo $sd_hash | cut -b 42-43) 39 | 40 | echo "${mac_head}${mac_tail}" 41 | } 42 | 43 | swap_interface() { 44 | local eth_a=$1 45 | local eth_b=$2 46 | ip link set dev $eth_a down 47 | ip link set dev $eth_b down 48 | ip link set $eth_a name eth-rename-tmp 49 | ip link set $eth_b name $eth_a 50 | ip link set eth-rename-tmp name $eth_b 51 | ip link set dev $eth_a up 52 | ip link set dev $eth_b up 53 | } 54 | 55 | # Swap eth0 & eth1 56 | gmac0_enabled="0" 57 | ext_pcie_eth="0" 58 | if [ -d "/sys/devices/platform/fe1b0000.ethernet" ]; then 59 | gmac0_enabled=1 60 | if [ -d "/sys/devices/platform/fe1b0000.ethernet/net/eth0" ]; then 61 | swap_interface "eth0" "eth1" 62 | fi 63 | elif [ -d "/sys/class/pci_bus/0002:21/device/0002:21:00.0" ]; then 64 | pcie2_class=$(cat "/sys/class/pci_bus/0002:21/device/0002:21:00.0/class") 65 | if [ "${pcie2_class}" == "0x020000" ]; then 66 | ext_pcie_eth="1" 67 | if [ -d "/sys/devices/platform/fe170000.pcie/pci0002:20/0002:20:00.0/0002:21:00.0/net/eth0" ]; then 68 | swap_interface "eth0" "eth1" 69 | fi 70 | fi 71 | fi 72 | 73 | json_is_a network object && exit 0 74 | 75 | # Init LAN and WAN 76 | LAN_MAC=$(generate_mac) 77 | if [ ${gmac0_enabled} -eq 1 ] || [ ${ext_pcie_eth} -eq 1 ]; then 78 | # if has two available nic 79 | ucidef_set_interfaces_lan_wan 'eth0' 'eth1' 80 | if [ ${ext_pcie_eth} -eq 1 ]; then 81 | WAN_MAC=$(macaddr_add $LAN_MAC +1) 82 | ucidef_set_interface_macaddr "wan" $WAN_MAC 83 | fi 84 | else 85 | # only one nic 86 | ucidef_set_interfaces_lan_wan 'eth0' 87 | fi 88 | 89 | ucidef_set_interface_macaddr "lan" $LAN_MAC 90 | 91 | board_config_flush 92 | 93 | exit 0 94 | -------------------------------------------------------------------------------- /.github/workflows/build-openwer-docker-image.yml: -------------------------------------------------------------------------------- 1 | #===================================================================================== 2 | # https://github.com/ophub/amlogic-s9xxx-openwrt 3 | # Description: Build OpenWrt Docker image 4 | # Instructions: https://github.com/docker/build-push-action 5 | # Build and Push to: https://hub.docker.com/ 6 | #===================================================================================== 7 | 8 | name: Build OpenWrt Docker image 9 | 10 | on: 11 | repository_dispatch: 12 | workflow_dispatch: 13 | inputs: 14 | source_branch: 15 | description: "Select the source branch" 16 | required: false 17 | default: "openwrt_main" 18 | type: choice 19 | options: 20 | - openwrt_main 21 | - immortalwrt_master 22 | - lede_master 23 | docker_img: 24 | description: "Set the docker image" 25 | required: false 26 | default: "ophub/openwrt-armv8:latest" 27 | type: choice 28 | options: 29 | - ophub/openwrt-armv8:latest 30 | - ophub/openwrt-aarch64:latest 31 | 32 | env: 33 | TZ: Etc/UTC 34 | MAKE_DOCKER_SH: config/docker/make_docker_image.sh 35 | DOCKER_OUTPATH: out 36 | 37 | jobs: 38 | build: 39 | runs-on: ubuntu-24.04-arm 40 | if: ${{ github.event.repository.owner.id }} == ${{ github.event.sender.id }} 41 | 42 | steps: 43 | - name: Checkout 44 | uses: actions/checkout@v6 45 | 46 | - name: Download OpenWrt rootfs file [ ${{ inputs.source_branch }} ] 47 | id: down 48 | if: (!cancelled()) 49 | run: | 50 | # Get OpenWrt file 51 | openwrt_url="$(curl \ 52 | --header "authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \ 53 | -s "https://api.github.com/repos/${{ github.repository }}/releases?per_page=20" | 54 | grep -o "OpenWrt_.*${{ inputs.source_branch }}.*/.*rootfs.tar.gz" | 55 | sort -urV | 56 | head -n 1 57 | )" 58 | [[ -z "${openwrt_url}" ]] && echo -e "OpenWrt file not found!" && exit 1 59 | 60 | [[ -d "openwrt" ]] || mkdir -p openwrt 61 | curl -fsSL "https://github.com/${{ github.repository }}/releases/download/${openwrt_url}" -o "openwrt/openwrt-armsr-armv8-generic-rootfs.tar.gz" 62 | [[ "${?}" -ne "0" ]] && echo "OpenWrt file download failed." && exit 1 63 | echo "status=success" >> ${GITHUB_OUTPUT} 64 | 65 | - name: Build the Docker image 66 | id: make 67 | if: ${{ steps.down.outputs.status }} == 'success' && !cancelled() 68 | run: | 69 | chmod +x ${MAKE_DOCKER_SH} 70 | ${MAKE_DOCKER_SH} 71 | echo "status=success" >> ${GITHUB_OUTPUT} 72 | 73 | - name: Set up Docker Buildx 74 | id: buildx 75 | if: (!cancelled()) 76 | uses: docker/setup-buildx-action@v3 77 | 78 | - name: Login to Docker Hub 79 | id: login 80 | if: (!cancelled()) 81 | uses: docker/login-action@v3 82 | with: 83 | username: ${{ secrets.DOCKERHUB_USERNAME }} 84 | password: ${{ secrets.DOCKERHUB_PASSWORD }} 85 | 86 | - name: Push to Docker Hub 87 | id: push 88 | if: (!cancelled()) 89 | uses: docker/build-push-action@v5 90 | with: 91 | push: true 92 | platforms: linux/arm64 93 | context: ${{ env.DOCKER_OUTPATH }} 94 | tags: "${{ inputs.docker_img }}" 95 | -------------------------------------------------------------------------------- /.github/workflows/delete-older-releases-workflows.yml: -------------------------------------------------------------------------------- 1 | #========================================================================== 2 | # https://github.com/ophub/amlogic-s9xxx-openwrt 3 | # Description: Delete older releases and workflows runs 4 | #========================================================================== 5 | 6 | name: Delete older releases and workflows 7 | 8 | on: 9 | repository_dispatch: 10 | workflow_dispatch: 11 | inputs: 12 | delete_releases: 13 | description: "Delete Releases file?" 14 | required: true 15 | default: true 16 | type: boolean 17 | delete_tags: 18 | description: "Delete related Tags?" 19 | required: false 20 | default: true 21 | type: boolean 22 | prerelease_option: 23 | description: "Whether to differentiate pre-release." 24 | required: false 25 | default: "all" 26 | type: choice 27 | options: 28 | - all 29 | - true 30 | - false 31 | releases_keep_latest: 32 | description: "How many latest releases to keep." 33 | required: false 34 | default: "2" 35 | type: choice 36 | options: 37 | - 30 38 | - 20 39 | - 10 40 | - 9 41 | - 8 42 | - 7 43 | - 6 44 | - 5 45 | - 4 46 | - 3 47 | - 2 48 | - 1 49 | - 0 50 | releases_keep_keyword: 51 | description: "Keyword of the keep releases." 52 | required: false 53 | default: "v0/_save_/kernel_" 54 | delete_workflows: 55 | description: "Delete workflows records?" 56 | required: true 57 | default: true 58 | type: boolean 59 | workflows_keep_day: 60 | description: "Days to keep workflows." 61 | required: false 62 | default: "1" 63 | type: choice 64 | options: 65 | - 30 66 | - 20 67 | - 10 68 | - 9 69 | - 8 70 | - 7 71 | - 6 72 | - 5 73 | - 4 74 | - 3 75 | - 2 76 | - 1 77 | - 0 78 | workflows_keep_keyword: 79 | description: "keywords for keep workflows." 80 | required: false 81 | default: "" 82 | out_log: 83 | description: "Output detailed JSON logs." 84 | required: false 85 | default: true 86 | type: boolean 87 | 88 | env: 89 | TZ: Etc/UTC 90 | 91 | jobs: 92 | build: 93 | runs-on: ubuntu-24.04-arm 94 | if: ${{ github.event.repository.owner.id }} == ${{ github.event.sender.id }} 95 | 96 | steps: 97 | - name: Checkout 98 | uses: actions/checkout@v6 99 | 100 | - name: Initialization environment 101 | id: init 102 | env: 103 | DEBIAN_FRONTEND: noninteractive 104 | run: | 105 | sudo timedatectl set-timezone "${TZ}" 106 | echo "status=success" >> ${GITHUB_OUTPUT} 107 | 108 | - name: Delete releases and workflows runs 109 | uses: ophub/delete-releases-workflows@main 110 | with: 111 | delete_releases: ${{ inputs.delete_releases }} 112 | delete_tags: ${{ inputs.delete_tags }} 113 | prerelease_option: ${{ inputs.prerelease_option }} 114 | releases_keep_latest: ${{ inputs.releases_keep_latest }} 115 | releases_keep_keyword: ${{ inputs.releases_keep_keyword }} 116 | delete_workflows: ${{ inputs.delete_workflows }} 117 | workflows_keep_day: ${{ inputs.workflows_keep_day }} 118 | workflows_keep_keyword: ${{ inputs.workflows_keep_keyword }} 119 | out_log: ${{ inputs.out_log }} 120 | gh_token: ${{ secrets.GITHUB_TOKEN }} 121 | -------------------------------------------------------------------------------- /make-openwrt/openwrt-files/common-files/usr/bin/cpustat: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env perl 2 | use strict; 3 | use utf8; 4 | use Time::HiRes qw /usleep/; 5 | binmode(STDOUT, ":utf8"); 6 | 7 | sub get_soc_temp { 8 | my $t=shift; 9 | my @fnames=( 10 | '/sys/devices/virtual/thermal/thermal_zone0/temp', 11 | '/sys/devices/platform/scpi/scpi:sensors/hwmon/hwmon0/temp1_input', 12 | ); 13 | my $temp = "Unknown"; 14 | for my $fname (@fnames) { 15 | if( -f $fname ) { 16 | open my $fh, "<", $fname; 17 | if($t) { 18 | $temp = sprintf "%0.1f", <$fh> / 1000; 19 | } else { 20 | $temp = sprintf "%0.1f℃", <$fh> / 1000; 21 | } 22 | close $fh; 23 | return $temp; 24 | } 25 | } 26 | 27 | return $temp; 28 | } 29 | 30 | sub get_cpu_freq { 31 | my $f=shift; 32 | my @fnames=; 33 | my $freq_str = ""; 34 | for (my $i=0; $i < $#fnames + 1; $i++) { 35 | my $fname = $fnames[$i]; 36 | open my $fh, "<", $fname; 37 | usleep(50000); 38 | my $freq; 39 | if($f =~ /-F(\d*)/) { 40 | my $alert_mhz = 1500; 41 | if($1 ne "") { 42 | $alert_mhz = $1; 43 | } 44 | my $color = "\x1b[92m"; 45 | $freq = <$fh> / 1000; 46 | if($freq > $alert_mhz) { 47 | $color = "\x1b[93m"; 48 | } 49 | $freq = sprintf "%s%d Mhz\x1b[0m", $color, $freq; 50 | } else { 51 | $freq = sprintf "%dMhz", <$fh> / 1000; 52 | } 53 | close $fh; 54 | $freq_str .= $freq; 55 | if($i < $#fnames) { 56 | $freq_str .= " & "; 57 | } 58 | } 59 | 60 | if($#fnames > 0 && $f eq "") { 61 | $freq_str = "(" . $freq_str . ")"; 62 | } 63 | 64 | return $freq_str; 65 | } 66 | 67 | sub get_arch_info { 68 | my $a=shift; 69 | my @cpus = ; 70 | my @cpu_groups; 71 | my %group_core_count; 72 | for my $cpu (@cpus) { 73 | open my $fh, "<", "${cpu}/uevent"; 74 | while(<$fh>) { 75 | chomp; 76 | my($key,$value) = split /=/; 77 | if($key eq "OF_COMPATIBLE_0") { 78 | my($cortex, $a) = split /-/, (split /,/, $value)[1]; 79 | my $core_type_name = ucfirst($cortex) . "-" . ucfirst($a); 80 | if(not exists $group_core_count{$core_type_name}) { 81 | push @cpu_groups, $core_type_name; 82 | $group_core_count{$core_type_name} = 0; 83 | } 84 | $group_core_count{$core_type_name} += 1; 85 | } 86 | } 87 | close $fh; 88 | } 89 | 90 | my $arch_info; 91 | if($a) { 92 | $arch_info = "AArch64 : " if ($a); 93 | } else { 94 | $arch_info = "AArch64 Processor : "; 95 | } 96 | for (my $i = 0; $i < $#cpu_groups + 1; $i++) { 97 | my $group = $cpu_groups[$i]; 98 | #if($i == 0) { 99 | # $arch_info .= ""; 100 | #} 101 | $arch_info .= $group; 102 | if($a) { 103 | $arch_info .= " x "; 104 | } else { 105 | $arch_info .= " * "; 106 | } 107 | $arch_info .= $group_core_count{$group}; 108 | if($i < $#cpu_groups) { 109 | $arch_info .= " & "; 110 | } #else { 111 | # $arch_info .= ""; 112 | #} 113 | } 114 | 115 | return "$arch_info"; 116 | } 117 | 118 | sub get_uptime { 119 | my $fh; 120 | my $result; 121 | open $fh, "<", "/proc/uptime" or die; 122 | my $str_uptime = <$fh>; 123 | if($str_uptime =~ /(\d*)/) { 124 | my $day = int($1/86400); 125 | my $hour = int(($1%86400)/3600); 126 | my $min = int(($1%3600)/60); 127 | my $sec = $1%60; 128 | 129 | my $sday = $day . "d " if($day>0); 130 | my $shour = $hour . "h " if($hour>0 || $day>0) ; 131 | my $smin = $min . "m "; 132 | my $ssec = $sec . "s"; 133 | $result .= $sday . $shour . $smin . $ssec; 134 | } 135 | close $fh; 136 | return $result; 137 | } 138 | 139 | sub get_avgload { 140 | my $fh; 141 | my $result; 142 | open $fh, "<", "/proc/loadavg" or die; 143 | my $str = <$fh>; 144 | $result = join(' ', (split(/\s+/, $str))[0,1,2]); 145 | close $fh; 146 | return $result; 147 | } 148 | 149 | ##### main program ##### 150 | my $argc = scalar( @ARGV ); 151 | if($argc == 0) { 152 | print &get_cpu_freq, " / ", &get_soc_temp, "\n"; 153 | } elsif($ARGV[0] eq "-a") { 154 | print &get_arch_info, "\n"; 155 | } elsif($ARGV[0] eq "-A") { 156 | print &get_arch_info("A"), "\n"; 157 | } elsif($ARGV[0] eq "-t") { 158 | print &get_soc_temp, "\n"; 159 | } elsif($ARGV[0] eq "-T") { 160 | print &get_soc_temp("T"), "\n"; 161 | } elsif($ARGV[0] eq "-f") { 162 | print &get_cpu_freq, "\n"; 163 | } elsif($ARGV[0] =~ /-F/) { 164 | print &get_cpu_freq($ARGV[0]), "\n"; 165 | } elsif($ARGV[0] eq "-u") { 166 | print &get_uptime, "\n"; 167 | } elsif($ARGV[0] eq "-l") { 168 | print &get_avgload, "\n"; 169 | } 170 | -------------------------------------------------------------------------------- /make-openwrt/openwrt-files/different-files/a311d-oes/rootfs/etc/openwrt-board-release.conf: -------------------------------------------------------------------------------- 1 | #=========================================================================== 2 | # 3 | # This file is a part of the Remake OpenWrt 4 | # https://github.com/ophub/amlogic-s9xxx-openwrt 5 | # 6 | # WXY-OES, 4GB-Mem,8GB-eMMC,3xSATA,1Gb-Nic 7 | # 8 | # Configuration: /etc/model_database.conf 9 | # MODEL_ID="409" 10 | # MODEL_BOARD="a311d-oes" 11 | # SOC="a311d" 12 | # 13 | # ampart /dev/mmcblk2 14 | # IO seek EPT: Seeking to 37748736 15 | # EPT report: 20 partitions in the table: 16 | # =================================================================================== 17 | # ID| name | offset|( human)| size|( human)| masks 18 | # ----------------------------------------------------------------------------------- 19 | # 0: bootloader 0 ( 0.00B) 400000 ( 4.00M) 0 20 | # (GAP) 2000000 ( 32.00M) 21 | # 1: reserved 2400000 ( 36.00M) 4000000 ( 64.00M) 0 22 | # (GAP) 800000 ( 8.00M) 23 | # 2: cache 6c00000 ( 108.00M) 20000000 ( 512.00M) 2 24 | # (GAP) 800000 ( 8.00M) 25 | # 3: env 27400000 ( 628.00M) 800000 ( 8.00M) 0 26 | # (GAP) 800000 ( 8.00M) 27 | # 4: logo 28400000 ( 644.00M) 800000 ( 8.00M) 1 28 | # (GAP) 800000 ( 8.00M) 29 | # 5: recovery 29400000 ( 660.00M) 1800000 ( 24.00M) 1 30 | # (GAP) 800000 ( 8.00M) 31 | # 6: misc 2b400000 ( 692.00M) 2000000 ( 32.00M) 1 32 | # (GAP) 800000 ( 8.00M) 33 | # 7: dto 2dc00000 ( 732.00M) 800000 ( 8.00M) 1 34 | # (GAP) 800000 ( 8.00M) 35 | # 8: cri_data 2ec00000 ( 748.00M) 800000 ( 8.00M) 2 36 | # (GAP) 800000 ( 8.00M) 37 | # 9: param 2fc00000 ( 764.00M) 1000000 ( 16.00M) 2 38 | # (GAP) 800000 ( 8.00M) 39 | # 10: boot 31400000 ( 788.00M) 2000000 ( 32.00M) 1 40 | # (GAP) 800000 ( 8.00M) 41 | # 11: rsv 33c00000 ( 828.00M) 1000000 ( 16.00M) 1 42 | # (GAP) 800000 ( 8.00M) 43 | # 12: tee 35400000 ( 852.00M) 2000000 ( 32.00M) 1 44 | # (GAP) 800000 ( 8.00M) 45 | # 13: vendor 37c00000 ( 892.00M) 10000000 ( 256.00M) 1 46 | # (GAP) 800000 ( 8.00M) 47 | # 14: odm 48400000 ( 1.13G) 10000000 ( 256.00M) 1 48 | # (GAP) 800000 ( 8.00M) 49 | # 15: system 58c00000 ( 1.39G) 40000000 (1024.00M) 1 50 | # (GAP) 800000 ( 8.00M) 51 | # 16: kernel 99400000 ( 2.39G) 2000000 ( 32.00M) 2 52 | # (GAP) 800000 ( 8.00M) 53 | # 17: backup 9bc00000 ( 2.43G) 40000000 (1024.00M) 2 54 | # (GAP) 800000 ( 8.00M) 55 | # 18: instaboot dc400000 ( 3.44G) 20000000 ( 512.00M) 2 56 | # (GAP) 800000 ( 8.00M) 57 | # 19: data fcc00000 ( 3.95G) d5400000 ( 3.33G) 4 58 | # =================================================================================== 59 | # EPT report: Minumum block in table: 0x400000, 4194304, 4.000000M 60 | # CLI dispatcher: invalid mode 61 | # 62 | #=========================================================================== 63 | # Set the partition value of a special board (fixed parameter) 64 | skip_mb="700" 65 | 66 | # Set the bootloader write command for a special board (fixed parameters) 67 | write_board_file="yes" 68 | write_board_bootloader() { 69 | dd if="${bootloader_path}/${board}/bootloader.bin" of="${loop_new}" conv=fsync,notrunc bs=512 skip=1 seek=1 count=8191 2>/dev/null 70 | dd if="${bootloader_path}/${board}/reserved.bin" of="${loop_new}" conv=fsync,notrunc bs=1M seek=36 count=8 2>/dev/null 71 | dd if="${bootloader_path}/${board}/env.bin" of="${loop_new}" conv=fsync,notrunc bs=1M seek=628 count=1 2>/dev/null 72 | # echo -e "${INFO} For [ ${board} ] write special bootloader: ${bootloader_path}/${board}/bootloader.bin" 73 | } 74 | -------------------------------------------------------------------------------- /action.yml: -------------------------------------------------------------------------------- 1 | name: "Make OpenWrt" 2 | author: "https://github.com/ophub/amlogic-s9xxx-openwrt" 3 | description: "Support Amlogic, Rockchip and Allwinner boxes." 4 | inputs: 5 | mode: 6 | description: "Select script." 7 | required: false 8 | default: "ophub" 9 | openwrt_path: 10 | description: "Select armsr-armv8 file path." 11 | required: false 12 | default: "openwrt/bin/targets/*/*/*rootfs.tar.gz" 13 | openwrt_board: 14 | description: "Select device board." 15 | required: false 16 | default: "all" 17 | kernel_repo: 18 | description: "Select kernel repository." 19 | required: false 20 | default: "ophub/kernel" 21 | kernel_usage: 22 | description: "Set the tags of the stable kernel." 23 | required: false 24 | default: "stable" 25 | openwrt_kernel: 26 | description: "Select kernel version." 27 | required: false 28 | default: "6.1.y_6.12.y" 29 | auto_kernel: 30 | description: "Auto use the latest kernel." 31 | required: false 32 | default: "true" 33 | openwrt_size: 34 | description: "Set the rootfs size(Unit: MiB)." 35 | required: false 36 | default: "" 37 | openwrt_ip: 38 | description: "Set the rootfs IP address." 39 | required: false 40 | default: "192.168.1.1" 41 | builder_name: 42 | description: "Set OpenWrt builder signature." 43 | required: false 44 | default: "" 45 | 46 | runs: 47 | using: "composite" 48 | steps: 49 | - shell: bash 50 | run: | 51 | cd ${{ github.action_path }} 52 | echo -e "ophub package actions path: [ ${PWD} ]" 53 | 54 | openwrt_filename="${{ inputs.openwrt_path }}" 55 | openwrt_savefile="${openwrt_filename##*/}" 56 | openwrt_savepath="openwrt-armsr" 57 | openwrt_outpath="openwrt/out" 58 | echo -e "Get openwrt file input parameters: [ ${openwrt_filename} ]" 59 | [[ -z "${openwrt_filename}" ]] && echo -e "The [ openwrt_path ] variable must be specified." && exit 1 60 | [[ -d "${openwrt_savepath}" ]] || mkdir -p ${openwrt_savepath} 61 | [[ -d "${openwrt_outpath}" ]] || mkdir -p ${openwrt_outpath} 62 | 63 | if [[ "${openwrt_filename}" =~ ^http ]]; then 64 | echo -e "Download file: [ ${openwrt_filename} ]" 65 | curl -fsSL "${openwrt_filename}" -o "${openwrt_savepath}/${openwrt_savefile}" 66 | else 67 | if [[ -z "$(ls ${openwrt_savepath}/${openwrt_savefile} 2>/dev/null)" ]]; then 68 | echo -e "Copy OpenWrt rootfs file: [ ${openwrt_filename} ]" 69 | if [[ "${openwrt_filename}" =~ ^/ ]]; then 70 | cp -vf ${openwrt_filename} ${openwrt_savepath}/ || true 71 | else 72 | cp -vf ${{ github.workspace }}/${openwrt_filename} ${openwrt_savepath}/ || true 73 | fi 74 | else 75 | echo -e "The [ ${openwrt_savepath}/${openwrt_savefile} ] file already exists, skipping." 76 | fi 77 | fi 78 | sync 79 | echo -e "About the [ ${openwrt_savepath} ] directory: \n$(ls -lh ${openwrt_savepath} 2>/dev/null)" 80 | 81 | cd ${{ github.action_path }} 82 | echo -e "Start to make openwrt..." 83 | make_command="" 84 | [[ -n "${{ inputs.openwrt_board }}" ]] && make_command="${make_command} -b ${{ inputs.openwrt_board }}" 85 | [[ -n "${{ inputs.kernel_repo }}" ]] && make_command="${make_command} -r ${{ inputs.kernel_repo }}" 86 | [[ -n "${{ inputs.kernel_usage }}" ]] && make_command="${make_command} -u ${{ inputs.kernel_usage }}" 87 | [[ -n "${{ inputs.openwrt_kernel }}" ]] && make_command="${make_command} -k ${{ inputs.openwrt_kernel }}" 88 | [[ -n "${{ inputs.auto_kernel }}" ]] && make_command="${make_command} -a ${{ inputs.auto_kernel }}" 89 | [[ -n "${{ inputs.openwrt_ip }}" ]] && make_command="${make_command} -p ${{ inputs.openwrt_ip }}" 90 | [[ -n "${{ inputs.openwrt_size }}" ]] && make_command="${make_command} -s ${{ inputs.openwrt_size }}" 91 | [[ -n "${{ inputs.builder_name }}" ]] && make_command="${make_command} -n ${{ inputs.builder_name }}" 92 | sudo ./remake ${make_command} 93 | 94 | cd ${{ github.action_path }} 95 | # Copy OpenWrt rootfs.tar.gz file to the output directory 96 | echo -e "About the [ ${openwrt_savepath} ] directory: \n$(ls -lh ${openwrt_savepath} 2>/dev/null)" 97 | sudo cp -vf ${openwrt_savepath}/${openwrt_savefile} ${openwrt_outpath}/ || true 98 | sync && sleep 3 99 | 100 | cd ${{ github.action_path }} 101 | echo -e "Output environment variables." 102 | echo "PACKAGED_OUTPUTPATH=${PWD}/${openwrt_outpath}" >> ${GITHUB_ENV} 103 | echo "PACKAGED_OUTPUTDATE=$(date +"%m.%d.%H%M")" >> ${GITHUB_ENV} 104 | echo "PACKAGED_STATUS=success" >> ${GITHUB_ENV} 105 | echo -e "PACKAGED_OUTPUTPATH: ${PWD}/${openwrt_outpath}" 106 | echo -e "PACKAGED_OUTPUTDATE: $(date +"%m.%d.%H%M")" 107 | echo -e "PACKAGED_STATUS: success" 108 | echo -e "PACKAGED_OUTPUTPATH files list: \n$(ls -lh ${PWD}/${openwrt_outpath}/ 2>/dev/null)" 109 | 110 | branding: 111 | icon: "terminal" 112 | color: "gray-dark" 113 | -------------------------------------------------------------------------------- /make-openwrt/openwrt-files/common-files/usr/sbin/openwrt-swap: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #======================================================================== 3 | # 4 | # This file is licensed under the terms of the GNU General Public 5 | # License version 2. This program is licensed "as is" without any 6 | # warranty of any kind, whether express or implied. 7 | # 8 | # This file is a part of the make OpenWrt for Amlogic s9xxx tv box 9 | # https://github.com/ophub/amlogic-s9xxx-openwrt 10 | # 11 | # Description: Create swap for openwrt system 12 | # Copyright (C) 2021- https://github.com/ophub/amlogic-s9xxx-openwrt 13 | # 14 | # Command: openwrt-swap 1 15 | # The input parameter unit is GiB, the default is 1 16 | # 17 | #======================================================================= 18 | # 19 | STEPS="[\033[95m STEPS \033[0m]" 20 | INFO="[\033[94m INFO \033[0m]" 21 | SUCCESS="[\033[92m SUCCESS \033[0m]" 22 | OPTIONS="[\033[93m OPTIONS \033[0m]" 23 | ERROR="[\033[91m ERROR \033[0m]" 24 | 25 | # Encountered a serious error, abort the script execution 26 | error_msg() { 27 | echo -e "${ERROR} ${1}" 28 | exit 1 29 | } 30 | 31 | # Check disk 32 | do_checkdisk() { 33 | # Find the partition where root is located 34 | ROOT_PTNAME="$(df -h /boot | tail -n1 | awk '{print $1}' | awk -F '/' '{print $3}')" 35 | [[ -z "${ROOT_PTNAME}" ]] && error_msg "Cannot find the partition corresponding to the root file system!" 36 | 37 | # Find the disk where the partition is located, supporting multi-digit partition numbers 38 | case "${ROOT_PTNAME}" in 39 | mmcblk?p[0-9]*) 40 | # Using sed to remove the trailing 'p' and all numbers 41 | # For example, mmcblk0p1 -> mmcblk0 42 | DISK_NAME=$(echo "${ROOT_PTNAME}" | sed -E 's/p[0-9]+$//') 43 | PARTITION_NAME="p" 44 | ;; 45 | [hsv]d[a-z][0-9]*) 46 | # Using sed to remove all trailing numbers 47 | # For example, sda1 -> sda 48 | DISK_NAME=$(echo "${ROOT_PTNAME}" | sed -E 's/[0-9]+$//') 49 | PARTITION_NAME="" 50 | ;; 51 | nvme?n?p[0-9]*) 52 | # Using sed to remove the trailing 'p' and all numbers 53 | # For example, nvme0n1p1 -> nvme0n1 54 | DISK_NAME=$(echo "${ROOT_PTNAME}" | sed -E 's/p[0-9]+$//') 55 | PARTITION_NAME="p" 56 | ;; 57 | *) 58 | error_msg "Unable to recognize the disk type of ${ROOT_PTNAME}!" 59 | ;; 60 | esac 61 | 62 | PARTITION_PATH="/mnt/${DISK_NAME}${PARTITION_NAME}4" 63 | available_space="$(df -Tk ${PARTITION_PATH} | grep '/dev/' | awk '{print $5}' | echo $(($(xargs) / 1024 / 1024)))" 64 | if [[ -z "$(echo "${available_space}" | sed -n "/^[0-9]\+$/p")" ]]; then 65 | error_msg "The path is not available, the remaining space cannot be obtained." 66 | fi 67 | if [[ "${available_space}" -lt "${swap_gb}" ]]; then 68 | error_msg "The remaining space is [ ${available_space} ] GiB, and [ ${swap_gb} ] GiB swap cannot be created." 69 | fi 70 | 71 | SWAP_PATH="${PARTITION_PATH}/.swap" 72 | mkdir -p ${SWAP_PATH} && sync 73 | echo -e "${INFO} Prepare to create [ ${swap_gb} ] GiB swap in the [ ${SWAP_PATH} ] directory." 74 | } 75 | 76 | # delete current swap 77 | delete_current_swap() { 78 | echo -e "${STEPS} Current swap size is: [ ${1} ] bytes, start to delete..." 79 | current_swap_file="$(cat /proc/swaps | sed -n '$p' | awk '{print $1}' | echo $(xargs))" 80 | swapoff ${current_swap_file} 2>/dev/null && sync 81 | echo -e "${SUCCESS} Delete successfully!" 82 | } 83 | 84 | # create new swap 85 | create_the_swap() { 86 | echo -e "${STEPS} Start creating a new swap..." 87 | ROOTFS_TYPE="$(df -hT ${SWAP_PATH} | tail -n1 | awk '{print $2}')" 88 | echo -e "${INFO} The swap size is [ ${swap_gb} ] GiB, partition types is [ ${ROOTFS_TYPE} ], Please wait..." 89 | 90 | # create swapfile 91 | dd if="/dev/zero" of="${SWAP_PATH}/swapfile" bs="1024" count="$((1048576 * ${swap_gb}))" conv="fsync" 92 | chmod 600 ${SWAP_PATH}/swapfile 93 | mkswap ${SWAP_PATH}/swapfile 94 | swap_loopdev="$(losetup -f)" 95 | losetup ${swap_loopdev} ${SWAP_PATH}/swapfile 96 | swapon ${swap_loopdev} 97 | # Set up automatic mount at boot 98 | sed -i '/swapfile/d' /etc/fstab 99 | echo "${SWAP_PATH}/swapfile none swap defaults 0 0" >>/etc/fstab 100 | 101 | sync && sleep 3 102 | echo -e "${INFO} Current swap: \n$(cat /proc/swaps)" 103 | echo -e "${SUCCESS} Created successfully!" 104 | } 105 | 106 | # Check swap 107 | do_checkswap() { 108 | # Set the swap size in GiB 109 | my_swap_gb="${1}" 110 | format_gb="$(echo "${my_swap_gb}" | awk -F "." '{print $1}')" 111 | if [[ -n "$(echo "${format_gb}" | sed -n "/^[0-9]\+$/p")" ]]; then 112 | swap_gb="${format_gb}" 113 | else 114 | swap_gb="1" 115 | fi 116 | 117 | # Check disk 118 | do_checkdisk 119 | 120 | # manage swap 121 | current_swap="$(free -m | sed -n '$p' | awk '{print $2}' | echo $(xargs))" 122 | if [[ "${current_swap}" -ne "0" ]]; then 123 | delete_current_swap ${current_swap} 124 | create_the_swap ${swap_gb} 125 | else 126 | create_the_swap ${swap_gb} 127 | fi 128 | exit 0 129 | } 130 | 131 | echo -e "${STEPS} Welcome to use swap management tool." 132 | # Check script permission 133 | [[ -x "/usr/sbin/openwrt-swap" ]] || error_msg "Please grant execution permission: [ chmod +x /usr/sbin/openwrt-swap ]" 134 | # Check swap 135 | do_checkswap "${@}" 136 | -------------------------------------------------------------------------------- /make-openwrt/openwrt-files/common-files/etc/custom_service/start_service.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #======================================================================================== 3 | # 4 | # This file is licensed under the terms of the GNU General Public 5 | # License version 2. This program is licensed "as is" without any 6 | # warranty of any kind, whether express or implied. 7 | # 8 | # This file is a part of the make OpenWrt for Amlogic, Rockchip and Allwinner 9 | # https://github.com/ophub/amlogic-s9xxx-openwrt 10 | # 11 | # Function: Customize the startup script, adding content as needed. 12 | # Dependent script: /etc/rc.local 13 | # File path: /etc/custom_service/start_service.sh 14 | # 15 | # Version: 1.1 16 | # 17 | #======================================================================================== 18 | 19 | # A helper function for logging with a timestamp. 20 | custom_log="/tmp/ophub_start_service.log" 21 | log_message() { 22 | echo "[$(date +"%Y.%m.%d.%H:%M:%S")] $1" >>"${custom_log}" 23 | } 24 | 25 | # Clear previous log and start new session. 26 | log_message "Start the custom service..." 27 | 28 | # System Identification 29 | # Set the release check file to identify the device type. 30 | ophub_release_file="/etc/ophub-release" 31 | FDT_FILE="" # Initialize FDT_FILE to be empty. 32 | 33 | [[ -f "${ophub_release_file}" ]] && { FDT_FILE="$(grep -oE 'meson.*dtb' "${ophub_release_file}")"; } 34 | [[ -z "${FDT_FILE}" && -f "/boot/uEnv.txt" ]] && { FDT_FILE="$(grep -E '^FDT=.*\.dtb$' /boot/uEnv.txt | sed -E 's#.*/##')"; } 35 | [[ -z "${FDT_FILE}" && -f "/boot/armbianEnv.txt" ]] && { FDT_FILE="$(grep -E '^fdtfile=.*\.dtb$' /boot/armbianEnv.txt | sed -E 's#.*/##')"; } 36 | log_message "Detected FDT file: ${FDT_FILE:-'not found'}" 37 | 38 | # Find the partition where the root filesystem is located. 39 | ROOT_PTNAME="$(df -h /boot | tail -n1 | awk '{print $1}' | awk -F '/' '{print $3}')" 40 | PARTITION_PATH="" 41 | if [[ -n "${ROOT_PTNAME}" ]]; then 42 | log_message "Detected root partition name: ${ROOT_PTNAME}" 43 | # Find the disk where the partition is located, supporting multi-digit partition numbers 44 | case "${ROOT_PTNAME}" in 45 | mmcblk?p[0-9]*) 46 | # Using sed to remove the trailing 'p' and all numbers 47 | # For example, mmcblk0p1 -> mmcblk0 48 | DISK_NAME=$(echo "${ROOT_PTNAME}" | sed -E 's/p[0-9]+$//') 49 | PARTITION_NAME="p" 50 | ;; 51 | [hsv]d[a-z][0-9]*) 52 | # Using sed to remove all trailing numbers 53 | # For example, sda1 -> sda 54 | DISK_NAME=$(echo "${ROOT_PTNAME}" | sed -E 's/[0-9]+$//') 55 | PARTITION_NAME="" 56 | ;; 57 | nvme?n?p[0-9]*) 58 | # Using sed to remove the trailing 'p' and all numbers 59 | # For example, nvme0n1p1 -> nvme0n1 60 | DISK_NAME=$(echo "${ROOT_PTNAME}" | sed -E 's/p[0-9]+$//') 61 | PARTITION_NAME="p" 62 | ;; 63 | *) 64 | DISK_NAME="" 65 | PARTITION_NAME="" 66 | log_message "Warning: Unrecognized root partition format '${ROOT_PTNAME}'." 67 | ;; 68 | esac 69 | 70 | if [[ -n "${DISK_NAME}" ]]; then 71 | # The 4th partition is assumed for swap/data. 72 | PARTITION_PATH="/mnt/${DISK_NAME}${PARTITION_NAME}4" 73 | log_message "Derived disk name: ${DISK_NAME}. Target data partition path: ${PARTITION_PATH}" 74 | fi 75 | else 76 | log_message "Error: Could not determine root partition." 77 | fi 78 | 79 | # Add network performance optimization 80 | if [[ -x "/usr/sbin/balethirq.pl" ]]; then 81 | (perl /usr/sbin/balethirq.pl 2>/dev/null) || true 82 | log_message "Network optimization service (balethirq.pl) execution attempted." 83 | fi 84 | 85 | # Led display control 86 | openvfd_enable="no" 87 | openvfd_boxid="15" 88 | if [[ "${openvfd_enable}" == "yes" && -n "${openvfd_boxid}" && -x "/usr/sbin/openwrt-openvfd" ]]; then 89 | (openwrt-openvfd "${openvfd_boxid}") || true 90 | log_message "OpenVFD service execution attempted." 91 | fi 92 | 93 | # For vplus(Allwinner h6) led color lights 94 | if [[ -x "/usr/bin/rgb-vplus" ]]; then 95 | rgb-vplus --RedName=RED --GreenName=GREEN --BlueName=BLUE & 96 | log_message "Vplus RGB LED service started in background." 97 | fi 98 | 99 | # For fan control service 100 | if [[ -x "/usr/bin/pwm-fan.pl" ]]; then 101 | perl /usr/bin/pwm-fan.pl 2>/dev/null & 102 | log_message "Fan control service (pwm-fan.pl) started in background." 103 | fi 104 | 105 | # For oes(A311d) SATA LED status monitoring 106 | if [[ -x "/usr/bin/oes_sata_leds.sh" ]]; then 107 | /usr/bin/oes_sata_leds.sh >/var/log/oes-sata-leds.log 2>&1 & 108 | log_message "SATA status check service (oes_sata_leds.sh) started in background." 109 | fi 110 | 111 | # Automatic expansion of the third and fourth partitions 112 | todo_rootfs_resize="/root/.todo_rootfs_resize" 113 | if [[ -f "${todo_rootfs_resize}" && "$(cat "${todo_rootfs_resize}" 2>/dev/null | xargs)" == "yes" ]]; then 114 | (openwrt-tf 2>/dev/null) || true 115 | log_message "Automatic partition expansion (openwrt-tf) attempted." 116 | fi 117 | 118 | # Set swap space 119 | if [[ -n "${PARTITION_PATH}" && -d "${PARTITION_PATH}" ]]; then 120 | swap_check_file="${PARTITION_PATH}/.swap/swapfile" 121 | if [[ -f "${swap_check_file}" ]]; then 122 | log_message "Swap file found at ${swap_check_file}. Attempting to enable." 123 | 124 | # 'local' keyword removed, as we are in the main script body. 125 | swap_loopdev="$(losetup -f)" 126 | if [[ -z "${swap_loopdev}" ]]; then 127 | log_message "Error: Could not find a free loop device. Skipping swap setup." 128 | else 129 | # Only proceed if a loop device was found. 130 | # The '&&' ensures that 'swapon' is only attempted if 'losetup' succeeds. 131 | if losetup "${swap_loopdev}" "${swap_check_file}" && swapon "${swap_loopdev}"; then 132 | log_message "Swap file enabled successfully on ${swap_loopdev}." 133 | else 134 | # If the chain fails at any point, log the error and clean up. 135 | log_message "Error: Failed to setup swap on ${swap_loopdev}. Cleaning up..." 136 | losetup -d "${swap_loopdev}" 2>/dev/null # Attempt to detach the loop device. 137 | fi 138 | fi 139 | fi 140 | else 141 | log_message "Warning: Swap partition path '${PARTITION_PATH}' does not exist." 142 | fi 143 | 144 | # Finalization 145 | log_message "All custom services have been processed." 146 | -------------------------------------------------------------------------------- /make-openwrt/openwrt-files/common-files/usr/sbin/openwrt-tf: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #=========================================================================== 3 | # 4 | # This file is licensed under the terms of the GNU General Public 5 | # License version 2. This program is licensed "as is" without any 6 | # warranty of any kind, whether express or implied. 7 | # 8 | # This file is a part of the make OpenWrt for Amlogic s9xxx tv box 9 | # https://github.com/ophub/amlogic-s9xxx-openwrt 10 | # 11 | # Description: Create TF/SD/USB remaining space partition 12 | # Copyright (C) 2021- https://github.com/unifreq/openwrt_packit 13 | # Copyright (C) 2021- https://github.com/ophub/amlogic-s9xxx-openwrt 14 | # 15 | # Command: openwrt-tf 16 | # 17 | #========================= Set default parameters =========================== 18 | # 19 | # Automatically expand file 20 | todo_rootfs_resize="/root/.todo_rootfs_resize" 21 | # 22 | # Set font color 23 | STEPS="[\033[95m STEPS \033[0m]" 24 | INFO="[\033[94m INFO \033[0m]" 25 | TIPS="[\033[93m TIPS \033[0m]" 26 | SUCCESS="[\033[92m SUCCESS \033[0m]" 27 | OPTIONS="[\033[93m OPTIONS \033[0m]" 28 | ERROR="[\033[91m ERROR \033[0m]" 29 | # 30 | #=========================================================================== 31 | 32 | # Encountered a serious error, abort the script execution 33 | error_msg() { 34 | echo -e "${ERROR} ${1}" 35 | exit 1 36 | } 37 | 38 | # Check disk 39 | do_checkdisk() { 40 | # Find the partition where root is located 41 | ROOT_PTNAME="$(df -h /boot | tail -n1 | awk '{print $1}' | awk -F '/' '{print $3}')" 42 | [[ -z "${ROOT_PTNAME}" ]] && error_msg "Cannot find the partition corresponding to the root file system!" 43 | 44 | # Find the disk where the partition is located, supporting multi-digit partition numbers 45 | case "${ROOT_PTNAME}" in 46 | mmcblk?p[0-9]*) 47 | # Using sed to remove the trailing 'p' and all numbers 48 | # For example, mmcblk0p1 -> mmcblk0 49 | DISK_NAME=$(echo "${ROOT_PTNAME}" | sed -E 's/p[0-9]+$//') 50 | PT_PRE="${DISK_NAME}p" 51 | LB_PRE="MMC_" 52 | ;; 53 | [hsv]d[a-z][0-9]*) 54 | # Using sed to remove all trailing numbers 55 | # For example, sda1 -> sda 56 | DISK_NAME=$(echo "${ROOT_PTNAME}" | sed -E 's/[0-9]+$//') 57 | PT_PRE="${DISK_NAME}" 58 | LB_PRE="USB_" 59 | ;; 60 | nvme?n?p[0-9]*) 61 | # Using sed to remove the trailing 'p' and all numbers 62 | # For example, nvme0n1p1 -> nvme0n1 63 | DISK_NAME=$(echo "${ROOT_PTNAME}" | sed -E 's/p[0-9]+$//') 64 | PT_PRE="${DISK_NAME}p" 65 | LB_PRE="NVME_" 66 | ;; 67 | *) 68 | error_msg "Unable to recognize the disk type of ${ROOT_PTNAME}!" 69 | ;; 70 | esac 71 | echo -e "${INFO} OpenWrt running: [ ${LB_PRE:0:-1} - /dev/${DISK_NAME} ]." 72 | 73 | # Check whether partition is required 74 | [[ -n "$(lsblk -l -o NAME | grep -oE "^${PT_PRE}4")" ]] && { 75 | # Delete auto-extending file 76 | rm -f ${todo_rootfs_resize} 77 | echo -e "${TIPS} Partitioned, no operation required." 78 | exit 0 79 | } 80 | 81 | sync && sleep 3 82 | } 83 | 84 | # Create the 3rd and 4th partition 85 | create_new_partition() { 86 | # Generate New UUID 87 | echo -e "${STEPS} Start generating new partition UUID..." 88 | ROOTFS_UUID="$(cat /proc/sys/kernel/random/uuid)" 89 | [[ -z "${ROOTFS_UUID}" ]] && ROOTFS_UUID="$(uuidgen)" 90 | SHARED_UUID="$(cat /proc/sys/kernel/random/uuid)" 91 | [[ -z "${SHARED_UUID}" ]] && SHARED_UUID="$(uuidgen)" 92 | [[ -z "${ROOTFS_UUID}" || -z "${SHARED_UUID}" ]] && error_msg "The new UUID is invalid, cannot continue." 93 | 94 | # Repair disk size 95 | echo -e "${INFO} Start repairing hard disk size..." 96 | printf 'f\n' | parted ---pretend-input-tty /dev/${DISK_NAME} unit MiB print || repair_status="no" 97 | [[ "${repair_status}" == "no" ]] && error_msg "Disk size repair failed, stop partitioning." 98 | 99 | # Calculate partition positions 100 | echo -e "${INFO} Start calculating partition location..." 101 | END_P2="$(fdisk -l | grep "/dev/${PT_PRE}2" | sed -n '$p' | awk '{print $3}' | xargs)" 102 | [[ -z "${END_P2}" || -z "$(echo ${END_P2} | sed -n "/^[0-9]\+$/p")" ]] && error_msg "Unable to get starting position!" 103 | START_P3="$(((END_P2 + 1) / 2048 + 1))" 104 | 105 | # Create the partition 106 | echo -e "${INFO} Start creating new partitions..." 107 | ROOTFS_MB="1024" 108 | parted /dev/${DISK_NAME} mkpart primary btrfs $((START_P3))MiB $((START_P3 + ROOTFS_MB - 1))MiB 2>/dev/null 109 | parted /dev/${DISK_NAME} mkpart primary btrfs $((START_P3 + ROOTFS_MB))MiB 100% 2>/dev/null 110 | 111 | echo -e "${INFO} Start formatting new partition..." 112 | # Format the third partition 113 | mkdir -p /mnt/${PT_PRE}3 114 | umount -f /dev/${PT_PRE}3 2>/dev/null 115 | mkfs.btrfs -f -U ${ROOTFS_UUID} -L "${LB_PRE}ROOTFS2" -m single "/dev/${PT_PRE}3" >/dev/null 2>&1 116 | mount | grep "/mnt/${PT_PRE}3" >/dev/null || mount -t btrfs -o compress=zstd:6 "/dev/${PT_PRE}3" "/mnt/${PT_PRE}3" 117 | 118 | # Format the fourth partition 119 | mkdir -p /mnt/${PT_PRE}4 120 | umount -f /dev/${PT_PRE}4 2>/dev/null 121 | mkfs.btrfs -f -U ${SHARED_UUID} -L "${LB_PRE}SHARED" -m single "/dev/${PT_PRE}4" >/dev/null 2>&1 122 | mount | grep "/mnt/${PT_PRE}4" >/dev/null || mount -t btrfs -o compress=zstd:6 "/dev/${PT_PRE}4" "/mnt/${PT_PRE}4" 123 | 124 | # Adjust docker data storage location 125 | [[ -f "/etc/init.d/dockerd" ]] && { 126 | echo -e "${INFO} Start adjusting docker settings..." 127 | /etc/init.d/dockerd stop 2>/dev/null 128 | /etc/init.d/dockerd disable 2>/dev/null 129 | rm -rf "/opt/docker" 2>/dev/null 130 | mkdir -p /mnt/${PT_PRE}4/docker 131 | ln -sf "/mnt/${PT_PRE}4/docker/" "/opt/docker" 132 | 133 | if [[ -f "/etc/config/dockerd" ]]; then 134 | uci set dockerd.@globals[0].data_root="/mnt/${PT_PRE}4/docker/" 135 | uci commit dockerd 136 | fi 137 | 138 | mkdir -p /etc/docker 139 | cat >/etc/docker/daemon.json </dev/null 157 | /etc/init.d/dockerd enable 2>/dev/null 158 | } 159 | 160 | # Delete auto-extending file 161 | rm -f ${todo_rootfs_resize} 162 | echo -e "${SUCCESS} Create partition successfully." 163 | } 164 | 165 | # Show welcome message 166 | echo -e "${STEPS} Welcome to Partition Creation Tool." 167 | 168 | do_checkdisk 169 | create_new_partition 170 | -------------------------------------------------------------------------------- /config/docker/make_docker_image.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #================================================================================================ 3 | # 4 | # This file is licensed under the terms of the GNU General Public 5 | # License version 2. This program is licensed "as is" without any 6 | # warranty of any kind, whether express or implied. 7 | # 8 | # This file is a part of the make OpenWrt 9 | # https://github.com/ophub/amlogic-s9xxx-openwrt 10 | # 11 | # Description: Creating a Docker Image 12 | # Copyright (C) 2021~ https://github.com/unifreq/openwrt_packit 13 | # Copyright (C) 2021~ https://github.com/ophub/amlogic-s9xxx-openwrt 14 | # 15 | # Command: ./config/docker/make_docker_image.sh 16 | # 17 | #======================================== Functions list ======================================== 18 | # 19 | # error_msg : Output error message 20 | # check_depends : Check dependencies 21 | # find_openwrt : Find OpenWrt file (openwrt/*rootfs.tar.gz) 22 | # adjust_settings : Adjust related file settings 23 | # make_dockerimg : make docker image 24 | # 25 | #================================ Set make environment variables ================================ 26 | # 27 | # Set default parameters 28 | current_path="${PWD}" 29 | openwrt_path="${current_path}/openwrt" 30 | openwrt_rootfs_file="*rootfs.tar.gz" 31 | docker_rootfs_file="openwrt-docker-armsr-armv8-default-rootfs.tar.gz" 32 | docker_path="${current_path}/config/docker" 33 | make_path="${current_path}/make-openwrt" 34 | common_files="${make_path}/openwrt-files/common-files" 35 | tmp_path="${current_path}/tmp" 36 | out_path="${current_path}/out" 37 | 38 | # Set default parameters 39 | STEPS="[\033[95m STEPS \033[0m]" 40 | INFO="[\033[94m INFO \033[0m]" 41 | SUCCESS="[\033[92m SUCCESS \033[0m]" 42 | WARNING="[\033[93m WARNING \033[0m]" 43 | ERROR="[\033[91m ERROR \033[0m]" 44 | # 45 | #================================================================================================ 46 | 47 | error_msg() { 48 | echo -e "${ERROR} ${1}" 49 | exit 1 50 | } 51 | 52 | check_depends() { 53 | # Check the necessary dependencies 54 | is_dpkg="0" 55 | dpkg_packages=("tar" "gzip") 56 | i="1" 57 | for package in ${dpkg_packages[*]}; do 58 | [[ -n "$(dpkg -l | awk '{print $2}' | grep -w "^${package}$" 2>/dev/null)" ]] || is_dpkg="1" 59 | let i++ 60 | done 61 | 62 | # Install missing packages 63 | if [[ "${is_dpkg}" -eq "1" ]]; then 64 | echo -e "${STEPS} Start installing the necessary dependencies..." 65 | sudo apt-get update 66 | sudo apt-get install -y ${dpkg_packages[*]} 67 | [[ "${?}" -ne "0" ]] && error_msg "Dependency installation failed." 68 | fi 69 | } 70 | 71 | find_openwrt() { 72 | cd ${current_path} 73 | echo -e "${STEPS} Start searching for OpenWrt file..." 74 | 75 | # Find whether the OpenWrt file exists 76 | openwrt_file_name="$(ls ${openwrt_path}/${openwrt_rootfs_file} 2>/dev/null | head -n 1 | awk -F "/" '{print $NF}')" 77 | if [[ -n "${openwrt_file_name}" ]]; then 78 | echo -e "${INFO} OpenWrt file: [ ${openwrt_file_name} ]" 79 | else 80 | error_msg "There is no [ ${openwrt_rootfs_file} ] file in the [ ${openwrt_path} ] directory." 81 | fi 82 | 83 | # Check whether the Dockerfile exists 84 | [[ -f "${docker_path}/Dockerfile" ]] || error_msg "Missing Dockerfile." 85 | } 86 | 87 | adjust_settings() { 88 | cd ${current_path} 89 | echo -e "${STEPS} Start adjusting OpenWrt file settings..." 90 | 91 | echo -e "${INFO} Unpack Openwrt." 92 | rm -rf ${tmp_path} && mkdir -p ${tmp_path} 93 | tar -xzf ${openwrt_path}/${openwrt_file_name} -C ${tmp_path} 94 | 95 | # Remove unused files 96 | echo -e "${INFO} Remove useless files." 97 | rm -rf ${tmp_path}/lib/firmware/* 98 | rm -rf ${tmp_path}/lib/modules/* 99 | rm -f ${tmp_path}/root/.todo_rootfs_resize 100 | find ${tmp_path} -name '*.rej' -exec rm {} \; 101 | find ${tmp_path} -name '*.orig' -exec rm {} \; 102 | # Remove Amlogic Service 103 | rm -f ${tmp_path}/usr/lib/lua/luci/controller/amlogic.lua 104 | rm -rf ${tmp_path}/usr/lib/lua/luci/model/cbi/amlogic 105 | rm -rf ${tmp_path}/usr/share/amlogic 106 | rm -f ${tmp_path}/usr/sbin/openwrt-*-* 107 | rm -f ${tmp_path}/etc/init.d/amlogic 108 | # Remove docker Service 109 | rm -f ${tmp_path}/usr/lib/lua/luci/controller/docker* 110 | rm -rf ${tmp_path}/usr/lib/lua/luci/model/cbi/docker* 111 | rm -f ${tmp_path}/usr/lib/lua/luci/model/docker* 112 | rm -f ${tmp_path}/usr/bin/docker* 113 | rm -f ${tmp_path}/etc/init.d/docker* 114 | 115 | # Turn off hw_flow by default 116 | [[ -f "${tmp_path}/etc/config/turboacc" ]] && { 117 | echo -e "${INFO} Adjust turboacc settings." 118 | sed -i "s|option hw_flow.*|option hw_flow '0'|g" ${tmp_path}/etc/config/turboacc 119 | sed -i "s|option sw_flow.*|option sw_flow '0'|g" ${tmp_path}/etc/config/turboacc 120 | } 121 | 122 | # Modify the cpu mode to schedutil 123 | [[ -f "${tmp_path}/etc/config/cpufreq" ]] && { 124 | echo -e "${INFO} Adjust cpufreq settings" 125 | sed -i "s/ondemand/schedutil/g" ${tmp_path}/etc/config/cpufreq 126 | } 127 | 128 | # Relink the kmod program 129 | [[ -f "${common_files}/sbin/kmod" ]] && ( 130 | echo -e "${INFO} Adjust kmod settings." 131 | cp -f ${common_files}/sbin/kmod ${tmp_path}/sbin/kmod 132 | chmod +x ${tmp_path}/sbin/kmod 133 | kmod_list="depmod insmod lsmod modinfo modprobe rmmod" 134 | for ki in ${kmod_list}; do 135 | rm -f ${tmp_path}/sbin/${ki} 136 | ln -sf kmod ${tmp_path}/sbin/${ki} 137 | done 138 | ) 139 | 140 | # Add version information to the banner 141 | [[ -f "${common_files}/etc/banner" ]] && { 142 | cp -f ${common_files}/etc/banner ${tmp_path}/etc/banner 143 | echo -e "${INFO} Adjust banner settings." 144 | echo " Board: docker | Production Date: $(date +%Y-%m-%d)" >>${tmp_path}/etc/banner 145 | echo "───────────────────────────────────────────────────────────────────────" >>${tmp_path}/etc/banner 146 | } 147 | } 148 | 149 | make_dockerimg() { 150 | cd ${tmp_path} 151 | echo -e "${STEPS} Start making docker image..." 152 | 153 | # Make docker image 154 | tar -czf ${docker_rootfs_file} * 155 | [[ "${?}" -eq "0" ]] || error_msg "Docker image creation failed." 156 | 157 | # Move the docker image to the output directory 158 | rm -rf ${out_path} && mkdir -p ${out_path} 159 | mv -f ${docker_rootfs_file} ${out_path} 160 | [[ "${?}" -eq "0" ]] || error_msg "Docker image move failed." 161 | echo -e "${INFO} Docker image packaging succeeded." 162 | 163 | cd ${current_path} 164 | 165 | # Add Dockerfile 166 | cp -f ${docker_path}/Dockerfile ${out_path} 167 | [[ "${?}" -eq "0" ]] || error_msg "Dockerfile addition failed." 168 | echo -e "${INFO} Dockerfile added successfully." 169 | 170 | # Remove temporary directory 171 | rm -rf ${tmp_path} 172 | 173 | sync && sleep 3 174 | echo -e "${INFO} Docker files list: \n$(ls -lh ${out_path})" 175 | echo -e "${SUCCESS} Docker image successfully created." 176 | } 177 | 178 | # Show welcome message 179 | echo -e "${STEPS} Welcome to the Docker Image Maker Tool." 180 | echo -e "${INFO} Make path: [ ${PWD} ]" 181 | # 182 | check_depends 183 | find_openwrt 184 | adjust_settings 185 | make_dockerimg 186 | -------------------------------------------------------------------------------- /make-openwrt/openwrt-files/common-files/usr/sbin/openwrt-openvfd: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #========================================================================== 3 | # 4 | # This file is licensed under the terms of the GNU General Public 5 | # License version 2. This program is licensed "as is" without any 6 | # warranty of any kind, whether express or implied. 7 | # 8 | # This file is a part of the Armbian for Amlogic TV Boxes 9 | # https://github.com/ophub/amlogic-s9xxx-openwrt 10 | # 11 | # Description: LED display control 12 | # Copyright (C) 2022- https://github.com/unifreq/openwrt_packit 13 | # Copyright (C) 2022- https://github.com/ophub/amlogic-s9xxx-openwrt 14 | # 15 | # Function : Command 16 | # Default : openwrt-openvfd 17 | # One-key to open : openwrt-openvfd 18 | # One-key to stop : openwrt-openvfd 0 19 | # Update config : openwrt-openvfd -u 20 | # 21 | #============================= Functions list ============================= 22 | # 23 | # do_start : Turn on the led screen display 24 | # do_stop : Turn off the led screen display 25 | # do_update_conf : Update openvfd config files 26 | # do_select_box : Call config based on options 27 | # 28 | #========================================================================== 29 | # 30 | # Openvfd files storage path 31 | openvfd_path="/usr/share/openvfd" 32 | openvfd_service="${openvfd_path}/vfdservice" 33 | # The openvfd files download repository 34 | openvfd_repo="https://github.com/ophub/amlogic-s9xxx-armbian.git" 35 | openvfd_dir="build-armbian/armbian-files/platform-files/amlogic/rootfs/usr/share/openvfd" 36 | # 37 | # Set font color 38 | STEPS="[\033[95m STEPS \033[0m]" 39 | INFO="[\033[94m INFO \033[0m]" 40 | SUCCESS="[\033[92m SUCCESS \033[0m]" 41 | OPTIONS="[\033[93m OPTIONS \033[0m]" 42 | ERROR="[\033[91m ERROR \033[0m]" 43 | # 44 | #========================================================================== 45 | 46 | # Show error message 47 | error_msg() { 48 | echo -e "${ERROR} ${1}" 49 | exit 1 50 | } 51 | 52 | # Update openvfd config files 53 | do_update_conf() { 54 | echo -e "${STEPS} Start updating the openfvd config files..." 55 | 56 | # Check dependencies 57 | if command -v opkg >/dev/null 2>&1; then 58 | [[ -z "$(opkg list-installed | awk '{print $1}' | grep -w '^git$')" ]] && opkg update && opkg install --force-reinstall git 59 | elif command -v apk >/dev/null 2>&1; then 60 | [[ -z "$(apk list --installed | grep '^git-')" ]] && apk update && apk add --force-overwrite --allow-untrusted git 61 | else 62 | error_msg "Package manager not found, please install git manually." 63 | fi 64 | 65 | # Get the latest scripts 66 | git_tmp_path="$(mktemp -d)" 67 | cd ${git_tmp_path} 68 | git init --quiet 69 | git config core.sparseCheckout true 70 | echo "${openvfd_dir}/*" >>.git/info/sparse-checkout 71 | git remote add origin ${openvfd_repo} 72 | git pull --quiet --depth=1 origin main 73 | [[ "${?}" -ne "0" ]] && error_msg "Download [ ${openvfd_repo} ] scripts failed." 74 | 75 | # Update related files 76 | mkdir -p ${openvfd_path} 77 | cp -af --no-preserve=ownership ${git_tmp_path}/${openvfd_dir}/* ${openvfd_path} 78 | [[ "${?}" -ne "0" ]] && error_msg "Sync [ ${openvfd_repo} ] scripts failed." 79 | chmod +x ${openvfd_path}/vfdservice 80 | 81 | # Clean up temporary files 82 | rm -rf ${git_tmp_path} 2>/dev/null 83 | 84 | sync && sleep 3 85 | echo -e "${SUCCESS} Openfvd config files update completed." 86 | exit 0 87 | } 88 | 89 | # Turn on the led screen display 90 | do_start() { 91 | echo -e "${STEPS} Start the led screen display..." 92 | 93 | # Check config files and services 94 | conf_file="${openvfd_path}/conf/${1}" 95 | if [[ -s "${conf_file}" && -x "${openvfd_service}" ]]; then 96 | source "${conf_file}" 2>/dev/null 97 | echo -e "${INFO} Using LED Profiles: ${conf_file}" 98 | else 99 | error_msg "The LED profile [ ${conf_file} ] does not exist!" 100 | fi 101 | 102 | modprobe openvfd vfd_gpio_clk=${vfd_gpio_clk} \ 103 | vfd_gpio_dat=${vfd_gpio_dat} \ 104 | vfd_gpio_stb=${vfd_gpio_stb:-0,0,0xFF} \ 105 | vfd_gpio0=${vfd_gpio0:-0,0,0xFF} \ 106 | vfd_gpio1=${vfd_gpio1:-0,0,0xFF} \ 107 | vfd_gpio2=${vfd_gpio2:-0,0,0xFF} \ 108 | vfd_gpio3=${vfd_gpio3:-0,0,0xFF} \ 109 | vfd_gpio_protocol=${vfd_gpio_protocol:-0,0} \ 110 | vfd_chars=${vfd_chars} vfd_dot_bits=${vfd_dot_bits} \ 111 | vfd_display_type=${vfd_display_type} 112 | 113 | "${openvfd_service}" & 114 | 115 | trap "killall ${openvfd_service}; rmmod openvfd; exit" 2 3 15 116 | 117 | if [[ -n "${functions}" ]]; then 118 | for func in ${functions}; do 119 | echo -e "${INFO} turn led ${func} on ... " 120 | echo "${func}" >/sys/class/leds/openvfd/led_on 2>/dev/null 121 | done 122 | fi 123 | 124 | echo -e "${SUCCESS} Enable LED display!" 125 | exit 0 126 | } 127 | 128 | # Turn off the led screen display 129 | do_stop() { 130 | echo -e "${STEPS} Start to turn off the led screen display..." 131 | 132 | killall -9 vfdservice 2>/dev/null 133 | rmmod openvfd -f 2>/dev/null 134 | 135 | echo -e "${SUCCESS} Disable LED display!" 136 | exit 0 137 | } 138 | 139 | # Call config based on options 140 | do_select_box() { 141 | case "${1}" in 142 | 11 | x96max) do_start x96max.conf ;; 143 | 12 | x96maxplus) do_start x96maxplus.conf ;; 144 | 13 | x96air) do_start x96air.conf ;; 145 | 14 | h96max-x3) do_start h96max-x3.conf ;; 146 | 15 | hk1-x3) do_start hk1-x3.conf ;; 147 | 16 | hk1box) do_start hk1box.conf ;; 148 | 17 | tx3) do_start tx3.conf ;; 149 | 18 | tx3-mini) do_start tx3-mini.conf ;; 150 | 19 | t95) do_start t95.conf ;; 151 | 20 | t95z-plus) do_start t95z-plus.conf ;; 152 | 21 | tx9-pro) do_start tx9-pro.conf ;; 153 | 22 | x92) do_start x92.conf ;; 154 | 23 | whale) do_start whale.conf ;; 155 | 99 | diy) do_start diy.conf ;; 156 | 0 | stop) do_stop ;; 157 | 1 | quit) echo "quit!" && exit 0 ;; 158 | *) error_msg "Invalid input!" ;; 159 | esac 160 | } 161 | 162 | # Execute according to the classification of input parameters 163 | case "${1}" in 164 | -u | u | -update | update) 165 | do_update_conf 166 | ;; 167 | [0-9]*) 168 | do_select_box "${1}" 169 | ;; 170 | *) 171 | clear 172 | cat < mmcblk0 26 | DISK_NAME=$(echo "${ROOT_PTNAME}" | sed -E 's/p[0-9]+$//') 27 | PARTITION_NAME="p" 28 | ;; 29 | [hsv]d[a-z][0-9]*) 30 | # Using sed to remove all trailing numbers 31 | # For example, sda1 -> sda 32 | DISK_NAME=$(echo "${ROOT_PTNAME}" | sed -E 's/[0-9]+$//') 33 | PARTITION_NAME="" 34 | ;; 35 | nvme?n?p[0-9]*) 36 | # Using sed to remove the trailing 'p' and all numbers 37 | # For example, nvme0n1p1 -> nvme0n1 38 | DISK_NAME=$(echo "${ROOT_PTNAME}" | sed -E 's/p[0-9]+$//') 39 | PARTITION_NAME="p" 40 | ;; 41 | *) 42 | echo "Unable to recognize the disk type of ${ROOT_PTNAME}!" 43 | ;; 44 | esac 45 | PARTITION_PATH="/mnt/${DISK_NAME}${PARTITION_NAME}4" 46 | fi 47 | 48 | # don't edit below here 49 | function display() { 50 | # $1=name $2=value $3=red_limit $4=minimal_show_limit $5=unit $6=after $7=acs/desc{ 51 | # battery red color is opposite, lower number 52 | if [[ "${1}" == "Battery" ]]; then 53 | local great="<" 54 | else 55 | local great=">" 56 | fi 57 | 58 | if [[ -n "${2}" && "${2}" > "0" && (("${2%.*}" -ge "${4}")) ]]; then 59 | printf "%-5s%s" "${1}:" 60 | if awk "BEGIN{exit ! (${2} $great ${3})}"; then 61 | echo -ne "\e[0;91m ${2}" 62 | else 63 | echo -ne "\e[0;92m ${2}" 64 | fi 65 | printf "%-1s%s\x1B[0m" "${5}" 66 | printf "%-9s%s\t" "${6}" 67 | return 1 68 | else 69 | printf "%-5s%s" "${1}:" 70 | echo -ne "\e[0;92m ${2}" 71 | printf "%-1s%s\x1B[0m" "${5}" 72 | printf "%-9s%s\t" "${6}" 73 | return 1 74 | fi 75 | } # display 76 | 77 | function get_ip_addresses() { 78 | local ips=() 79 | for f in /sys/class/net/*; do 80 | local intf=$(basename ${f}) 81 | # match only interface names starting with e (Ethernet), br (bridge), w (wireless), r (some Ralink drivers use ra format) 82 | if [[ ${intf} =~ ${SHOW_IP_PATTERN} ]]; then 83 | local tmp=$(ip -4 addr show dev ${intf} | awk '/inet/ {print $2}' | cut -d'/' -f1) 84 | # add both name and IP - can be informative but becomes ugly with long persistent/predictable device names 85 | #[[ -n $tmp ]] && ips+=("$intf: $tmp") 86 | # add IP only 87 | [[ -n "${tmp}" ]] && ips+=("${tmp}") 88 | fi 89 | done 90 | echo "${ips[@]}" 91 | } # get_ip_addresses 92 | 93 | function storage_info() { 94 | # storage info 95 | RootInfo="$(df -h /)" 96 | root_usage="$(awk '/\// {print $(NF-1)}' <<<${RootInfo} | sed 's/%//g')" 97 | root_total="$(awk '/\// {print $(NF-4)}' <<<${RootInfo})" 98 | 99 | # storage info 100 | BootInfo="$(df -h /boot)" 101 | boot_usage="$(awk '/\// {print $(NF-1)}' <<<${BootInfo} | sed 's/%//g')" 102 | boot_total="$(awk '/\// {print $(NF-4)}' <<<${BootInfo})" 103 | 104 | # Get the size of the extended partition 105 | if [[ -d "${PARTITION_PATH}" ]]; then 106 | PartInfo="$(df -h ${PARTITION_PATH})" 107 | data_usage="$(awk '/\// {print $(NF-1)}' <<<${PartInfo} | sed 's/%//g')" 108 | data_total="$(awk '/\// {print $(NF-4)}' <<<${PartInfo})" 109 | fi 110 | } 111 | 112 | function get_data_storage() { 113 | if which lsblk >/dev/null; then 114 | root_name="$(lsblk -l -o NAME,MOUNTPOINT | awk '$2~/^\/$/ {print $1}')" 115 | mmc_name="$(echo ${root_name} | awk '{print substr($1,1,length($1)-2);}')" 116 | if echo ${mmc_name} | grep mmcblk >/dev/null; then 117 | DATA_STORAGE="/mnt/${mmc_name}p4" 118 | fi 119 | fi 120 | } 121 | 122 | # query various systems and send some stuff to the background for overall faster execution. 123 | # Works only with ambienttemp and batteryinfo since A20 is slow enough :) 124 | ip_address="$(get_ip_addresses &)" 125 | get_data_storage 126 | storage_info 127 | critical_load="$((1 + $(grep -c processor /proc/cpuinfo) / 2))" 128 | 129 | # get uptime, logged in users and load in one take 130 | if [[ -x /usr/bin/cpustat ]]; then 131 | time="$(/usr/bin/cpustat -u)" 132 | load="$(/usr/bin/cpustat -l)" 133 | else 134 | UptimeString=$(uptime | tr -d ',') 135 | time="$(awk -F" " '{print $3" "$4}' <<<"${UptimeString}")" 136 | load="$(awk -F"average: " '{print $2}' <<<"${UptimeString}")" 137 | case "${time}" in 138 | 1:*) # 1-2 hours 139 | time="$(awk -F" " '{print $3" h"}' <<<"${UptimeString}")" 140 | ;; 141 | *:*) # 2-24 hours 142 | time="$(awk -F" " '{print $3" h"}' <<<"${UptimeString}")" 143 | ;; 144 | *day) # days 145 | days="$(awk -F" " '{print $3"d"}' <<<"${UptimeString}")" 146 | time="$(awk -F" " '{print $5}' <<<"${UptimeString}")" 147 | time="${days} "$(awk -F":" '{print $1"h "$2"m"}' <<<"${time}") 148 | ;; 149 | esac 150 | fi 151 | 152 | # memory 153 | mem_info="$(LC_ALL=C free -w 2>/dev/null | grep "^Mem" || LC_ALL=C free | grep "^Mem")" 154 | memory_usage="$(awk '{printf("%.0f",(($2-($4+$6))/$2) * 100)}' <<<${mem_info})" 155 | memory_total="$(awk '{printf("%d",$2/1024)}' <<<${mem_info})" 156 | 157 | # swap 158 | swap_info="$(free -m | sed -n '$p' | echo $(xargs))" 159 | swap_usage="$(awk '{printf("%d", $3/$2*100)}' <<<${swap_info} 2>/dev/null || echo 0)" 160 | swap_total="$(awk '{printf("%d", $2/1024)}' <<<${swap_info} 2>/dev/null || echo 0)" 161 | 162 | # cpu temp 163 | if grep -q "ipq40xx" "/etc/openwrt_release"; then 164 | cpu_temp="$(sensors | grep -Eo '\+[0-9]+.+C' | sed ':a;N;$!ba;s/\n/ /g;s/+//g')" 165 | elif [[ -f "/sys/class/hwmon/hwmon0/temp1_input" ]]; then 166 | cpu_temp="$(awk '{ printf("%.1f °C", $0 / 1000) }' /sys/class/hwmon/hwmon0/temp1_input)" 167 | elif [[ -f "/sys/class/thermal/thermal_zone0/temp" ]]; then 168 | cpu_temp="$(awk '{ printf("%.1f °C", $0 / 1000) }' /sys/class/thermal/thermal_zone0/temp)" 169 | else 170 | cpu_temp="50.0 °C" 171 | fi 172 | cpu_tempx="$(echo ${cpu_temp} | sed -e 's/°C//g' -e 's/[ ][ ]*//g')" 173 | [[ "$(echo ${cpu_tempx} | awk -F'.' '{print $1}' | wc -c)" -gt "3" ]] && cpu_tempx="${cpu_tempx:0:2}.0" 174 | 175 | # Architecture 176 | if [[ -x "/usr/bin/cpustat" ]]; then 177 | sys_temp=$(/usr/bin/cpustat -A) 178 | else 179 | sys_temp=$(cat /proc/cpuinfo | grep name | cut -f2 -d: | uniq) 180 | fi 181 | sys_tempx=$(echo ${sys_temp} | sed 's/ / /g') 182 | 183 | # display info 184 | machine_model=$(cat /proc/device-tree/model | tr -d "\000") 185 | printf " Device Model: \x1B[93m%s\x1B[0m" "${machine_model}" 186 | echo "" 187 | printf " Architecture: \x1B[93m%s\x1B[0m" "${sys_tempx}" 188 | echo "" 189 | display " Load Average" "${load%% *}" "${critical_load}" "0" "" "${load#* }" 190 | printf "Uptime: \x1B[92m%s\x1B[0m" "${time}" 191 | echo "" 192 | 193 | display " Ambient Temp" "${cpu_tempx}" "80" "0" "" "°C" 194 | if [[ -x "/usr/bin/cpustat" ]]; then 195 | cpu_freq=$(/usr/bin/cpustat -F1500) 196 | echo -n "CPU Freq: ${cpu_freq}" 197 | else 198 | display "CPU Freq" "${cpu_freq}" "1500" "0" " Mhz" "" 199 | fi 200 | echo "" 201 | 202 | display " Memory Usage" "${memory_usage}" "70" "0" "%" " of ${memory_total}M" 203 | display "Swap Usage" "${swap_usage}" "80" "0" "%" " of ${swap_total}M" 204 | echo "" 205 | 206 | display " Boot Storage" "${boot_usage}" "90" "1" "%" " of ${boot_total}" 207 | display "ROOTFS" "${root_usage}" "90" "1" "%" " of ${root_total}" 208 | echo "" 209 | 210 | if [[ -d "${PARTITION_PATH}" ]]; then 211 | display " Data Storage" "${data_usage}" "90" "0" "%" " of ${data_total}" 212 | printf "IP Addr: \x1B[92m%s\x1B[0m" "${ip_address}" 213 | echo "" 214 | fi 215 | echo "───────────────────────────────────────────────────────────────────────" 216 | -------------------------------------------------------------------------------- /.github/workflows/compile-kernel.yml: -------------------------------------------------------------------------------- 1 | #========================================================================== 2 | # Description: Compile the kernel 3 | # Copyright (C) 2021 https://github.com/unifreq/openwrt_packit 4 | # Copyright (C) 2021 https://github.com/ophub/amlogic-s9xxx-armbian 5 | #========================================================================== 6 | 7 | name: Compile the kernel 8 | 9 | on: 10 | repository_dispatch: 11 | workflow_dispatch: 12 | inputs: 13 | kernel_source: 14 | description: "Select the kernel source" 15 | required: false 16 | default: "unifreq" 17 | type: choice 18 | options: 19 | - unifreq 20 | - ophub 21 | kernel_version: 22 | description: "Select kernel version" 23 | required: false 24 | default: "6.12.y" 25 | type: choice 26 | options: 27 | - 5.10.y 28 | - 5.15.y 29 | - 6.1.y 30 | - 6.6.y 31 | - 6.12.y 32 | kernel_auto: 33 | description: "Auto use the latest kernel" 34 | required: false 35 | default: true 36 | type: boolean 37 | delete_source: 38 | description: "Delete source after compilation" 39 | required: false 40 | default: true 41 | type: boolean 42 | kernel_package: 43 | description: "Select compile package list" 44 | required: false 45 | default: "all" 46 | type: choice 47 | options: 48 | - all 49 | - dtbs 50 | kernel_toolchain: 51 | description: "Select the compilation toolchain" 52 | required: false 53 | default: "gcc" 54 | type: choice 55 | options: 56 | - clang 57 | - gcc 58 | - gcc-14.2 59 | - gcc-14.3 60 | ccache_clear: 61 | description: "Set whether to clear the cache" 62 | required: false 63 | default: false 64 | type: boolean 65 | docker_image: 66 | description: "Select Armbian docker image" 67 | required: false 68 | default: "trixie" 69 | type: choice 70 | options: 71 | - trixie 72 | - bookworm 73 | - noble 74 | - jammy 75 | kernel_sign: 76 | description: "Set the kernel custom signature" 77 | required: false 78 | default: "-ophub" 79 | type: choice 80 | options: 81 | - -ophub 82 | - -yourname 83 | 84 | env: 85 | TZ: Etc/UTC 86 | 87 | jobs: 88 | build: 89 | runs-on: ubuntu-24.04-arm 90 | if: ${{ github.event.repository.owner.id }} == ${{ github.event.sender.id }} 91 | 92 | steps: 93 | - name: Checkout 94 | uses: actions/checkout@v6 95 | 96 | - name: Initialization environment 97 | id: init 98 | env: 99 | DEBIAN_FRONTEND: noninteractive 100 | run: | 101 | docker rmi -f $(docker images -q) 2>/dev/null || true 102 | [[ -n "${AGENT_TOOLSDIRECTORY}" ]] && sudo rm -rf "${AGENT_TOOLSDIRECTORY}" 103 | sudo rm -rf /usr/share/dotnet /usr/local/lib/android 2>/dev/null 104 | sudo swapoff -a 105 | sudo rm -f /swapfile /mnt/swapfile 106 | sudo -E apt-get -y update 107 | sudo -E apt-get -y purge azure-cli ghc* zulu* llvm* firefox google* dotnet* powershell openjdk* mongodb* moby* || true 108 | sudo -E apt-get -y install $(curl -fsSL https://ophub.org/ubuntu2404-build-armbian-depends) 109 | sudo -E systemctl daemon-reload 110 | #sudo -E apt-get -y full-upgrade 111 | sudo -E apt-get -y autoremove --purge 112 | sudo -E apt-get clean 113 | sudo sed -i '/NVM_DIR/d;/skel/d' /root/{.bashrc,.profile} 114 | sudo rm -rf ~/{.cargo,.dotnet,.rustup} 115 | sudo -E timedatectl set-timezone "${TZ:-Etc/UTC}" 116 | sudo -E ntpdate ntp.ubuntu.com 0.pool.ntp.org || true 117 | sudo -E timedatectl set-ntp true 118 | date -u 119 | timedatectl status || true 120 | echo "status=success" >> ${GITHUB_OUTPUT} 121 | 122 | - name: Create simulated physical disk 123 | id: disk 124 | run: | 125 | mnt_size=$(expr $(df -h /mnt | tail -1 | awk '{print $4}' | sed 's/[[:alpha:]]//g' | sed 's/\..*//') - 1) 126 | root_size=$(expr $(df -h / | tail -1 | awk '{print $4}' | sed 's/[[:alpha:]]//g' | sed 's/\..*//') - 4) 127 | sudo truncate -s "${mnt_size}"G /mnt/mnt.img 128 | sudo truncate -s "${root_size}"G /root.img 129 | sudo losetup /dev/loop6 /mnt/mnt.img 130 | sudo losetup /dev/loop7 /root.img 131 | sudo pvcreate /dev/loop6 132 | sudo pvcreate /dev/loop7 133 | sudo vgcreate github /dev/loop6 /dev/loop7 134 | sudo lvcreate -n runner -l 100%FREE github 135 | sudo mkfs.xfs -f -i sparse=0 -b size=4096 /dev/github/runner 136 | sudo mkdir -p /builder 137 | sudo mount /dev/github/runner /builder 138 | sudo chown -R runner:runner /builder 139 | df -Th 140 | echo "status=success" >> ${GITHUB_OUTPUT} 141 | 142 | - name: Install Docker 143 | id: install 144 | working-directory: /builder 145 | if: ${{ steps.disk.outputs.status }} == 'success' && !cancelled() 146 | run: | 147 | df -hT ${PWD} 148 | curl -fsSL https://get.docker.com | sh 149 | sudo usermod -aG docker $USER 150 | sudo newgrp docker 151 | echo "status=success" >> ${GITHUB_OUTPUT} 152 | 153 | - name: Pull Docker Image [ ${{ inputs.docker_image }} ] 154 | id: pull 155 | working-directory: /builder 156 | if: ${{ steps.install.outputs.status }} == 'success' && !cancelled() 157 | run: | 158 | # Create a docker mapping directory 159 | mkdir -p /builder/{compile-kernel/{kernel,output},ccache} 160 | ln -sf /builder/compile-kernel/kernel /home/runner/work/_actions/ophub/amlogic-s9xxx-armbian/main/compile-kernel/kernel 161 | ln -sf /builder/compile-kernel/output /home/runner/work/_actions/ophub/amlogic-s9xxx-armbian/main/compile-kernel/output 162 | 163 | # Pull the Armbian Docker image 164 | docker run -d --privileged \ 165 | --name armbian-ophub \ 166 | -v /builder/compile-kernel:/opt/kernel/compile-kernel \ 167 | -v /builder/ccache:/root/.ccache \ 168 | -v /etc/localtime:/etc/localtime:ro \ 169 | -v /etc/timezone:/etc/timezone:ro \ 170 | -e CCACHE_DIR=/root/.ccache \ 171 | --restart=always \ 172 | ophub/armbian-${{ inputs.docker_image }}:arm64 173 | 174 | echo "status=success" >> ${GITHUB_OUTPUT} 175 | 176 | - name: Get kernel source hash 177 | id: kernelhash 178 | if: ${{ steps.pull.outputs.status }} == 'success' && !cancelled() 179 | run: | 180 | # Get the latest source hash from the kernel repository 181 | api_url="https://api.github.com/repos/${{ inputs.kernel_source }}/linux-${{ inputs.kernel_version }}/git/ref/heads/main" 182 | source_hash=$(curl -fsSL -m 20 \ 183 | -H "Accept: application/vnd.github+json" \ 184 | -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \ 185 | ${api_url} | 186 | jq -r '.object.sha' 187 | ) 188 | [[ -z "${source_hash}" || "${source_hash}" == "null" ]] && source_hash="${{ github.sha }}" 189 | echo "source_hash=${source_hash}" >> ${GITHUB_ENV} 190 | echo "status=success" >> ${GITHUB_OUTPUT} 191 | 192 | - name: Cache ccache 193 | uses: actions/cache@v4 194 | with: 195 | path: /builder/ccache 196 | key: kernel-${{ inputs.kernel_toolchain }}-${{ inputs.kernel_version }}-${{ env.source_hash }} 197 | restore-keys: | 198 | kernel-${{ inputs.kernel_toolchain }}-${{ inputs.kernel_version }}- 199 | 200 | - name: Compile the kernel [ ${{ inputs.kernel_version }} ] 201 | uses: ophub/amlogic-s9xxx-armbian@main 202 | if: ${{ steps.pull.outputs.status }} == 'success' && !cancelled() 203 | with: 204 | build_target: kernel 205 | kernel_source: ${{ inputs.kernel_source }} 206 | kernel_version: ${{ inputs.kernel_version }} 207 | kernel_auto: ${{ inputs.kernel_auto }} 208 | delete_source: ${{ inputs.delete_source }} 209 | kernel_package: ${{ inputs.kernel_package }} 210 | kernel_sign: ${{ inputs.kernel_sign }} 211 | kernel_toolchain: ${{ inputs.kernel_toolchain }} 212 | ccache_clear: ${{ inputs.ccache_clear }} 213 | 214 | - name: Upload Kernel to Release 215 | uses: ncipollo/release-action@main 216 | if: ${{ env.PACKAGED_STATUS }} == 'success' && !cancelled() 217 | with: 218 | tag: kernel_stable 219 | artifacts: ${{ env.PACKAGED_OUTPUTPATH }}/* 220 | allowUpdates: true 221 | removeArtifacts: false 222 | replacesArtifacts: true 223 | makeLatest: false 224 | token: ${{ secrets.GITHUB_TOKEN }} 225 | body: | 226 | - These are Mainline LTS(Long Term Support) kernels that provide `stable` support for OpenWrt. 227 | - It works with most `Amlogic`, `Rockchip`, and `Allwinner` devices. For specific details, please refer to the instructions on the homepage of repository. 228 | - Dedicated BSP kernels for other Rockchip and Allwinner devices can be downloaded from the [ophub/kernel](https://github.com/ophub/kernel) repository. 229 | - 这些是主线 LTS(长期支持)内核,为 OpenWrt 提供`稳定`的支持。 230 | - 适用于 `amlogic`,`rockchip`,`allwinner` 的大部分设备,具体可以参考仓库首页的说明。 231 | - 其他的 Rockchip 和 Allwinner 设备专用 BSP 内核可以在 [ophub/kernel](https://github.com/ophub/kernel) 仓库里下载使用。 232 | -------------------------------------------------------------------------------- /.github/workflows/build-openwrt-using-unifreq-scripts.yml: -------------------------------------------------------------------------------- 1 | #========================================================================== 2 | # Description: Build OpenWrt using Unifreq scripts 3 | # Copyright (C) 2021 https://github.com/unifreq/openwrt_packit 4 | # Copyright (C) 2021 https://github.com/ophub/flippy-openwrt-actions 5 | #========================================================================== 6 | 7 | name: Build OpenWrt using Unifreq scripts 8 | 9 | on: 10 | repository_dispatch: 11 | workflow_dispatch: 12 | inputs: 13 | openwrt_soc: 14 | description: "Select device board." 15 | required: false 16 | default: "all" 17 | type: choice 18 | options: 19 | - all 20 | - s922x_s905x3_s905x2_s912_s905d_s905 21 | - rock5b_h28k_r66s_vplus 22 | - 100ask-dshanpi-a1 23 | - ak88 24 | - beikeyun 25 | - cm3 26 | - e20c 27 | - e24c 28 | - e25 29 | - e52c 30 | - e54c 31 | - ht2 32 | - h28k 33 | - h66k 34 | - h68k 35 | - h69k 36 | - h69k-max 37 | - h88k 38 | - h88k-v3 39 | - jp-tvbox 40 | - l1pro 41 | - photonicat 42 | - qemu 43 | - r66s 44 | - r68s 45 | - rock5b 46 | - rock5c 47 | - rk3399 48 | - s905 49 | - s905d 50 | - s905x2 51 | - s905x3 52 | - s912 53 | - s922x 54 | - s922x-n2 55 | - vplus 56 | - watermelon-pi 57 | - yixun-rs6pro 58 | - zcube1-max 59 | - diy 60 | customize_rk3399: 61 | description: "Set customize rk3399 devices" 62 | required: false 63 | default: "tvi3315a:rk3399-tvi3315a.dtb/sw799:rk3399-bozz-sw799.dtb" 64 | type: choice 65 | options: 66 | - tvi3315a:rk3399-tvi3315a.dtb/sw799:rk3399-bozz-sw799.dtb 67 | - none 68 | openwrt_ip: 69 | description: "Set OpenWrt default IP address" 70 | required: false 71 | default: "192.168.1.1" 72 | kernel_repo: 73 | description: "Set the kernel repository" 74 | required: false 75 | default: "ophub/kernel" 76 | type: choice 77 | options: 78 | - breakingbadboy/OpenWrt 79 | - ophub/kernel 80 | openwrt_kernel: 81 | description: "Select kernel version" 82 | required: false 83 | default: "6.1.y_6.12.y" 84 | type: choice 85 | options: 86 | - 5.10.y 87 | - 5.15.y 88 | - 6.1.y 89 | - 6.6.y 90 | - 6.12.y 91 | - 5.10.y_5.15.y 92 | - 5.15.y_6.1.y 93 | - 6.1.y_6.12.y 94 | - 6.1.y_6.6.y 95 | - 6.6.y_6.12.y 96 | auto_kernel: 97 | description: "Auto use the latest kernel" 98 | required: false 99 | default: true 100 | type: boolean 101 | script_diy_path: 102 | description: "Set custom script loading path" 103 | required: false 104 | default: "" 105 | openwrt_storage: 106 | description: "Select image storage type." 107 | required: false 108 | default: "save" 109 | type: choice 110 | options: 111 | - save 112 | - temp 113 | builder_name: 114 | description: "Set OpenWrt builder signature." 115 | required: false 116 | default: "ophub" 117 | type: choice 118 | options: 119 | - ophub 120 | - angel 121 | - yourname 122 | 123 | env: 124 | TZ: Etc/UTC 125 | 126 | jobs: 127 | build: 128 | runs-on: ubuntu-24.04 129 | if: ${{ github.event.repository.owner.id }} == ${{ github.event.sender.id }} 130 | 131 | steps: 132 | - name: Checkout 133 | uses: actions/checkout@v6 134 | 135 | - name: Initialization environment 136 | id: init 137 | env: 138 | DEBIAN_FRONTEND: noninteractive 139 | run: | 140 | docker rmi -f $(docker images -q) 2>/dev/null || true 141 | [[ -n "${AGENT_TOOLSDIRECTORY}" ]] && sudo rm -rf "${AGENT_TOOLSDIRECTORY}" 142 | sudo rm -rf /usr/share/dotnet /usr/local/lib/android 2>/dev/null 143 | sudo swapoff -a 144 | sudo rm -f /swapfile /mnt/swapfile 145 | sudo -E apt-get -y update 146 | sudo -E apt-get -y purge azure-cli ghc* zulu* llvm* firefox google* dotnet* powershell openjdk* mongodb* moby* || true 147 | sudo -E apt-get -y install $(curl -fsSL https://ophub.org/ubuntu2404-make-openwrt-depends) 148 | sudo -E systemctl daemon-reload 149 | #sudo -E apt-get -y full-upgrade 150 | sudo -E apt-get -y autoremove --purge 151 | sudo -E apt-get clean 152 | sudo sed -i '/NVM_DIR/d;/skel/d' /root/{.bashrc,.profile} 153 | sudo rm -rf ~/{.cargo,.dotnet,.rustup} 154 | sudo -E timedatectl set-timezone "${TZ:-Etc/UTC}" 155 | sudo -E ntpdate ntp.ubuntu.com 0.pool.ntp.org || true 156 | sudo -E timedatectl set-ntp true 157 | date -u 158 | timedatectl status || true 159 | echo "status=success" >> ${GITHUB_OUTPUT} 160 | 161 | - name: Create simulated physical disk 162 | run: | 163 | mnt_size=$(expr $(df -h /mnt | tail -1 | awk '{print $4}' | sed 's/[[:alpha:]]//g' | sed 's/\..*//') - 1) 164 | root_size=$(expr $(df -h / | tail -1 | awk '{print $4}' | sed 's/[[:alpha:]]//g' | sed 's/\..*//') - 4) 165 | sudo truncate -s "${mnt_size}"G /mnt/mnt.img 166 | sudo truncate -s "${root_size}"G /root.img 167 | sudo losetup /dev/loop6 /mnt/mnt.img 168 | sudo losetup /dev/loop7 /root.img 169 | sudo pvcreate /dev/loop6 170 | sudo pvcreate /dev/loop7 171 | sudo vgcreate github /dev/loop6 /dev/loop7 172 | sudo lvcreate -n runner -l 100%FREE github 173 | sudo mkfs.xfs -f -i sparse=0 -b size=4096 /dev/github/runner 174 | sudo mkdir -p /builder 175 | sudo mount /dev/github/runner /builder 176 | sudo chown -R runner:runner /builder 177 | df -Th 178 | echo "status=success" >> ${GITHUB_OUTPUT} 179 | 180 | - name: Download OpenWrt rootfs file 181 | id: download 182 | working-directory: /builder 183 | if: ${{ steps.init.outputs.status }} == 'success' && !cancelled() 184 | run: | 185 | # Create download directory 186 | armsr_tarfile_path="opt/download" 187 | [[ -d "${armsr_tarfile_path}" ]] || mkdir -p ${armsr_tarfile_path} 188 | sudo rm -rf /opt && sudo ln -sf /builder/opt /opt 189 | ln -sf /builder/opt ${{ github.workspace }}/opt 190 | 191 | # Get name (file name) and url (API asset URL) 192 | latest_version=$(curl -s \ 193 | -H "Accept: application/vnd.github+json" \ 194 | -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \ 195 | https://api.github.com/repos/${{ github.repository }}/releases?per_page=20 | \ 196 | jq -r --arg RTK "OpenWrt_lede_" \ 197 | --arg BOARD "-rootfs.tar.gz" \ 198 | '[.[] | select(.tag_name | contains($RTK))] | 199 | map(.assets[] | select(.name | endswith($BOARD))) | 200 | sort_by(.updated_at) | 201 | reverse | 202 | .[0] | 203 | {data: .updated_at, url: .url, name: .name}') 204 | 205 | [[ -z "${latest_version}" || "${latest_version}" == "null" ]] && { 206 | echo "Invalid OpenWrt rootfs download address." 207 | exit 1 208 | } 209 | 210 | # Get URL and filename separately 211 | latest_url="$(echo ${latest_version} | jq -r '.url')" 212 | openwrt_filename="$(echo ${latest_version} | jq -r '.name')" 213 | 214 | # Download using API method (add octet-stream header) 215 | echo "Downloading: ${openwrt_filename}" 216 | curl -fsSL \ 217 | -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \ 218 | -H "Accept: application/octet-stream" \ 219 | "${latest_url}" \ 220 | -o "${armsr_tarfile_path}/${openwrt_filename}" 221 | [[ "${?}" -ne "0" ]] && echo "Download failed." && exit 1 222 | 223 | echo "build_tag=OpenWrt_armv8_${{ inputs.openwrt_storage }}_$(date +"%Y.%m")" >> ${GITHUB_ENV} 224 | echo "status=success" >> ${GITHUB_OUTPUT} 225 | 226 | - name: Package OpenWrt Firmware 227 | uses: ophub/flippy-openwrt-actions@main 228 | if: ${{ steps.download.outputs.status }} == 'success' && !cancelled() 229 | env: 230 | OPENWRT_ARMSR: opt/download/*rootfs.tar.gz 231 | PACKAGE_SOC: ${{ inputs.openwrt_soc }} 232 | KERNEL_REPO_URL: ${{ inputs.kernel_repo }} 233 | KERNEL_VERSION_NAME: ${{ inputs.openwrt_kernel }} 234 | KERNEL_AUTO_LATEST: ${{ inputs.auto_kernel }} 235 | OPENWRT_IP: ${{ inputs.openwrt_ip }} 236 | CUSTOMIZE_RK3399: ${{ inputs.customize_rk3399 }} 237 | SCRIPT_DIY_PATH: ${{ inputs.script_diy_path }} 238 | WHOAMI: ${{ inputs.builder_name }} 239 | 240 | - name: Upload OpenWrt Firmware to Release 241 | uses: ncipollo/release-action@main 242 | if: ${{ env.PACKAGED_STATUS }} == 'success' && !cancelled() 243 | with: 244 | tag: ${{ env.build_tag }} 245 | artifacts: ${{ env.PACKAGED_OUTPUTPATH }}/* 246 | allowUpdates: true 247 | removeArtifacts: false 248 | replacesArtifacts: true 249 | makeLatest: true 250 | token: ${{ secrets.GITHUB_TOKEN }} 251 | body: | 252 | ### OpenWrt Image information 253 | - Default IP: `192.168.1.1` 254 | - Default username: `root` 255 | - Default password: `password` 256 | - Default WIFI name: `OpenWrt` 257 | - Default WIFI password: `none` 258 | ### Install to EMMC 259 | - Login to OpenWrt → `System` → `Amlogic Service` → `Install OpenWrt` 260 | ### OpenWrt source code 261 | - [coolsnowwolf/lede](https://github.com/coolsnowwolf/lede) 262 | ### Applicable platform 263 | - 🐧 `arm64` 264 | - 🐋 Docker image: https://hub.docker.com/u/ophub 265 | --------------------------------------------------------------------------------