From 40dbe7e5475c2a32dd6501225d20134dcf8e039c Mon Sep 17 00:00:00 2001 From: Tim Wilkinson Date: Wed, 24 Jan 2024 19:28:36 -0800 Subject: [PATCH] Support for mANTbox 2 12s (#1083) * Add routerboard-911g-2hpnd-12s * Fix procd for devices without /dev/console * Disable console reset in kernel --- SUPPORTED_DEVICES.md | 1 + configs/ath79-mikrotik-nand.config | 1 + files/etc/radios.json | 8 +++ patches/720-procd-fix-cwd.patch | 19 ++++++ patches/730-mikrotik-disable-console.patch | 7 +++ patches/747-mikrotik-extra-support.patch | 68 ++++++++++++++++++++++ patches/series | 2 + 7 files changed, 106 insertions(+) create mode 100755 patches/720-procd-fix-cwd.patch create mode 100755 patches/730-mikrotik-disable-console.patch diff --git a/SUPPORTED_DEVICES.md b/SUPPORTED_DEVICES.md index 03b83934..868ca48a 100644 --- a/SUPPORTED_DEVICES.md +++ b/SUPPORTED_DEVICES.md @@ -39,6 +39,7 @@ RB912UAG-2HPnD
BaseBox 2 | RB912UAG-2HPnD
RB912UAG-2HPnD-OUT | 2 | ath RB912UAG-5HPnD
BaseBox 5 | RB912UAG-5HPnD
RB912UAG-5HPnD-OUT | 5 | ath79 | mikrotik | mikrotik-912uag-5hpnd | 64MB | stable | released (1) mANTBox 15s | RB921GS-5HPacD-15S | 5 | ath79 | mikrotik | mikrotik-921gs-5hpacd-15s | 128MB | stable | released mANTBox 19s | RB921GS-5HPacD-19S | 5 | ath79 | mikrotik | mikrotik-921gs-5hpacd-19s | 128MB | stable | released +mANTBox 2 12s | RB911G-2HPnD-12S | 2 | ath79 | mikrotik | mikrotik-911g-2hpnd-12s | 64MB | stable | nightly ## Ubiquiti Model | SKUs | Band | Target | Subtarget | Image | RAM | Stability | Status diff --git a/configs/ath79-mikrotik-nand.config b/configs/ath79-mikrotik-nand.config index a0e42490..e6276278 100755 --- a/configs/ath79-mikrotik-nand.config +++ b/configs/ath79-mikrotik-nand.config @@ -3,6 +3,7 @@ CONFIG_TARGET_ath79_mikrotik=y CONFIG_TARGET_DEVICE_ath79_mikrotik_DEVICE_mikrotik_routerboard-911g-5hpnd-qrt=y CONFIG_TARGET_DEVICE_ath79_mikrotik_DEVICE_mikrotik_routerboard-912uag-2hpnd=y CONFIG_TARGET_DEVICE_ath79_mikrotik_DEVICE_mikrotik_routerboard-912uag-5hpnd=y +CONFIG_TARGET_DEVICE_ath79_mikrotik_DEVICE_mikrotik_routerboard-911g-2hpnd-12s=y # # Mikrotik use initramfs to install diff --git a/files/etc/radios.json b/files/etc/radios.json index 2a1f593d..2380e16b 100644 --- a/files/etc/radios.json +++ b/files/etc/radios.json @@ -308,6 +308,14 @@ "beamwidth": 10.1 } }, + "mikrotik routerboard 911g-2hpnd-12s": { + "maxpower": "30", + "antenna": { + "description": "12 dBi 120° Sector", + "gain": 12, + "beamwidth": 120 + } + }, "mikrotik routerboard 921gs-5hpacd-15s": { "maxpower": "31", "bandwidths": [ 10, 20 ], diff --git a/patches/720-procd-fix-cwd.patch b/patches/720-procd-fix-cwd.patch new file mode 100755 index 00000000..92af47e1 --- /dev/null +++ b/patches/720-procd-fix-cwd.patch @@ -0,0 +1,19 @@ +--- /dev/null ++++ b/package/system/procd/patches/001-fix-cwd.patch +@@ -0,0 +1,16 @@ ++--- a/state.c +++++ b/state.c ++@@ -48,11 +48,11 @@ ++ if (chdir("/dev") || ++ !freopen(tty, "r", stdin) || ++ !freopen(tty, "w", stdout) || ++- !freopen(tty, "w", stderr) || ++- chdir("/")) +++ !freopen(tty, "w", stderr)) ++ ERROR("failed to set stdio: %m\n"); ++ else ++ fcntl(STDERR_FILENO, F_SETFL, fcntl(STDERR_FILENO, F_GETFL) | O_NONBLOCK); +++ chdir("/"); ++ } ++ ++ static void set_console(void) diff --git a/patches/730-mikrotik-disable-console.patch b/patches/730-mikrotik-disable-console.patch new file mode 100755 index 00000000..95f226e9 --- /dev/null +++ b/patches/730-mikrotik-disable-console.patch @@ -0,0 +1,7 @@ +--- a/target/linux/ath79/mikrotik/config-default ++++ b/target/linux/ath79/mikrotik/config-default +@@ -38,3 +38,4 @@ + CONFIG_WATCHDOG_CORE=y + CONFIG_ZLIB_DEFLATE=y + CONFIG_ZLIB_INFLATE=y ++CONFIG_CMDLINE="rootfstype=squashfs,jffs1 8250.nr_uarts=0" diff --git a/patches/747-mikrotik-extra-support.patch b/patches/747-mikrotik-extra-support.patch index bc4780da..a22fab5f 100644 --- a/patches/747-mikrotik-extra-support.patch +++ b/patches/747-mikrotik-extra-support.patch @@ -765,3 +765,71 @@ define Device/mikrotik_routerboard-921gs-5hpacd-15s $(Device/mikrotik_nand) SOC := qca9558 +--- a/target/linux/ath79/image/mikrotik.mk ++++ b/target/linux/ath79/image/mikrotik.mk +@@ -28,6 +28,15 @@ + endef + TARGET_DEVICES += mikrotik_routerboard-912uag-2hpnd + ++define Device/mikrotik_routerboard-911g-2hpnd-12s ++ $(Device/mikrotik_nand) ++ SOC := ar9342 ++ DEVICE_MODEL := RouterBOARD 911G-2HPnD-12s ++ DEVICE_PACKAGES += kmod-usb-ehci kmod-usb2 ++ SUPPORTED_DEVICES += rb-912uag-2hpnd ++endef ++TARGET_DEVICES += mikrotik_routerboard-911g-2hpnd-12s ++ + define Device/mikrotik_routerboard-912uag-5hpnd + $(Device/mikrotik_nand) + SOC := ar9342 + +--- /dev/null ++++ b/target/linux/ath79/dts/ar9342_mikrotik_routerboard-911g-2hpnd-12s.dts +@@ -0,0 +1,8 @@ ++// SPDX-License-Identifier: GPL-2.0-only ++ ++#include "ar9342_mikrotik_routerboard-912uag-2hpnd.dts" ++ ++/ { ++ compatible = "mikrotik,routerboard-911g-2hpnd-12s", "qca,ar9342"; ++ model = "MikroTik RouterBOARD 911G-2HPnD-12s"; ++}; +--- a/target/linux/ath79/mikrotik/base-files/etc/board.d/02_network ++++ b/target/linux/ath79/mikrotik/base-files/etc/board.d/02_network +@@ -16,6 +16,7 @@ + ;; + mikrotik,routerboard-911g-5hpnd*|\ + mikrotik,routerboard-911-lite|\ ++ mikrotik,routerboard-911g-2hpnd*|\ + mikrotik,routerboard-912uag-2hpnd|\ + mikrotik,routerboard-912uag-5hpnd|\ + mikrotik,routerboard-lhg-2nd|\ +@@ -82,6 +83,7 @@ + case "$board" in + mikrotik,routerboard-911g-5hpnd*|\ + mikrotik,routerboard-911-lite|\ ++ mikrotik,routerboard-911g-2hpnd*|\ + mikrotik,routerboard-912uag-2hpnd|\ + mikrotik,routerboard-912uag-5hpnd|\ + mikrotik,routerboard-lhg-2nd|\ +--- a/target/linux/ath79/mikrotik/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom ++++ b/target/linux/ath79/mikrotik/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom +@@ -25,6 +25,7 @@ + case $board in + mikrotik,routerboard-911g-5hpnd*|\ + mikrotik,routerboard-911-lite|\ ++ mikrotik,routerboard-911g-2hpnd*|\ + mikrotik,routerboard-912uag-2hpnd|\ + mikrotik,routerboard-912uag-5hpnd|\ + mikrotik,routerboard-lhg-2nd|\ +--- a/target/linux/ath79/mikrotik/base-files/lib/upgrade/platform.sh ++++ b/target/linux/ath79/mikrotik/base-files/lib/upgrade/platform.sh +@@ -33,6 +33,7 @@ + case "$board" in + mikrotik,routerboard-493g|\ + mikrotik,routerboard-911g-5hpnd*|\ ++ mikrotik,routerboard-911g-2hpnd*|\ + mikrotik,routerboard-912uag-2hpnd|\ + mikrotik,routerboard-912uag-5hpnd|\ + mikrotik,routerboard-921gs-5hpacd-15s|\ diff --git a/patches/series b/patches/series index e98277fa..59565f77 100644 --- a/patches/series +++ b/patches/series @@ -24,6 +24,8 @@ 717-fix-olsrd-oparse-error.patch 718-temp-remove-olsrd-pud.patch 719-disable-ipv6.patch +720-procd-fix-cwd.patch +730-mikrotik-disable-console.patch 731-ag71xx-updates-and-fixes.patch 742-5-and-10mhz-ath10k-ct-support.patch 742-radio-extend-mediatek-support.patch