From 533ee9234d84b309908bdb868f0d5302f1a2d342 Mon Sep 17 00:00:00 2001 From: Justin Kilpatrick Date: Tue, 14 May 2024 17:09:09 -0400 Subject: [PATCH] Add support for linksys WHW03v2 This is a nice low cost ipq4019 router. --- config/linksys_whw03v2 | 72 +++++++++++++++++++ profiles/devices/linksys-whw03v2.yml | 27 +++++++ profiles/management/althea-release.yml | 2 +- profiles/management/hawk-managed.yml | 2 +- .../templates/linksys_whw03v2-network.j2 | 8 +++ .../templates/linksys_whw03v2-wireless.j2 | 47 ++++++++++++ scripts/build-default-release.sh | 1 + scripts/build-managed-release.sh | 2 + 8 files changed, 159 insertions(+), 2 deletions(-) create mode 100644 config/linksys_whw03v2 create mode 100644 profiles/devices/linksys-whw03v2.yml create mode 100644 roles/build-config/templates/linksys_whw03v2-network.j2 create mode 100644 roles/build-config/templates/linksys_whw03v2-wireless.j2 diff --git a/config/linksys_whw03v2 b/config/linksys_whw03v2 new file mode 100644 index 00000000..5a103847 --- /dev/null +++ b/config/linksys_whw03v2 @@ -0,0 +1,72 @@ +CONFIG_TARGET_ipq40xx=y +CONFIG_TARGET_ipq40xx_generic=y +CONFIG_TARGET_ipq40xx_generic_DEVICE_linksys_whw03v2=y +CONFIG_IFSTAT_SNMP=y +CONFIG_LIBCURL_COOKIES=y +CONFIG_LIBCURL_FILE=y +CONFIG_LIBCURL_FTP=y +CONFIG_LIBCURL_HTTP=y +CONFIG_LIBCURL_MBEDTLS=y +CONFIG_LIBCURL_NGHTTP2=y +CONFIG_LIBCURL_NO_SMB="!" +CONFIG_LIBCURL_PROXY=y +CONFIG_LIBCURL_UNIX_SOCKETS=y +CONFIG_OPENSSL_ENGINE=y +CONFIG_OPENSSL_PREFER_CHACHA_OVER_GCM=y +CONFIG_OPENSSL_WITH_ASM=y +CONFIG_OPENSSL_WITH_CHACHA_POLY1305=y +CONFIG_OPENSSL_WITH_CMS=y +CONFIG_OPENSSL_WITH_DEPRECATED=y +CONFIG_OPENSSL_WITH_ERROR_MESSAGES=y +CONFIG_OPENSSL_WITH_IDEA=y +CONFIG_OPENSSL_WITH_MDC2=y +CONFIG_OPENSSL_WITH_PSK=y +CONFIG_OPENSSL_WITH_SEED=y +CONFIG_OPENSSL_WITH_SRP=y +CONFIG_OPENSSL_WITH_TLS13=y +CONFIG_OPENSSL_WITH_WHIRLPOOL=y +CONFIG_PACKAGE_althea-babeld=y +CONFIG_PACKAGE_althea-cron-jobs=y +CONFIG_PACKAGE_althea-dash=y +CONFIG_PACKAGE_althea-rust-binaries=y +CONFIG_PACKAGE_althea-tools=y +CONFIG_PACKAGE_ca-certificates=y +CONFIG_PACKAGE_curl=y +CONFIG_PACKAGE_ifstat=y +CONFIG_PACKAGE_iftop=y +CONFIG_PACKAGE_iperf3=y +CONFIG_PACKAGE_ipset=y +CONFIG_PACKAGE_kmod-crypto-lib-chacha20=y +CONFIG_PACKAGE_kmod-crypto-lib-chacha20poly1305=y +CONFIG_PACKAGE_kmod-crypto-lib-curve25519=y +CONFIG_PACKAGE_kmod-crypto-lib-poly1305=y +CONFIG_PACKAGE_kmod-ipt-core=y +CONFIG_PACKAGE_kmod-ipt-ipset=y +CONFIG_PACKAGE_kmod-nf-ipt=y +CONFIG_PACKAGE_kmod-sched-cake=y +CONFIG_PACKAGE_kmod-sched-core=y +CONFIG_PACKAGE_kmod-udptunnel4=y +CONFIG_PACKAGE_kmod-udptunnel6=y +CONFIG_PACKAGE_kmod-wireguard=y +CONFIG_PACKAGE_libatomic=y +CONFIG_PACKAGE_libcurl=y +CONFIG_PACKAGE_libiperf3=y +CONFIG_PACKAGE_libipset=y +CONFIG_PACKAGE_libncurses=y +CONFIG_PACKAGE_libnetsnmp=y +CONFIG_PACKAGE_libnghttp2=y +CONFIG_PACKAGE_libopenssl=y +CONFIG_PACKAGE_libpcap=y +CONFIG_PACKAGE_libpci=y +CONFIG_PACKAGE_libpcre2=y +CONFIG_PACKAGE_libustream-mbedtls=m +CONFIG_PACKAGE_libustream-openssl=y +CONFIG_PACKAGE_mtr-nojson=y +CONFIG_PACKAGE_nano=y +CONFIG_PACKAGE_rpcd=y +CONFIG_PACKAGE_tc-tiny=y +CONFIG_PACKAGE_tcpdump=y +CONFIG_PACKAGE_terminfo=y +CONFIG_PACKAGE_uhttpd=y +CONFIG_PACKAGE_wireguard-tools=y +CONFIG_PCRE2_JIT_ENABLED=y diff --git a/profiles/devices/linksys-whw03v2.yml b/profiles/devices/linksys-whw03v2.yml new file mode 100644 index 00000000..28720e84 --- /dev/null +++ b/profiles/devices/linksys-whw03v2.yml @@ -0,0 +1,27 @@ +conf_to_build: linksys_whw03v2 +device: linksys_whw03v2 +package_id: arm_cortex-a7_neon-vfpv4 +image_paths: + - "ipq40xx/generic/openwrt-ipq40xx-generic-linksys_whw03v2-squashfs-factory.bin" + - "ipq40xx/generic/openwrt-ipq40xx-generic-linksys_whw03v2-squashfs-sysupgrade.bin" +supported: true + +private_radio: + - radio0 + - radio1 + - radio2 + +# does not support channel 11 +channel: 1 +# note the first radio on this device must take channel 149 +# with the last device taking channel 36 +five_ghz_channel: 149 +five_ghz_channel_alt: 36 + +listen_interfaces: + - wan + +lan_interfaces: "lan" + + +rust_target: armv7-unknown-linux-musleabihf diff --git a/profiles/management/althea-release.yml b/profiles/management/althea-release.yml index cd79882c..e6d6cbfe 100644 --- a/profiles/management/althea-release.yml +++ b/profiles/management/althea-release.yml @@ -5,7 +5,7 @@ default_exit: "test" insert_keys: false logging_enabled: true logging_level: "ERROR" -wifi_ssid_two_ghz: AltheaHome-2.4 +wifi_ssid_two_ghz: AltheaHome-2 wifi_ssid_five_ghz: AltheaHome-5 wifi_disabled: 0 wifi_key: ChangeMe diff --git a/profiles/management/hawk-managed.yml b/profiles/management/hawk-managed.yml index 46d5d489..560b406d 100644 --- a/profiles/management/hawk-managed.yml +++ b/profiles/management/hawk-managed.yml @@ -12,7 +12,7 @@ keys_to_insert: - "sk-ssh-ed25519@openssh.com AAAAGnNrLXNzaC1lZDI1NTE5QG9wZW5zc2guY29tAAAAIBR8P2K6fwUSJiygGEYjnQej9q96CfTdCB4s+u+2kMwYAAAABHNzaDo= justin-tertiary@althea.net" - "sk-ssh-ed25519@openssh.com AAAAGnNrLXNzaC1lZDI1NTE5QG9wZW5zc2guY29tAAAAIKIHutGmtkioT2o+EkmgakH0gv8Zyl83KuqU5v73UineAAAABHNzaDo= thomas-primary@althea.systems" - "sk-ssh-ed25519@openssh.com AAAAGnNrLXNzaC1lZDI1NTE5QG9wZW5zc2guY29tAAAAIPlLsiBAHAtJindxr9j9sLKlnwzY5t2U+FVuyuU5BqIQAAAABHNzaDo= thomas-secondary@althea.systems" -wifi_ssid_two_ghz: AltheaHome-2.4 +wifi_ssid_two_ghz: AltheaHome-2 wifi_ssid_five_ghz: AltheaHome-5 wifi_disabled: 0 wifi_key: ChangeMe diff --git a/roles/build-config/templates/linksys_whw03v2-network.j2 b/roles/build-config/templates/linksys_whw03v2-network.j2 new file mode 100644 index 00000000..92ace112 --- /dev/null +++ b/roles/build-config/templates/linksys_whw03v2-network.j2 @@ -0,0 +1,8 @@ +config globals 'globals' + option ula_prefix 'auto' + +{% for interface in listen_interfaces %} +config interface 'rita_{{interface | replace(".","")}}' + option ifname {{interface}} + option proto static +{% endfor %} diff --git a/roles/build-config/templates/linksys_whw03v2-wireless.j2 b/roles/build-config/templates/linksys_whw03v2-wireless.j2 new file mode 100644 index 00000000..7a3dc556 --- /dev/null +++ b/roles/build-config/templates/linksys_whw03v2-wireless.j2 @@ -0,0 +1,47 @@ +config wifi-device 'radio0' + option type 'mac80211' + option path 'soc/40000000.pci/pci0000:00/0000:00:00.0/0000:01:00.0' + option channel '{{five_ghz_channel}}' + option band '5g' + option htmode 'VHT80' + option disabled '{{wifi_disabled}}' + +config wifi-iface 'default_radio0' + option device 'radio0' + option network 'lan' + option mode 'ap' + option ssid '{{wifi_ssid_five_ghz}}' + option encryption '{{wifi_encryption}}' + option key '{{wifi_key}}' + +config wifi-device 'radio1' + option type 'mac80211' + option path 'platform/soc/a000000.wifi' + option channel '{{channel}}' + option band '2g' + option htmode 'HT20' + option disabled '{{wifi_disabled}}' + +config wifi-iface 'default_radio1' + option device 'radio1' + option network 'lan' + option mode 'ap' + option ssid '{{wifi_ssid_two_ghz}}' + option encryption '{{wifi_encryption}}' + option key '{{wifi_key}}' + +config wifi-device 'radio2' + option type 'mac80211' + option path 'platform/soc/a800000.wifi' + option channel '{{five_ghz_channel_alt}}' + option band '5g' + option htmode 'VHT80' + option disabled '{{wifi_disabled}}' + +config wifi-iface 'default_radio2' + option device 'radio2' + option network 'lan' + option mode 'ap' + option ssid '{{wifi_ssid_five_ghz}}' + option encryption '{{wifi_encryption}}' + option key '{{wifi_key}}' \ No newline at end of file diff --git a/scripts/build-default-release.sh b/scripts/build-default-release.sh index 98968950..b068c1f1 100644 --- a/scripts/build-default-release.sh +++ b/scripts/build-default-release.sh @@ -22,6 +22,7 @@ ansible-playbook -e @profiles/devices/mr8300.yml -e @profiles/management/althea- ansible-playbook -e @profiles/devices/ea8300.yml -e @profiles/management/althea-release.yml firmware-build.yml ansible-playbook -e @profiles/devices/mikrotik_hap-ac2.yml -e @profiles/management/althea-release.yml firmware-build.yml ansible-playbook -e @profiles/devices/mikrotik_hap-ac3.yml -e @profiles/management/althea-release.yml firmware-build.yml +ansible-playbook -e @profiles/devices/linksys-whw03v2.yml -e @profiles/management/hawk-managed.yml firmware-build.yml ansible-playbook -e @profiles/devices/netgear_ex6100v2.yml -e @profiles/management/althea-release.yml firmware-build.yml #broadcom diff --git a/scripts/build-managed-release.sh b/scripts/build-managed-release.sh index ea456008..a5bd0e92 100644 --- a/scripts/build-managed-release.sh +++ b/scripts/build-managed-release.sh @@ -3,6 +3,7 @@ set -eux cd $(dirname $0)/.. export SERVER=updates export HTTP_DIR=/usr/share/nginx/html/ +rsync -ahz --delete build/bin/packages $SERVER:$HTTP_DIR/rc/ # desktops / servers ansible-playbook -e @profiles/devices/x86_64.yml -e @profiles/management/hawk-managed.yml firmware-build.yml @@ -26,6 +27,7 @@ ansible-playbook -e @profiles/devices/ea8300.yml -e @profiles/management/hawk-ma ansible-playbook -e @profiles/devices/mikrotik_hap-ac2.yml -e @profiles/management/hawk-managed.yml firmware-build.yml ansible-playbook -e @profiles/devices/mikrotik_hap-ac3.yml -e @profiles/management/hawk-managed.yml firmware-build.yml ansible-playbook -e @profiles/devices/netgear_ex6100v2.yml -e @profiles/management/hawk-managed.yml firmware-build.yml +ansible-playbook -e @profiles/devices/linksys-whw03v2.yml -e @profiles/management/hawk-managed.yml firmware-build.yml #broadcom ansible-playbook -e @profiles/devices/pi4-64.yml -e @profiles/management/hawk-managed.yml firmware-build.yml