From 59676f5d7748c2b65031a37fcea72e9630392851 Mon Sep 17 00:00:00 2001 From: Corey Wagehoft Date: Wed, 12 Nov 2025 17:51:17 -0700 Subject: [PATCH 01/37] update custom packages install src --- boards/common/openmanet_diffconfig | 6 +- feeds.conf.default | 1 + package/adsbtocot/Makefile | 83 ------------- package/adsbtocot/files/99-adsb-defaults | 48 -------- package/adsbtocot/files/adsbcot.ini | 9 -- package/adsbtocot/files/adsbcot.init | 47 -------- package/alfred-openmanet/Config.in | 22 ---- package/alfred-openmanet/Makefile | 84 ------------- package/alfred-openmanet/files/alfred.config | 6 - package/alfred-openmanet/files/alfred.init | 97 --------------- package/alfred-openmanet/files/bat-hosts.lua | 114 ------------------ .../linux/bcm27xx/base-files/etc/config/gpsd | 5 - 12 files changed, 6 insertions(+), 516 deletions(-) delete mode 100644 package/adsbtocot/Makefile delete mode 100755 package/adsbtocot/files/99-adsb-defaults delete mode 100644 package/adsbtocot/files/adsbcot.ini delete mode 100644 package/adsbtocot/files/adsbcot.init delete mode 100644 package/alfred-openmanet/Config.in delete mode 100644 package/alfred-openmanet/Makefile delete mode 100644 package/alfred-openmanet/files/alfred.config delete mode 100644 package/alfred-openmanet/files/alfred.init delete mode 100644 package/alfred-openmanet/files/bat-hosts.lua delete mode 100644 target/linux/bcm27xx/base-files/etc/config/gpsd diff --git a/boards/common/openmanet_diffconfig b/boards/common/openmanet_diffconfig index bdebbd1b33..58b0d12b01 100644 --- a/boards/common/openmanet_diffconfig +++ b/boards/common/openmanet_diffconfig @@ -128,4 +128,8 @@ CONFIG_PACKAGE_alfred=y CONFIG_PACKAGE_adsbtocot=y CONFIG_PACKAGE_dump1090=y # (optional tools; dump1090 only needs librtlsdr, but these are handy) -CONFIG_PACKAGE_rtl-sdr=y \ No newline at end of file +CONFIG_PACKAGE_rtl-sdr=y + +# OpenMANET specific packages +CONFIG_PACKAGE_alfred-openmanet=y +CONFIG_PACKAGE_gpsd-openmanet=y \ No newline at end of file diff --git a/feeds.conf.default b/feeds.conf.default index bccc9030dc..0c825f0b06 100644 --- a/feeds.conf.default +++ b/feeds.conf.default @@ -2,5 +2,6 @@ src-git packages https://github.com/openwrt/packages.git^b5ed85f6e94aa08de143327 src-git routing https://github.com/openwrt/routing.git^e351d1e623e9ef2ab78f28cb1ce8d271d28c902d src-git telephony https://github.com/openwrt/telephony.git^98c8a5aa4624312ed758e2e2b6d4039050a1649d src-git luci https://github.com/MorseMicro/luci.git^fb7dfe08d55650bbb4078cf4ceb472697eb82ba9 +src-git openmanet https://github.com/OpenMANET/packages^ee89de955def736d20ebe64f8e4432ae90c326cb src-git morse https://github.com/OpenMANET/morse-feed^dbf6421d02e876fd221a1c43b5e2050bc8514f9a src-git prpl https://github.com/MorseMicro/feed-prpl.git^0542e586dd4698b41da335293501e890541bd74b diff --git a/package/adsbtocot/Makefile b/package/adsbtocot/Makefile deleted file mode 100644 index 1883ce5228..0000000000 --- a/package/adsbtocot/Makefile +++ /dev/null @@ -1,83 +0,0 @@ -include $(TOPDIR)/rules.mk - -PKG_NAME:=adsbtocot -PKG_VERSION:=1 -PKG_RELEASE:=2 -PKG_MAINTAINER:=info@openmanet.net -PKG_LICENSE:=MIT -PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME) -HOST_BUILD_DEPENDS:=python3/host -PKGARCH:=all - -include $(INCLUDE_DIR)/package.mk - -define Package/adsbtocot - SECTION:=utils - CATEGORY:=Utilities - TITLE:=ADS-B to Cursor-on-Target (ADSBCOT) for OpenWrt (dump1090 local) - DEPENDS:=+python3 +dump1090 -endef - -define Package/adsbtocot/description -Installs ADSBCOT from PyPI and provides a procd service to forward ADS-B tracks -from dump1090 to CoT/TAK (multicast or unicast). -endef - -# Persist user edits -define Package/adsbtocot/conffiles -/etc/adsbcot/adsbcot.ini -endef - -define Build/Prepare - mkdir -p $(PKG_BUILD_DIR) -endef - -# Vendor ADSBCOT as pure Python: -# - drop 'with_pymodes' to avoid numpy/ELF -# - disable aiohttp/yarl/multidict/frozenlist C-extensions -# - forbid wheels so pip builds pure-Python installs -define Build/Compile - AIOHTTP_NO_EXTENSIONS=1 \ - YARL_NO_EXTENSIONS=1 \ - MULTIDICT_NO_EXTENSIONS=1 \ - FROZENLIST_NO_EXTENSIONS=1 \ - PIP_NO_BINARY=:all: \ - $(STAGING_DIR_HOSTPKG)/bin/pip3 install 'adsbcot' \ - --prefix=/usr --root='$(PKG_INSTALL_DIR)' --no-cache-dir --no-compile - - # Safety: ensure no native .so crept in - find '$(PKG_INSTALL_DIR)/usr' -type f \( -name '*.so' -o -name '*.so.*' \) -print -delete || true -endef - -define Package/adsbtocot/install - # Config + init - $(INSTALL_DIR) $(1)/etc/adsbcot $(1)/etc/init.d - $(INSTALL_CONF) ./files/adsbcot.ini $(1)/etc/adsbcot/adsbcot.ini - $(INSTALL_BIN) ./files/adsbcot.init $(1)/etc/init.d/adsbcot - - # Python site-packages and console scripts - $(INSTALL_DIR) $(1)/usr - cp -a $(PKG_INSTALL_DIR)/usr/* $(1)/usr/ - - # Ensure no ELF in final image - find '$(1)/usr' -type f \( -name '*.so' -o -name '*.so.*' \) -print -delete || true - - # Normalize console-script shebangs to the target Python - [ -f "$(1)/usr/bin/adsbcot" ] && $(SED) '1s|^#!.*|#!/usr/bin/python3|' "$(1)/usr/bin/adsbcot" && chmod 0755 "$(1)/usr/bin/adsbcot" - for f in pytak aircot; do \ - if [ -f "$(1)/usr/bin/$$f" ]; then \ - $(SED) '1s|^#!.*|#!/usr/bin/python3|' "$(1)/usr/bin/$$f"; \ - chmod 0755 "$(1)/usr/bin/$$f"; \ - fi; \ - done - - # Trim caches to save space - find "$(1)/usr/lib/python3"* -name '__pycache__' -type d -exec rm -rf {} + 2>/dev/null || true - find "$(1)/usr/lib/python3"* -type f -name '*.pyc' -delete 2>/dev/null || true - - # First-boot defaults (gain, ports, etc.) - $(INSTALL_DIR) $(1)/etc/uci-defaults - $(INSTALL_BIN) ./files/99-adsb-defaults $(1)/etc/uci-defaults/99-adsb-defaults -endef - -$(eval $(call BuildPackage,adsbtocot)) \ No newline at end of file diff --git a/package/adsbtocot/files/99-adsb-defaults b/package/adsbtocot/files/99-adsb-defaults deleted file mode 100755 index ab28969e59..0000000000 --- a/package/adsbtocot/files/99-adsb-defaults +++ /dev/null @@ -1,48 +0,0 @@ -#!/bin/sh -# /etc/uci-defaults/99-adsb-defaults -# Apply once on first boot -[ -f /etc/adsbcot/.defaults_applied ] && exit 0 - -# Ensure dump1090 JSON path exists -mkdir -p /var/run/dump1090 - -uci -q batch <<'EOF' -set dump1090.main=dump1090 -set dump1090.main.enabled='1' -set dump1090.main.disabled='0' - -# SDR + decoding -set dump1090.main.device_index='0' -set dump1090.main.gain='49.6' -set dump1090.main.no_fix='0' -set dump1090.main.fix='1' - -# JSON output only -set dump1090.main.write_json='/var/run/dump1090' -set dump1090.main.write_json_every='1' -delete dump1090.main.html_dir - -# *** Disable all dump1090 network sockets *** -set dump1090.main.net='0' -set dump1090.main.net_only='0' -delete dump1090.main.net_bind_address -delete dump1090.main.net_ri_port -delete dump1090.main.net_ro_port -delete dump1090.main.net_sbs_port -delete dump1090.main.net_bi_port -delete dump1090.main.net_bo_port -delete dump1090.main.net_heartbeat -delete dump1090.main.net_buffer -delete dump1090.main.net_verbatim -delete dump1090.main.forward_mlat - -commit dump1090 -EOF - -/etc/init.d/adsbcot stop -/etc/init.d/adsbcot disable -/etc/init.d/dump1090 stop -/etc/init.d/dump1090 disable - -touch /etc/adsbcot/.defaults_applied -exit 0 \ No newline at end of file diff --git a/package/adsbtocot/files/adsbcot.ini b/package/adsbtocot/files/adsbcot.ini deleted file mode 100644 index e010d9dd66..0000000000 --- a/package/adsbtocot/files/adsbcot.ini +++ /dev/null @@ -1,9 +0,0 @@ -[pytak] -# Multicast CoT out to your ATAK mesh -COT_URL = udp+wo://239.2.3.1:6969 -COT_STALE = 120 -COT_HEADER = TAK-ADSB - -[adsbcot] -FEED_URL = file:///var/run/dump1090/aircraft.json -IDENT = OPENMANET-ADSB01 \ No newline at end of file diff --git a/package/adsbtocot/files/adsbcot.init b/package/adsbtocot/files/adsbcot.init deleted file mode 100644 index 75d03a4203..0000000000 --- a/package/adsbtocot/files/adsbcot.init +++ /dev/null @@ -1,47 +0,0 @@ -#!/bin/sh /etc/rc.common -START=95 -USE_PROCD=1 - -PROG="/usr/bin/adsbcot" -CONF="/etc/adsbcot/adsbcot.ini" -IFACE_DEV="br-ahwlan" - -# optional: restart when the config file changes -service_triggers() { - procd_add_reload_trigger adsbcot - procd_add_jail_mount "$CONF" - procd_add_config_trigger "config.change" adsbcot /etc/init.d/adsbcot reload -} - -get_iface_ipv4() { - # Extract first IPv4 on the bridge device (strip cidr) - ip -4 addr show dev "$IFACE_DEV" 2>/dev/null \ - | awk '/inet /{print $2; exit}' \ - | cut -d/ -f1 -} - -start_service() { - local ip - ip="$(get_iface_ipv4)" - - if [ -z "$ip" ]; then - logger -t adsbcot "No IPv4 found on $IFACE_DEV; not setting PYTAK_MULTICAST_LOCAL_ADDR" - fi - - procd_open_instance - procd_set_param command "$PROG" -c "$CONF" - # Export env var if we have it - [ -n "$ip" ] && procd_set_param env PYTAK_MULTICAST_LOCAL_ADDR="$ip" - - # Restart on crash: 5s min, 10s max, 5 tries - procd_set_param respawn 5 10 5 - - # Log to logread - procd_set_param stdout 1 - procd_set_param stderr 1 - - # Re-run if the config file changes - procd_set_param file "$CONF" - - procd_close_instance -} diff --git a/package/alfred-openmanet/Config.in b/package/alfred-openmanet/Config.in deleted file mode 100644 index 810b746cd8..0000000000 --- a/package/alfred-openmanet/Config.in +++ /dev/null @@ -1,22 +0,0 @@ -config ALFRED_NEEDS_lua - bool - -config ALFRED_NEEDS_libgps - bool - -config PACKAGE_ALFRED_VIS - bool "enable vis server for alfred" - depends on PACKAGE_alfred - default y - -config PACKAGE_ALFRED_BATHOSTS - bool "enable autogeneration of /etc/bat-hosts" - depends on PACKAGE_alfred - select ALFRED_NEEDS_lua - default y - -config PACKAGE_ALFRED_GPSD - bool "enable gpsd service for alfred" - depends on PACKAGE_alfred - select ALFRED_NEEDS_libgps - default y \ No newline at end of file diff --git a/package/alfred-openmanet/Makefile b/package/alfred-openmanet/Makefile deleted file mode 100644 index 2282f59935..0000000000 --- a/package/alfred-openmanet/Makefile +++ /dev/null @@ -1,84 +0,0 @@ -# SPDX-License-Identifier: GPL-2.0-only - -include $(TOPDIR)/rules.mk - -PKG_NAME:=alfred -PKG_VERSION:=2023.1 -PKG_RELEASE:=1 - -PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz -PKG_SOURCE_URL:=https://downloads.open-mesh.org/batman/releases/batman-adv-$(PKG_VERSION) -PKG_HASH:=438048248f373757d3a8bde7cbc6db6685f4d0105d130da2f5a54f29090c6974 - -PKG_MAINTAINER:=Simon Wunderlich -PKG_LICENSE:=GPL-2.0-only MIT -PKG_LICENSE_FILES:=LICENSES/preferred/GPL-2.0 LICENSES/preferred/MIT - -PKG_BUILD_PARALLEL:=1 -PKG_BUILD_FLAGS:=gc-sections lto - -PKG_CONFIG_DEPENDS += \ - CONFIG_ALFRED_NEEDS_lua \ - CONFIG_ALFRED_NEEDS_libgps \ - CONFIG_PACKAGE_ALFRED_VIS \ - CONFIG_PACKAGE_ALFRED_BATHOSTS \ - CONFIG_PACKAGE_ALFRED_GPSD - -include $(INCLUDE_DIR)/package.mk - -define Package/alfred - SECTION:=net - CATEGORY:=Network - TITLE:=A.L.F.R.E.D. - Almighty Lightweight Fact Remote Exchange Daemon - URL:=https://www.open-mesh.org/ - DEPENDS:= +libc @IPV6 +libnl-tiny +librt \ - +ALFRED_NEEDS_lua:lua \ - +ALFRED_NEEDS_libgps:libgps -endef - -define Package/alfred/description - alfred is a user space daemon for distributing arbitrary local information - over the mesh/network in a decentralized fashion. This data can be anything - which appears to be useful - originally designed to replace the batman-adv - visualization (vis), you may distribute hostnames, phone books, administration - information, DNS information, the local weather forecast ... - - alfred runs as daemon in the background of the system. A user may insert - information by using the alfred binary on the command line, or use special - programs to communicate with alfred (done via unix sockets). alfred then takes - care of distributing the local information to other alfred servers on other - nodes. This is done via IPv6 link-local multicast, and does not require any - configuration. A user can request data from alfred, and will receive the - information available from all alfred servers in the network. -endef - -define Package/alfred/conffiles -/etc/config/alfred -endef - -define Package/alfred/config - source "$(SOURCE)/Config.in" -endef - -MAKE_FLAGS += \ - CONFIG_ALFRED_VIS=$(if $(CONFIG_PACKAGE_ALFRED_VIS),y,n) \ - CONFIG_ALFRED_GPSD=$(if $(CONFIG_PACKAGE_ALFRED_GPSD),y,n) \ - CONFIG_ALFRED_CAPABILITIES=n \ - LIBNL_NAME="libnl-tiny" \ - LIBNL_GENL_NAME="libnl-tiny" \ - REVISION="$(PKG_VERSION)-openwrt-$(PKG_RELEASE)" - -define Package/alfred/install - $(INSTALL_DIR) $(1)/usr/sbin - cp -fpR $(PKG_BUILD_DIR)/alfred $(1)/usr/sbin/ - [ "x$(CONFIG_PACKAGE_ALFRED_VIS)" == "xy" ] && cp -fpR $(PKG_BUILD_DIR)/vis/batadv-vis $(1)/usr/sbin/ ; true - [ "x$(CONFIG_PACKAGE_ALFRED_GPSD)" == "xy" ] && cp -fpR $(PKG_BUILD_DIR)/gpsd/alfred-gpsd $(1)/usr/sbin/ ; true - $(INSTALL_DIR) $(1)/etc/init.d - $(INSTALL_BIN) ./files/alfred.init $(1)/etc/init.d/alfred - $(INSTALL_DIR) $(1)/etc/config - $(INSTALL_DATA) ./files/alfred.config $(1)/etc/config/alfred - $(INSTALL_DIR) $(1)/etc/alfred - [ "x$(CONFIG_PACKAGE_ALFRED_BATHOSTS)" == "xy" ] && $(INSTALL_BIN) ./files/bat-hosts.lua $(1)/etc/alfred/bat-hosts.lua ; true -endef - -$(eval $(call BuildPackage,alfred)) \ No newline at end of file diff --git a/package/alfred-openmanet/files/alfred.config b/package/alfred-openmanet/files/alfred.config deleted file mode 100644 index 4c9e2cb5dd..0000000000 --- a/package/alfred-openmanet/files/alfred.config +++ /dev/null @@ -1,6 +0,0 @@ -config 'alfred' 'alfred' - list interface 'br-ahwlan' - option mode 'master' - option batmanif 'bat0' - option start_vis '0' - option run_facters '1' diff --git a/package/alfred-openmanet/files/alfred.init b/package/alfred-openmanet/files/alfred.init deleted file mode 100644 index 6652a43ec6..0000000000 --- a/package/alfred-openmanet/files/alfred.init +++ /dev/null @@ -1,97 +0,0 @@ -#!/bin/sh /etc/rc.common - -# -# This is free software, licensed under the GNU General Public License v2. -# See /LICENSE for more information. -# - -START=99 -USE_PROCD=1 -alfred_args="" -vis_args="" -facters_dir="/etc/alfred" -enable=0 -vis_enable=0 - -append_interface() -{ - append "interfaces" "$1" "," -} - -alfred_start() { - local args="" - local section="$1" - local disabled interface mode - local interfaces - - # check if section is disabled - config_get_bool disabled "$section" disabled 0 - [ $disabled = 0 ] || return 1 - - args="-f" - - config_list_foreach "$section" "interface" append_interface - if [ -z "$interfaces" ]; then - config_get interface "$section" interface - append_interface "$interface" - fi - append args "-i $interfaces" - - config_get mode "$section" mode - [ "$mode" = "master" ] && append args "-m" - - config_get batmanif "$section" batmanif - append args "-b $batmanif" - - append alfred_args "$args" - enable=1 - - config_get_bool start_vis "$section" start_vis 0 - if [ "$start_vis" = 1 ] && [ -x /usr/sbin/batadv-vis ]; then - vis_enable=1 - append vis_args "-i $batmanif -s" - fi - - config_get_bool run_facters "$section" run_facters 0 - - return 0 -} - -start_service() { - config_load "alfred" - config_foreach alfred_start alfred - - [ "$enable" = "0" ] && return 0 - - procd_open_instance "alfred" - procd_set_param command /usr/sbin/alfred - procd_append_param command ${alfred_args} - procd_close_instance - - [ "$vis_enable" = "1" ] && { - procd_open_instance "batadv-vis" - procd_set_param command /usr/sbin/batadv-vis - procd_append_param command ${vis_args} - procd_close_instance - } - - [ "$run_facters" = "1" ] && { - ( for file in $facters_dir/* ; do [ -x $file ] && $file ; done ) - if ! ( grep -q "for file in $facters_dir/\* ; do " /etc/crontabs/root 2>/dev/null ) ; then - echo "*/5 * * * * ( for file in $facters_dir/* ; do [ -x \$file ] && \$file ; done )" >> /etc/crontabs/root - /etc/init.d/cron enable - /etc/init.d/cron restart - fi - } -} - -service_triggers() { - procd_add_reload_trigger "alfred" -} - -stop_service() { - [ -e /etc/crontabs/root ] && { - sed "\|for file in $facters_dir/\* ; do |d" -i /etc/crontabs/root - /etc/init.d/cron restart - } -} \ No newline at end of file diff --git a/package/alfred-openmanet/files/bat-hosts.lua b/package/alfred-openmanet/files/bat-hosts.lua deleted file mode 100644 index bcfe72be66..0000000000 --- a/package/alfred-openmanet/files/bat-hosts.lua +++ /dev/null @@ -1,114 +0,0 @@ -#!/usr/bin/lua - -local type_id = 64 -- bat-hosts - -function get_hostname() - local hostfile = io.open("/proc/sys/kernel/hostname", "r") - local ret_string = hostfile:read() - hostfile:close() - return ret_string -end - -function get_interfaces_names() - local ret = {} - - for name in io.popen("ls -1 /sys/class/net/"):lines() do - table.insert(ret, name) - end - - return ret -end - -function get_interface_address(name) - local addressfile = io.open("/sys/class/net/"..name.."/address", "r") - local ret_string = addressfile:read() - addressfile:close() - return ret_string -end - - -local function generate_bat_hosts() --- get hostname and interface macs/names --- then return a table containing valid bat-hosts lines - local n, i - local ifaces, ret = {}, {} - - local hostname = get_hostname() - - for n, i in ipairs(get_interfaces_names()) do - local address = get_interface_address(i) - if not ifaces[address] then ifaces[address] = i end - end - - for mac, iname in pairs(ifaces) do - -- Don't add invalid MAC addresses - -- Don't add morse0 MAC addresses (12:00:00:00:00:00) - if mac:match("^%x%x:%x%x:%x%x:%x%x:%x%x:%x%x$") and not mac:match("00:00:00:00:00:00") and not mac:match("12:00:00:00:00:00") then - table.insert(ret, mac.." "..hostname.."_"..iname.."\n") - end - end - - return ret -end - -local function publish_bat_hosts() --- pass a raw chunk of data to alfred - local fd = io.popen("alfred -s " .. type_id, "w") - if fd then - local ret = generate_bat_hosts() - if ret then - fd:write(table.concat(ret)) - end - fd:close() - end -end - -local function write_bat_hosts(rows) - local content = { "### /tmp/bat-hosts generated by alfred-bat-hosts\n", - "### /!\\ This file is overwritten every 5 minutes /!\\\n", - "### (To keep manual changes, replace /etc/bat-hosts symlink with a static file)\n" } - - -- merge the chunks from all nodes, de-escaping newlines - for _, row in ipairs(rows) do - local node, value = unpack(row) - table.insert(content, "# Node ".. node .. "\n") - table.insert(content, value:gsub("\x0a", "\n") .. "\n") - end - - -- write parsed content down to disk - local fd = io.open("/tmp/bat-hosts", "w") - if fd then - fd:write(table.concat(content)) - fd:close() - end - - -- try to make a symlink in /etc pointing to /tmp, - -- if it exists, ln will do nothing. - os.execute("ln -ns /tmp/bat-hosts /etc/bat-hosts 2>/dev/null") -end - -local function receive_bat_hosts() --- read raw chunks from alfred, convert them to a nested table and call write_bat_hosts --- "alfred -r" can fail in slave nodes (returns empty stdout), so: --- check output is not null before writing /tmp/bat-hosts, and retry 3 times before giving up. - for n = 1, 3 do - local fd = io.popen("alfred -r " .. type_id) - --[[ this command returns something like - { "54:e6:fc:b9:cb:37", "00:11:22:33:44:55 ham_wlan0\x0a00:22:33:22:33:22 ham_eth0\x0a" }, - { "90:f6:52:bb:ec:57", "00:22:33:22:33:23 spam\x0a" }, - ]]-- - - if fd then - local output = fd:read("*a") - fd:close() - if output and output ~= "" then - assert(loadstring("rows = {" .. output .. "}"))() - write_bat_hosts(rows) - break - end - end - end -end - -publish_bat_hosts() -receive_bat_hosts() \ No newline at end of file diff --git a/target/linux/bcm27xx/base-files/etc/config/gpsd b/target/linux/bcm27xx/base-files/etc/config/gpsd deleted file mode 100644 index 05966ab739..0000000000 --- a/target/linux/bcm27xx/base-files/etc/config/gpsd +++ /dev/null @@ -1,5 +0,0 @@ -config gpsd 'core' - option enabled '1' - option device '/dev/ttyS0' - option port '2947' - option listen_globally '0' From 9221efc4b243585d7c78501043378ce11d15cee4 Mon Sep 17 00:00:00 2001 From: Corey Wagehoft Date: Wed, 12 Nov 2025 17:53:40 -0700 Subject: [PATCH 02/37] version --- boards/common/morse_diffconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/boards/common/morse_diffconfig b/boards/common/morse_diffconfig index c0666ab66d..9ca90880f8 100644 --- a/boards/common/morse_diffconfig +++ b/boards/common/morse_diffconfig @@ -7,6 +7,6 @@ CONFIG_VERSIONOPT=y CONFIG_VERSION_MANUFACTURER="MorseMicro" CONFIG_VERSION_MANUFACTURER_URL="https://www.morsemicro.com/" CONFIG_VERSION_CODE_FILENAMES=y -CONFIG_VERSION_CODE="Morse-2.8.5" +CONFIG_VERSION_CODE="OpenMANET-1.5.0" # Disable ext4 image creation. CONFIG_TARGET_ROOTFS_EXT4FS=n From 70984dc22ebcfe6ac37dfcb850e75dbb66e13c7e Mon Sep 17 00:00:00 2001 From: Corey Wagehoft Date: Wed, 12 Nov 2025 19:53:30 -0700 Subject: [PATCH 03/37] update packages --- boards/common/morse_diffconfig | 2 +- boards/common_extras/utils_diffconfig | 15 ++------------- feeds.conf.default | 2 +- 3 files changed, 4 insertions(+), 15 deletions(-) diff --git a/boards/common/morse_diffconfig b/boards/common/morse_diffconfig index 9ca90880f8..78c5300991 100644 --- a/boards/common/morse_diffconfig +++ b/boards/common/morse_diffconfig @@ -7,6 +7,6 @@ CONFIG_VERSIONOPT=y CONFIG_VERSION_MANUFACTURER="MorseMicro" CONFIG_VERSION_MANUFACTURER_URL="https://www.morsemicro.com/" CONFIG_VERSION_CODE_FILENAMES=y -CONFIG_VERSION_CODE="OpenMANET-1.5.0" +CONFIG_VERSION_CODE="1.4.1" # Disable ext4 image creation. CONFIG_TARGET_ROOTFS_EXT4FS=n diff --git a/boards/common_extras/utils_diffconfig b/boards/common_extras/utils_diffconfig index 6db2aa7e40..49b97bc1a6 100644 --- a/boards/common_extras/utils_diffconfig +++ b/boards/common_extras/utils_diffconfig @@ -24,17 +24,6 @@ CONFIG_PACKAGE_nano-full=y # LuCI packages CONFIG_PACKAGE_luci-app-morseupgrade=y -# Intel Wifi -CONFIG_PACKAGE_iwlwifi-firmware-ax210=y -CONFIG_PACKAGE_iwlwifi-firmware-ax200=y -CONFIG_PACKAGE_kmod-iwlwifi=y - -# Qualcomm Atheros Wifi -CONFIG_PACKAGE_kmod-owl-loader=y -CONFIG_PACKAGE_ath11k-firmware-wcn6855=y -CONFIG_PACKAGE_kmod-ath11k=y -CONFIG_PACKAGE_kmod-ath11k-pci=y - -CONFIG_PACKAGE_ath10k-firmware-qca6174=y -CONFIG_PACKAGE_kmod-ath10k=y +# Wifi +CONFIG_PACKAGE_wifi-openmanet=y diff --git a/feeds.conf.default b/feeds.conf.default index 0c825f0b06..df0e0ac3f4 100644 --- a/feeds.conf.default +++ b/feeds.conf.default @@ -2,6 +2,6 @@ src-git packages https://github.com/openwrt/packages.git^b5ed85f6e94aa08de143327 src-git routing https://github.com/openwrt/routing.git^e351d1e623e9ef2ab78f28cb1ce8d271d28c902d src-git telephony https://github.com/openwrt/telephony.git^98c8a5aa4624312ed758e2e2b6d4039050a1649d src-git luci https://github.com/MorseMicro/luci.git^fb7dfe08d55650bbb4078cf4ceb472697eb82ba9 -src-git openmanet https://github.com/OpenMANET/packages^ee89de955def736d20ebe64f8e4432ae90c326cb +src-git openmanet https://github.com/OpenMANET/packages^be8bb9aa1d0c99cb8203574af706e846ee93503c src-git morse https://github.com/OpenMANET/morse-feed^dbf6421d02e876fd221a1c43b5e2050bc8514f9a src-git prpl https://github.com/MorseMicro/feed-prpl.git^0542e586dd4698b41da335293501e890541bd74b From 17a1a9170e34e0c81947908005d49d4f17ea02d3 Mon Sep 17 00:00:00 2001 From: Corey Wagehoft Date: Wed, 12 Nov 2025 19:57:52 -0700 Subject: [PATCH 04/37] fixes --- feeds.conf.default | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/feeds.conf.default b/feeds.conf.default index df0e0ac3f4..0d59b48277 100644 --- a/feeds.conf.default +++ b/feeds.conf.default @@ -2,6 +2,6 @@ src-git packages https://github.com/openwrt/packages.git^b5ed85f6e94aa08de143327 src-git routing https://github.com/openwrt/routing.git^e351d1e623e9ef2ab78f28cb1ce8d271d28c902d src-git telephony https://github.com/openwrt/telephony.git^98c8a5aa4624312ed758e2e2b6d4039050a1649d src-git luci https://github.com/MorseMicro/luci.git^fb7dfe08d55650bbb4078cf4ceb472697eb82ba9 -src-git openmanet https://github.com/OpenMANET/packages^be8bb9aa1d0c99cb8203574af706e846ee93503c +src-git openmanet https://github.com/OpenMANET/packages^bf1ca4588d82a2c7e8f84ad315809d1313a4177a src-git morse https://github.com/OpenMANET/morse-feed^dbf6421d02e876fd221a1c43b5e2050bc8514f9a src-git prpl https://github.com/MorseMicro/feed-prpl.git^0542e586dd4698b41da335293501e890541bd74b From c8a5b5689cfb4beeb4cd59f48ee9e6d9f95fc8e2 Mon Sep 17 00:00:00 2001 From: Corey Wagehoft Date: Wed, 12 Nov 2025 20:00:06 -0700 Subject: [PATCH 05/37] update feed commit --- feeds.conf.default | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/feeds.conf.default b/feeds.conf.default index 0d59b48277..069cfc8820 100644 --- a/feeds.conf.default +++ b/feeds.conf.default @@ -2,6 +2,6 @@ src-git packages https://github.com/openwrt/packages.git^b5ed85f6e94aa08de143327 src-git routing https://github.com/openwrt/routing.git^e351d1e623e9ef2ab78f28cb1ce8d271d28c902d src-git telephony https://github.com/openwrt/telephony.git^98c8a5aa4624312ed758e2e2b6d4039050a1649d src-git luci https://github.com/MorseMicro/luci.git^fb7dfe08d55650bbb4078cf4ceb472697eb82ba9 -src-git openmanet https://github.com/OpenMANET/packages^bf1ca4588d82a2c7e8f84ad315809d1313a4177a +src-git openmanet https://github.com/OpenMANET/packages^2b7c6287a91332a6f2b8192e6bbc39538273f36e src-git morse https://github.com/OpenMANET/morse-feed^dbf6421d02e876fd221a1c43b5e2050bc8514f9a src-git prpl https://github.com/MorseMicro/feed-prpl.git^0542e586dd4698b41da335293501e890541bd74b From fb5de48d8865250407bd04ebb69530db439733a8 Mon Sep 17 00:00:00 2001 From: Corey Wagehoft Date: Thu, 13 Nov 2025 16:03:21 -0700 Subject: [PATCH 06/37] chore: update feed commit --- feeds.conf.default | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/feeds.conf.default b/feeds.conf.default index 069cfc8820..b0e6495212 100644 --- a/feeds.conf.default +++ b/feeds.conf.default @@ -2,6 +2,6 @@ src-git packages https://github.com/openwrt/packages.git^b5ed85f6e94aa08de143327 src-git routing https://github.com/openwrt/routing.git^e351d1e623e9ef2ab78f28cb1ce8d271d28c902d src-git telephony https://github.com/openwrt/telephony.git^98c8a5aa4624312ed758e2e2b6d4039050a1649d src-git luci https://github.com/MorseMicro/luci.git^fb7dfe08d55650bbb4078cf4ceb472697eb82ba9 -src-git openmanet https://github.com/OpenMANET/packages^2b7c6287a91332a6f2b8192e6bbc39538273f36e +src-git openmanet https://github.com/OpenMANET/packages^495dba8c64787581843340bcdd0d710da3902e8e src-git morse https://github.com/OpenMANET/morse-feed^dbf6421d02e876fd221a1c43b5e2050bc8514f9a src-git prpl https://github.com/MorseMicro/feed-prpl.git^0542e586dd4698b41da335293501e890541bd74b From 087b6318ced29ca4418704f62725f0afea7be031 Mon Sep 17 00:00:00 2001 From: Corey Wagehoft Date: Thu, 13 Nov 2025 16:04:11 -0700 Subject: [PATCH 07/37] add package --- boards/common/openmanet_diffconfig | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/boards/common/openmanet_diffconfig b/boards/common/openmanet_diffconfig index 58b0d12b01..97d62d4848 100644 --- a/boards/common/openmanet_diffconfig +++ b/boards/common/openmanet_diffconfig @@ -132,4 +132,5 @@ CONFIG_PACKAGE_rtl-sdr=y # OpenMANET specific packages CONFIG_PACKAGE_alfred-openmanet=y -CONFIG_PACKAGE_gpsd-openmanet=y \ No newline at end of file +CONFIG_PACKAGE_gpsd-openmanet=y +CONFIG_PACKAGE_mdns-openmanet=y From ee0682a6a8c9511a2d537c3e07c5654c6b2f3e6a Mon Sep 17 00:00:00 2001 From: Corey Wagehoft Date: Thu, 13 Nov 2025 17:25:40 -0700 Subject: [PATCH 08/37] update feed --- boards/common/morse_diffconfig | 2 +- feeds.conf.default | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/boards/common/morse_diffconfig b/boards/common/morse_diffconfig index 78c5300991..9d6c3f7589 100644 --- a/boards/common/morse_diffconfig +++ b/boards/common/morse_diffconfig @@ -7,6 +7,6 @@ CONFIG_VERSIONOPT=y CONFIG_VERSION_MANUFACTURER="MorseMicro" CONFIG_VERSION_MANUFACTURER_URL="https://www.morsemicro.com/" CONFIG_VERSION_CODE_FILENAMES=y -CONFIG_VERSION_CODE="1.4.1" +CONFIG_VERSION_CODE="openmanet-1.4.1" # Disable ext4 image creation. CONFIG_TARGET_ROOTFS_EXT4FS=n diff --git a/feeds.conf.default b/feeds.conf.default index b0e6495212..0a21a0c33d 100644 --- a/feeds.conf.default +++ b/feeds.conf.default @@ -2,6 +2,6 @@ src-git packages https://github.com/openwrt/packages.git^b5ed85f6e94aa08de143327 src-git routing https://github.com/openwrt/routing.git^e351d1e623e9ef2ab78f28cb1ce8d271d28c902d src-git telephony https://github.com/openwrt/telephony.git^98c8a5aa4624312ed758e2e2b6d4039050a1649d src-git luci https://github.com/MorseMicro/luci.git^fb7dfe08d55650bbb4078cf4ceb472697eb82ba9 -src-git openmanet https://github.com/OpenMANET/packages^495dba8c64787581843340bcdd0d710da3902e8e +src-git openmanet https://github.com/OpenMANET/packages^c00378db2c9fa61846e31b20e69c01c1f461bf38 src-git morse https://github.com/OpenMANET/morse-feed^dbf6421d02e876fd221a1c43b5e2050bc8514f9a src-git prpl https://github.com/MorseMicro/feed-prpl.git^0542e586dd4698b41da335293501e890541bd74b From 0a241499b4024e5fcdf1f1ae51bb1b1764089339 Mon Sep 17 00:00:00 2001 From: Corey Wagehoft Date: Fri, 14 Nov 2025 17:30:21 -0700 Subject: [PATCH 09/37] feed update --- feeds.conf.default | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/feeds.conf.default b/feeds.conf.default index 0a21a0c33d..f9ad26c48e 100644 --- a/feeds.conf.default +++ b/feeds.conf.default @@ -2,6 +2,6 @@ src-git packages https://github.com/openwrt/packages.git^b5ed85f6e94aa08de143327 src-git routing https://github.com/openwrt/routing.git^e351d1e623e9ef2ab78f28cb1ce8d271d28c902d src-git telephony https://github.com/openwrt/telephony.git^98c8a5aa4624312ed758e2e2b6d4039050a1649d src-git luci https://github.com/MorseMicro/luci.git^fb7dfe08d55650bbb4078cf4ceb472697eb82ba9 -src-git openmanet https://github.com/OpenMANET/packages^c00378db2c9fa61846e31b20e69c01c1f461bf38 +src-git openmanet https://github.com/OpenMANET/packages^1a7a35a7953bc5529b292d0290df7a26778cad3a src-git morse https://github.com/OpenMANET/morse-feed^dbf6421d02e876fd221a1c43b5e2050bc8514f9a src-git prpl https://github.com/MorseMicro/feed-prpl.git^0542e586dd4698b41da335293501e890541bd74b From d7885dbfb8adea7ef87406f5d399f2ae5a45ac42 Mon Sep 17 00:00:00 2001 From: Corey Wagehoft Date: Fri, 14 Nov 2025 18:24:27 -0700 Subject: [PATCH 10/37] update feed --- boards/common/openmanet_diffconfig | 4 +--- feeds.conf.default | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/boards/common/openmanet_diffconfig b/boards/common/openmanet_diffconfig index 97d62d4848..13344e58df 100644 --- a/boards/common/openmanet_diffconfig +++ b/boards/common/openmanet_diffconfig @@ -131,6 +131,4 @@ CONFIG_PACKAGE_dump1090=y CONFIG_PACKAGE_rtl-sdr=y # OpenMANET specific packages -CONFIG_PACKAGE_alfred-openmanet=y -CONFIG_PACKAGE_gpsd-openmanet=y -CONFIG_PACKAGE_mdns-openmanet=y +CONFIG_PACKAGE_nettools-openmanet=y diff --git a/feeds.conf.default b/feeds.conf.default index f9ad26c48e..7ff16bb36a 100644 --- a/feeds.conf.default +++ b/feeds.conf.default @@ -2,6 +2,6 @@ src-git packages https://github.com/openwrt/packages.git^b5ed85f6e94aa08de143327 src-git routing https://github.com/openwrt/routing.git^e351d1e623e9ef2ab78f28cb1ce8d271d28c902d src-git telephony https://github.com/openwrt/telephony.git^98c8a5aa4624312ed758e2e2b6d4039050a1649d src-git luci https://github.com/MorseMicro/luci.git^fb7dfe08d55650bbb4078cf4ceb472697eb82ba9 -src-git openmanet https://github.com/OpenMANET/packages^1a7a35a7953bc5529b292d0290df7a26778cad3a +src-git openmanet https://github.com/OpenMANET/packages^3cc5ae324379d06f9282d91c0d33484687e9f6dc src-git morse https://github.com/OpenMANET/morse-feed^dbf6421d02e876fd221a1c43b5e2050bc8514f9a src-git prpl https://github.com/MorseMicro/feed-prpl.git^0542e586dd4698b41da335293501e890541bd74b From 629a984336aef5b9e2e3a4ed6d52385c98ce9381 Mon Sep 17 00:00:00 2001 From: Corey Wagehoft Date: Fri, 14 Nov 2025 18:30:48 -0700 Subject: [PATCH 11/37] update feed --- feeds.conf.default | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/feeds.conf.default b/feeds.conf.default index 7ff16bb36a..9e0e13a27a 100644 --- a/feeds.conf.default +++ b/feeds.conf.default @@ -2,6 +2,6 @@ src-git packages https://github.com/openwrt/packages.git^b5ed85f6e94aa08de143327 src-git routing https://github.com/openwrt/routing.git^e351d1e623e9ef2ab78f28cb1ce8d271d28c902d src-git telephony https://github.com/openwrt/telephony.git^98c8a5aa4624312ed758e2e2b6d4039050a1649d src-git luci https://github.com/MorseMicro/luci.git^fb7dfe08d55650bbb4078cf4ceb472697eb82ba9 -src-git openmanet https://github.com/OpenMANET/packages^3cc5ae324379d06f9282d91c0d33484687e9f6dc +src-git openmanet https://github.com/OpenMANET/packages^4b4d86dd6c67629c8cc2d09dbf6c8b2abd88a6f9 src-git morse https://github.com/OpenMANET/morse-feed^dbf6421d02e876fd221a1c43b5e2050bc8514f9a src-git prpl https://github.com/MorseMicro/feed-prpl.git^0542e586dd4698b41da335293501e890541bd74b From b58eb9c26ed94de3e87e1256f37d06f3da5e57b7 Mon Sep 17 00:00:00 2001 From: Corey Wagehoft Date: Fri, 14 Nov 2025 18:36:41 -0700 Subject: [PATCH 12/37] update feed --- feeds.conf.default | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/feeds.conf.default b/feeds.conf.default index 9e0e13a27a..c6f21240ab 100644 --- a/feeds.conf.default +++ b/feeds.conf.default @@ -2,6 +2,6 @@ src-git packages https://github.com/openwrt/packages.git^b5ed85f6e94aa08de143327 src-git routing https://github.com/openwrt/routing.git^e351d1e623e9ef2ab78f28cb1ce8d271d28c902d src-git telephony https://github.com/openwrt/telephony.git^98c8a5aa4624312ed758e2e2b6d4039050a1649d src-git luci https://github.com/MorseMicro/luci.git^fb7dfe08d55650bbb4078cf4ceb472697eb82ba9 -src-git openmanet https://github.com/OpenMANET/packages^4b4d86dd6c67629c8cc2d09dbf6c8b2abd88a6f9 +src-git openmanet https://github.com/OpenMANET/packages^0918218a3c1aa8134a4043bdbcf5936a8767e588 src-git morse https://github.com/OpenMANET/morse-feed^dbf6421d02e876fd221a1c43b5e2050bc8514f9a src-git prpl https://github.com/MorseMicro/feed-prpl.git^0542e586dd4698b41da335293501e890541bd74b From ce0246243cf2bcb3f9054dc07339da57c32fe303 Mon Sep 17 00:00:00 2001 From: Corey Wagehoft Date: Fri, 14 Nov 2025 18:39:03 -0700 Subject: [PATCH 13/37] feed --- feeds.conf.default | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/feeds.conf.default b/feeds.conf.default index c6f21240ab..edcffa6e0e 100644 --- a/feeds.conf.default +++ b/feeds.conf.default @@ -2,6 +2,6 @@ src-git packages https://github.com/openwrt/packages.git^b5ed85f6e94aa08de143327 src-git routing https://github.com/openwrt/routing.git^e351d1e623e9ef2ab78f28cb1ce8d271d28c902d src-git telephony https://github.com/openwrt/telephony.git^98c8a5aa4624312ed758e2e2b6d4039050a1649d src-git luci https://github.com/MorseMicro/luci.git^fb7dfe08d55650bbb4078cf4ceb472697eb82ba9 -src-git openmanet https://github.com/OpenMANET/packages^0918218a3c1aa8134a4043bdbcf5936a8767e588 +src-git openmanet https://github.com/OpenMANET/packages^5f6cf0ccf9869ca907fbed61421bafc920c17fda src-git morse https://github.com/OpenMANET/morse-feed^dbf6421d02e876fd221a1c43b5e2050bc8514f9a src-git prpl https://github.com/MorseMicro/feed-prpl.git^0542e586dd4698b41da335293501e890541bd74b From f4412d9d371ee27ed90f0719f9322222b5035038 Mon Sep 17 00:00:00 2001 From: Corey Wagehoft Date: Fri, 14 Nov 2025 18:49:09 -0700 Subject: [PATCH 14/37] feed --- feeds.conf.default | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/feeds.conf.default b/feeds.conf.default index edcffa6e0e..7c440d1a43 100644 --- a/feeds.conf.default +++ b/feeds.conf.default @@ -2,6 +2,6 @@ src-git packages https://github.com/openwrt/packages.git^b5ed85f6e94aa08de143327 src-git routing https://github.com/openwrt/routing.git^e351d1e623e9ef2ab78f28cb1ce8d271d28c902d src-git telephony https://github.com/openwrt/telephony.git^98c8a5aa4624312ed758e2e2b6d4039050a1649d src-git luci https://github.com/MorseMicro/luci.git^fb7dfe08d55650bbb4078cf4ceb472697eb82ba9 -src-git openmanet https://github.com/OpenMANET/packages^5f6cf0ccf9869ca907fbed61421bafc920c17fda +src-git openmanet https://github.com/OpenMANET/packages^87889dba171e6ddd914d4645128483099d02f4ac src-git morse https://github.com/OpenMANET/morse-feed^dbf6421d02e876fd221a1c43b5e2050bc8514f9a src-git prpl https://github.com/MorseMicro/feed-prpl.git^0542e586dd4698b41da335293501e890541bd74b From 8cc2f93219bf5a7c63872e674fa675ba544cde6e Mon Sep 17 00:00:00 2001 From: Corey Wagehoft Date: Fri, 14 Nov 2025 18:54:29 -0700 Subject: [PATCH 15/37] updates --- boards/common/openmanet_diffconfig | 1 + feeds.conf.default | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/boards/common/openmanet_diffconfig b/boards/common/openmanet_diffconfig index 13344e58df..11503a9694 100644 --- a/boards/common/openmanet_diffconfig +++ b/boards/common/openmanet_diffconfig @@ -132,3 +132,4 @@ CONFIG_PACKAGE_rtl-sdr=y # OpenMANET specific packages CONFIG_PACKAGE_nettools-openmanet=y +CONFIG_PACKAGE_gpsd-openmanet=y diff --git a/feeds.conf.default b/feeds.conf.default index 7c440d1a43..47a5b0dd9f 100644 --- a/feeds.conf.default +++ b/feeds.conf.default @@ -2,6 +2,6 @@ src-git packages https://github.com/openwrt/packages.git^b5ed85f6e94aa08de143327 src-git routing https://github.com/openwrt/routing.git^e351d1e623e9ef2ab78f28cb1ce8d271d28c902d src-git telephony https://github.com/openwrt/telephony.git^98c8a5aa4624312ed758e2e2b6d4039050a1649d src-git luci https://github.com/MorseMicro/luci.git^fb7dfe08d55650bbb4078cf4ceb472697eb82ba9 -src-git openmanet https://github.com/OpenMANET/packages^87889dba171e6ddd914d4645128483099d02f4ac +src-git openmanet https://github.com/OpenMANET/packages^c73337987d179efad99e527b530c1c042e815198 src-git morse https://github.com/OpenMANET/morse-feed^dbf6421d02e876fd221a1c43b5e2050bc8514f9a src-git prpl https://github.com/MorseMicro/feed-prpl.git^0542e586dd4698b41da335293501e890541bd74b From 98231b310e28839138969dd78264d83612bcc133 Mon Sep 17 00:00:00 2001 From: Corey Wagehoft Date: Fri, 14 Nov 2025 18:58:11 -0700 Subject: [PATCH 16/37] feed --- feeds.conf.default | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/feeds.conf.default b/feeds.conf.default index 47a5b0dd9f..581204ba07 100644 --- a/feeds.conf.default +++ b/feeds.conf.default @@ -2,6 +2,6 @@ src-git packages https://github.com/openwrt/packages.git^b5ed85f6e94aa08de143327 src-git routing https://github.com/openwrt/routing.git^e351d1e623e9ef2ab78f28cb1ce8d271d28c902d src-git telephony https://github.com/openwrt/telephony.git^98c8a5aa4624312ed758e2e2b6d4039050a1649d src-git luci https://github.com/MorseMicro/luci.git^fb7dfe08d55650bbb4078cf4ceb472697eb82ba9 -src-git openmanet https://github.com/OpenMANET/packages^c73337987d179efad99e527b530c1c042e815198 +src-git openmanet https://github.com/OpenMANET/packages^3096713eb76c5fe460ea16274f086856b3ccc1b4 src-git morse https://github.com/OpenMANET/morse-feed^dbf6421d02e876fd221a1c43b5e2050bc8514f9a src-git prpl https://github.com/MorseMicro/feed-prpl.git^0542e586dd4698b41da335293501e890541bd74b From 55af4568f59d19e80ce356dc009a078e2f8085b8 Mon Sep 17 00:00:00 2001 From: Corey Wagehoft Date: Fri, 14 Nov 2025 19:00:44 -0700 Subject: [PATCH 17/37] re-enable wifi package --- boards/common/openmanet_diffconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/boards/common/openmanet_diffconfig b/boards/common/openmanet_diffconfig index 11503a9694..9fcedb5ff7 100644 --- a/boards/common/openmanet_diffconfig +++ b/boards/common/openmanet_diffconfig @@ -133,3 +133,4 @@ CONFIG_PACKAGE_rtl-sdr=y # OpenMANET specific packages CONFIG_PACKAGE_nettools-openmanet=y CONFIG_PACKAGE_gpsd-openmanet=y +CONFIG_PACKAGE_wifi-openmanet=y From 37321580d5d055616d8f8ba1a00a49a3764a1863 Mon Sep 17 00:00:00 2001 From: Corey Wagehoft Date: Sat, 15 Nov 2025 08:42:05 -0700 Subject: [PATCH 18/37] update feed --- boards/common/openmanet_diffconfig | 3 ++- feeds.conf.default | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/boards/common/openmanet_diffconfig b/boards/common/openmanet_diffconfig index 9fcedb5ff7..ef66ee21f0 100644 --- a/boards/common/openmanet_diffconfig +++ b/boards/common/openmanet_diffconfig @@ -131,6 +131,7 @@ CONFIG_PACKAGE_dump1090=y CONFIG_PACKAGE_rtl-sdr=y # OpenMANET specific packages -CONFIG_PACKAGE_nettools-openmanet=y +CONFIG_PACKAGE_alfred-openmanet=y +CONFIG_PACKAGE_mdns-openmanet=y CONFIG_PACKAGE_gpsd-openmanet=y CONFIG_PACKAGE_wifi-openmanet=y diff --git a/feeds.conf.default b/feeds.conf.default index 581204ba07..f25af189ba 100644 --- a/feeds.conf.default +++ b/feeds.conf.default @@ -2,6 +2,6 @@ src-git packages https://github.com/openwrt/packages.git^b5ed85f6e94aa08de143327 src-git routing https://github.com/openwrt/routing.git^e351d1e623e9ef2ab78f28cb1ce8d271d28c902d src-git telephony https://github.com/openwrt/telephony.git^98c8a5aa4624312ed758e2e2b6d4039050a1649d src-git luci https://github.com/MorseMicro/luci.git^fb7dfe08d55650bbb4078cf4ceb472697eb82ba9 -src-git openmanet https://github.com/OpenMANET/packages^3096713eb76c5fe460ea16274f086856b3ccc1b4 +src-git openmanet https://github.com/OpenMANET/packages^9549412f23cc150576fda22a894f800a09ab4e7d src-git morse https://github.com/OpenMANET/morse-feed^dbf6421d02e876fd221a1c43b5e2050bc8514f9a src-git prpl https://github.com/MorseMicro/feed-prpl.git^0542e586dd4698b41da335293501e890541bd74b From 1efb269394ebd93dc7382a5924e8007f7e8d5dc1 Mon Sep 17 00:00:00 2001 From: Corey Wagehoft Date: Sat, 15 Nov 2025 10:05:23 -0700 Subject: [PATCH 19/37] update feed --- feeds.conf.default | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/feeds.conf.default b/feeds.conf.default index f25af189ba..8e11573653 100644 --- a/feeds.conf.default +++ b/feeds.conf.default @@ -2,6 +2,6 @@ src-git packages https://github.com/openwrt/packages.git^b5ed85f6e94aa08de143327 src-git routing https://github.com/openwrt/routing.git^e351d1e623e9ef2ab78f28cb1ce8d271d28c902d src-git telephony https://github.com/openwrt/telephony.git^98c8a5aa4624312ed758e2e2b6d4039050a1649d src-git luci https://github.com/MorseMicro/luci.git^fb7dfe08d55650bbb4078cf4ceb472697eb82ba9 -src-git openmanet https://github.com/OpenMANET/packages^9549412f23cc150576fda22a894f800a09ab4e7d +src-git openmanet https://github.com/OpenMANET/packages^847aa01ed1b7d5d667ab0f1410e2793bad2b71fb src-git morse https://github.com/OpenMANET/morse-feed^dbf6421d02e876fd221a1c43b5e2050bc8514f9a src-git prpl https://github.com/MorseMicro/feed-prpl.git^0542e586dd4698b41da335293501e890541bd74b From e4ef7a3f048997a3af9220e9cd399760f866077e Mon Sep 17 00:00:00 2001 From: Corey Wagehoft Date: Sat, 15 Nov 2025 10:56:53 -0700 Subject: [PATCH 20/37] feed update --- boards/common/openmanet_diffconfig | 10 ++-- feeds.conf.default | 2 +- .../base-files/files/etc/init.d/mesh-routing | 53 ------------------- 3 files changed, 6 insertions(+), 59 deletions(-) delete mode 100644 package/base-files/files/etc/init.d/mesh-routing diff --git a/boards/common/openmanet_diffconfig b/boards/common/openmanet_diffconfig index ef66ee21f0..ba44c55fb4 100644 --- a/boards/common/openmanet_diffconfig +++ b/boards/common/openmanet_diffconfig @@ -107,8 +107,8 @@ CONFIG_PACKAGE_portaudio=y # # GPS Support # -CONFIG_PACKAGE_gpsd=y -CONFIG_PACKAGE_gpsd-clients=y +#CONFIG_PACKAGE_gpsd=y +#CONFIG_PACKAGE_gpsd-clients=y # Add USB Driver for Panda Wireless CONFIG_PACKAGE_kmod-rt2800-lib=y @@ -120,9 +120,9 @@ CONFIG_PACKAGE_golang=y CONFIG_PACKAGE_golang-src=y # B.A.T.M.A.N. Advanced Alfred -CONFIG_PACKAGE_ALFRED_GPSD=y -CONFIG_PACKAGE_ALFRED_BATHOSTS=y -CONFIG_PACKAGE_alfred=y +#CONFIG_PACKAGE_ALFRED_GPSD=y +#CONFIG_PACKAGE_ALFRED_BATHOSTS=y +#CONFIG_PACKAGE_alfred=y # Added for ADSB to COT CONFIG_PACKAGE_adsbtocot=y diff --git a/feeds.conf.default b/feeds.conf.default index 8e11573653..03e672759f 100644 --- a/feeds.conf.default +++ b/feeds.conf.default @@ -2,6 +2,6 @@ src-git packages https://github.com/openwrt/packages.git^b5ed85f6e94aa08de143327 src-git routing https://github.com/openwrt/routing.git^e351d1e623e9ef2ab78f28cb1ce8d271d28c902d src-git telephony https://github.com/openwrt/telephony.git^98c8a5aa4624312ed758e2e2b6d4039050a1649d src-git luci https://github.com/MorseMicro/luci.git^fb7dfe08d55650bbb4078cf4ceb472697eb82ba9 -src-git openmanet https://github.com/OpenMANET/packages^847aa01ed1b7d5d667ab0f1410e2793bad2b71fb +src-git openmanet https://github.com/OpenMANET/packages^d4f27972cffb780d2beffd8d8c3677de3a8a9af9 src-git morse https://github.com/OpenMANET/morse-feed^dbf6421d02e876fd221a1c43b5e2050bc8514f9a src-git prpl https://github.com/MorseMicro/feed-prpl.git^0542e586dd4698b41da335293501e890541bd74b diff --git a/package/base-files/files/etc/init.d/mesh-routing b/package/base-files/files/etc/init.d/mesh-routing deleted file mode 100644 index 8840966f04..0000000000 --- a/package/base-files/files/etc/init.d/mesh-routing +++ /dev/null @@ -1,53 +0,0 @@ -#!/bin/sh /etc/rc.common - -START=96 -STOP=10 - -USE_PROCD=1 - -start_service() { - # Enable cross-mesh client routing through batman-adv - logger "mesh-routing: Setting up cross-mesh client routes" - - # Wait for network services to be ready - sleep 45 - - # Add routes for cross-mesh connectivity - ( - # Wait for bat0 interface to be fully operational - local retry=0 - while [ $retry -lt 30 ]; do - if ip link show bat0 >/dev/null 2>&1 && ip addr show bat0; then - logger "mesh-routing: bat0 interface is ready" - break - fi - retry=$((retry + 1)) - logger "mesh-routing: Waiting for bat0 interface (attempt $retry/30)" - sleep 2 - done - - # Enable IP forwarding for cross-mesh client communication - echo 1 > /proc/sys/net/ipv4/ip_forward - logger "mesh-routing: IP forwarding enabled" - - # Add routing rules for 10.41.0.0/16 mesh client subnet - if ! ip route show | grep -q "10.41.0.0/16"; then - ip route add 10.41.0.0/16 dev bat0 metric 100 2>/dev/null || true - logger "mesh-routing: Added route for mesh client subnet" - fi - - # Enable multicast forwarding for batman-adv - echo 1 > /proc/sys/net/ipv4/conf/bat0/mc_forwarding 2>/dev/null || true - echo 1 > /proc/sys/net/ipv4/conf/br-ahwlan/mc_forwarding 2>/dev/null || true - - # Setup ARP proxying for cross-mesh client discovery - echo 1 > /proc/sys/net/ipv4/conf/bat0/proxy_arp 2>/dev/null || true - echo 1 > /proc/sys/net/ipv4/conf/br-ahwlan/proxy_arp 2>/dev/null || true - - logger "mesh-routing: Cross-mesh client routing configured" - ) & -} - -stop() { - logger "mesh-routing: Stopping mesh routing service" -} \ No newline at end of file From b8d82ee2f4a0e66affb71ca849abce1e204a2374 Mon Sep 17 00:00:00 2001 From: Corey Wagehoft Date: Sat, 15 Nov 2025 11:36:34 -0700 Subject: [PATCH 21/37] move custom packages into a folder in openwrt --- boards/common/openmanet_diffconfig | 37 +- feeds.conf.default | 1 - package/openmanet/adsbtocot/Makefile | 83 ++++ .../adsbtocot/files/99-adsb-defaults | 48 +++ package/openmanet/adsbtocot/files/adsbcot.ini | 9 + .../openmanet/adsbtocot/files/adsbcot.init | 47 ++ package/openmanet/alfred/Config.in | 22 + package/openmanet/alfred/Makefile | 87 ++++ package/openmanet/alfred/files/alfred.config | 7 + package/openmanet/alfred/files/alfred.init | 97 +++++ package/openmanet/alfred/files/bat-hosts.lua | 114 +++++ .../alfred/files/mesh-routing.config | 53 +++ .../openmanet/alfred/files/mesh-routing.init | 8 + package/openmanet/avahi/Makefile | 405 ++++++++++++++++++ .../openmanet/avahi/files/avahi-daemon.conf | 28 ++ .../openmanet/avahi/files/avahi-daemon.init | 18 + .../openmanet/avahi/files/netifd-autoip.sh | 20 + package/openmanet/avahi/files/service-http | 10 + package/openmanet/avahi/files/service-ssh | 9 + .../avahi/patches/010-pkgconfig.patch | 178 ++++++++ ...20-revert-runtime-dir-systemd-change.patch | 11 + .../100-p2p-no-iff_multicast-required.patch | 45 ++ ...00-Fix-NULL-pointer-crashes-from-175.patch | 136 ++++++ ...n-avahi-daemon-by-handling-HUP-event.patch | 36 ++ ...ume_uint32-fix-potential-undefined-b.patch | 27 ++ ...ble-timeout-cleanup-on-watch-cleanup.patch | 22 + ...or-if-requested-service-is-not-found.patch | 54 +++ .../patches/205-conf-file-line-lengths.patch | 11 + package/openmanet/gpsd/Makefile | 175 ++++++++ package/openmanet/gpsd/files/gpsd.config | 5 + package/openmanet/gpsd/files/gpsd.init | 47 ++ package/openmanet/openmanetd/Makefile | 57 +++ .../openmanetd/files/openmanetd.config | 5 + .../openmanetd/files/openmanetd.init | 39 ++ .../openmanetd/files/sample_config.yml | 1 + 35 files changed, 1941 insertions(+), 11 deletions(-) create mode 100644 package/openmanet/adsbtocot/Makefile create mode 100755 package/openmanet/adsbtocot/files/99-adsb-defaults create mode 100644 package/openmanet/adsbtocot/files/adsbcot.ini create mode 100644 package/openmanet/adsbtocot/files/adsbcot.init create mode 100644 package/openmanet/alfred/Config.in create mode 100644 package/openmanet/alfred/Makefile create mode 100644 package/openmanet/alfred/files/alfred.config create mode 100644 package/openmanet/alfred/files/alfred.init create mode 100644 package/openmanet/alfred/files/bat-hosts.lua create mode 100644 package/openmanet/alfred/files/mesh-routing.config create mode 100644 package/openmanet/alfred/files/mesh-routing.init create mode 100644 package/openmanet/avahi/Makefile create mode 100644 package/openmanet/avahi/files/avahi-daemon.conf create mode 100644 package/openmanet/avahi/files/avahi-daemon.init create mode 100755 package/openmanet/avahi/files/netifd-autoip.sh create mode 100644 package/openmanet/avahi/files/service-http create mode 100644 package/openmanet/avahi/files/service-ssh create mode 100644 package/openmanet/avahi/patches/010-pkgconfig.patch create mode 100644 package/openmanet/avahi/patches/020-revert-runtime-dir-systemd-change.patch create mode 100644 package/openmanet/avahi/patches/100-p2p-no-iff_multicast-required.patch create mode 100644 package/openmanet/avahi/patches/200-Fix-NULL-pointer-crashes-from-175.patch create mode 100644 package/openmanet/avahi/patches/201-Avoid-infinite-loop-in-avahi-daemon-by-handling-HUP-event.patch create mode 100644 package/openmanet/avahi/patches/202-avahi_dns_packet_consume_uint32-fix-potential-undefined-b.patch create mode 100644 package/openmanet/avahi/patches/203-Do-not-disable-timeout-cleanup-on-watch-cleanup.patch create mode 100644 package/openmanet/avahi/patches/204-Emit-error-if-requested-service-is-not-found.patch create mode 100644 package/openmanet/avahi/patches/205-conf-file-line-lengths.patch create mode 100644 package/openmanet/gpsd/Makefile create mode 100644 package/openmanet/gpsd/files/gpsd.config create mode 100644 package/openmanet/gpsd/files/gpsd.init create mode 100644 package/openmanet/openmanetd/Makefile create mode 100644 package/openmanet/openmanetd/files/openmanetd.config create mode 100644 package/openmanet/openmanetd/files/openmanetd.init create mode 100644 package/openmanet/openmanetd/files/sample_config.yml diff --git a/boards/common/openmanet_diffconfig b/boards/common/openmanet_diffconfig index ba44c55fb4..7eacc238cd 100644 --- a/boards/common/openmanet_diffconfig +++ b/boards/common/openmanet_diffconfig @@ -107,8 +107,8 @@ CONFIG_PACKAGE_portaudio=y # # GPS Support # -#CONFIG_PACKAGE_gpsd=y -#CONFIG_PACKAGE_gpsd-clients=y +CONFIG_PACKAGE_gpsd=y +CONFIG_PACKAGE_gpsd-clients=y # Add USB Driver for Panda Wireless CONFIG_PACKAGE_kmod-rt2800-lib=y @@ -120,9 +120,9 @@ CONFIG_PACKAGE_golang=y CONFIG_PACKAGE_golang-src=y # B.A.T.M.A.N. Advanced Alfred -#CONFIG_PACKAGE_ALFRED_GPSD=y -#CONFIG_PACKAGE_ALFRED_BATHOSTS=y -#CONFIG_PACKAGE_alfred=y +CONFIG_PACKAGE_ALFRED_GPSD=y +CONFIG_PACKAGE_ALFRED_BATHOSTS=y +CONFIG_PACKAGE_alfred=y # Added for ADSB to COT CONFIG_PACKAGE_adsbtocot=y @@ -130,8 +130,25 @@ CONFIG_PACKAGE_dump1090=y # (optional tools; dump1090 only needs librtlsdr, but these are handy) CONFIG_PACKAGE_rtl-sdr=y -# OpenMANET specific packages -CONFIG_PACKAGE_alfred-openmanet=y -CONFIG_PACKAGE_mdns-openmanet=y -CONFIG_PACKAGE_gpsd-openmanet=y -CONFIG_PACKAGE_wifi-openmanet=y +# mDNS / Avahi +CONFIG_PACKAGE_avahi-dbus-daemon=y +CONFIG_PACKAGE_avahi-daemon-service-http=y +CONFIG_PACKAGE_avahi-daemon-service-ssh=y +CONFIG_PACKAGE_avahi-utils=y + +# WIFI +CONFIG_PACKAGE_iwlwifi-firmware-ax210=y +CONFIG_PACKAGE_iwlwifi-firmware-ax200=y + +CONFIG_PACKAGE_kmod-owl-loader=y +CONFIG_PACKAGE_ath11k-firmware-wcn6855=y +CONFIG_PACKAGE_kmod-ath11k=y +CONFIG_PACKAGE_kmod-ath11k-pci=y +CONFIG_PACKAGE_ath10k-firmware-qca6174=y +CONFIG_PACKAGE_kmod-ath10k=y + +CONFIG_PACKAGE_kmod-mt7915-firmware=y +CONFIG_PACKAGE_kmod-mt7916-firmware=y +CONFIG_PACKAGE_kmod-mt7915e=y +CONFIG_PACKAGE_kmod-mt7921-firmware=y +CONFIG_PACKAGE_kmod-mt7921e=y \ No newline at end of file diff --git a/feeds.conf.default b/feeds.conf.default index 03e672759f..bccc9030dc 100644 --- a/feeds.conf.default +++ b/feeds.conf.default @@ -2,6 +2,5 @@ src-git packages https://github.com/openwrt/packages.git^b5ed85f6e94aa08de143327 src-git routing https://github.com/openwrt/routing.git^e351d1e623e9ef2ab78f28cb1ce8d271d28c902d src-git telephony https://github.com/openwrt/telephony.git^98c8a5aa4624312ed758e2e2b6d4039050a1649d src-git luci https://github.com/MorseMicro/luci.git^fb7dfe08d55650bbb4078cf4ceb472697eb82ba9 -src-git openmanet https://github.com/OpenMANET/packages^d4f27972cffb780d2beffd8d8c3677de3a8a9af9 src-git morse https://github.com/OpenMANET/morse-feed^dbf6421d02e876fd221a1c43b5e2050bc8514f9a src-git prpl https://github.com/MorseMicro/feed-prpl.git^0542e586dd4698b41da335293501e890541bd74b diff --git a/package/openmanet/adsbtocot/Makefile b/package/openmanet/adsbtocot/Makefile new file mode 100644 index 0000000000..a584ab85d2 --- /dev/null +++ b/package/openmanet/adsbtocot/Makefile @@ -0,0 +1,83 @@ +include $(TOPDIR)/rules.mk + +PKG_NAME:=adsbtocot +PKG_VERSION:=1 +PKG_RELEASE:=2 +PKG_MAINTAINER:=info@openmanet.net +PKG_LICENSE:=MIT +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME) +HOST_BUILD_DEPENDS:=python3/host +PKGARCH:=all + +include $(INCLUDE_DIR)/package.mk + +define Package/adsbtocot + SECTION:=utils + CATEGORY:=Utilities + TITLE:=ADS-B to Cursor-on-Target (ADSBCOT) for OpenWrt (dump1090 local) + DEPENDS:=+python3 +dump1090 +rtl-sdr +endef + +define Package/adsbtocot/description +Installs ADSBCOT from PyPI and provides a procd service to forward ADS-B tracks +from dump1090 to CoT/TAK (multicast or unicast). +endef + +# Persist user edits +define Package/adsbtocot/conffiles +/etc/adsbcot/adsbcot.ini +endef + +define Build/Prepare + mkdir -p $(PKG_BUILD_DIR) +endef + +# Vendor ADSBCOT as pure Python: +# - drop 'with_pymodes' to avoid numpy/ELF +# - disable aiohttp/yarl/multidict/frozenlist C-extensions +# - forbid wheels so pip builds pure-Python installs +define Build/Compile + AIOHTTP_NO_EXTENSIONS=1 \ + YARL_NO_EXTENSIONS=1 \ + MULTIDICT_NO_EXTENSIONS=1 \ + FROZENLIST_NO_EXTENSIONS=1 \ + PIP_NO_BINARY=:all: \ + $(STAGING_DIR_HOSTPKG)/bin/pip3 install 'adsbcot' \ + --prefix=/usr --root='$(PKG_INSTALL_DIR)' --no-cache-dir --no-compile + + # Safety: ensure no native .so crept in + find '$(PKG_INSTALL_DIR)/usr' -type f \( -name '*.so' -o -name '*.so.*' \) -print -delete || true +endef + +define Package/adsbtocot/install + # Config + init + $(INSTALL_DIR) $(1)/etc/adsbcot $(1)/etc/init.d + $(INSTALL_CONF) ./files/adsbcot.ini $(1)/etc/adsbcot/adsbcot.ini + $(INSTALL_BIN) ./files/adsbcot.init $(1)/etc/init.d/adsbcot + + # Python site-packages and console scripts + $(INSTALL_DIR) $(1)/usr + cp -a $(PKG_INSTALL_DIR)/usr/* $(1)/usr/ + + # Ensure no ELF in final image + find '$(1)/usr' -type f \( -name '*.so' -o -name '*.so.*' \) -print -delete || true + + # Normalize console-script shebangs to the target Python + [ -f "$(1)/usr/bin/adsbcot" ] && $(SED) '1s|^#!.*|#!/usr/bin/python3|' "$(1)/usr/bin/adsbcot" && chmod 0755 "$(1)/usr/bin/adsbcot" + for f in pytak aircot; do \ + if [ -f "$(1)/usr/bin/$$f" ]; then \ + $(SED) '1s|^#!.*|#!/usr/bin/python3|' "$(1)/usr/bin/$$f"; \ + chmod 0755 "$(1)/usr/bin/$$f"; \ + fi; \ + done + + # Trim caches to save space + find "$(1)/usr/lib/python3"* -name '__pycache__' -type d -exec rm -rf {} + 2>/dev/null || true + find "$(1)/usr/lib/python3"* -type f -name '*.pyc' -delete 2>/dev/null || true + + # First-boot defaults (gain, ports, etc.) + $(INSTALL_DIR) $(1)/etc/uci-defaults + $(INSTALL_BIN) ./files/99-adsb-defaults $(1)/etc/uci-defaults/99-adsb-defaults +endef + +$(eval $(call BuildPackage,adsbtocot)) diff --git a/package/openmanet/adsbtocot/files/99-adsb-defaults b/package/openmanet/adsbtocot/files/99-adsb-defaults new file mode 100755 index 0000000000..ab28969e59 --- /dev/null +++ b/package/openmanet/adsbtocot/files/99-adsb-defaults @@ -0,0 +1,48 @@ +#!/bin/sh +# /etc/uci-defaults/99-adsb-defaults +# Apply once on first boot +[ -f /etc/adsbcot/.defaults_applied ] && exit 0 + +# Ensure dump1090 JSON path exists +mkdir -p /var/run/dump1090 + +uci -q batch <<'EOF' +set dump1090.main=dump1090 +set dump1090.main.enabled='1' +set dump1090.main.disabled='0' + +# SDR + decoding +set dump1090.main.device_index='0' +set dump1090.main.gain='49.6' +set dump1090.main.no_fix='0' +set dump1090.main.fix='1' + +# JSON output only +set dump1090.main.write_json='/var/run/dump1090' +set dump1090.main.write_json_every='1' +delete dump1090.main.html_dir + +# *** Disable all dump1090 network sockets *** +set dump1090.main.net='0' +set dump1090.main.net_only='0' +delete dump1090.main.net_bind_address +delete dump1090.main.net_ri_port +delete dump1090.main.net_ro_port +delete dump1090.main.net_sbs_port +delete dump1090.main.net_bi_port +delete dump1090.main.net_bo_port +delete dump1090.main.net_heartbeat +delete dump1090.main.net_buffer +delete dump1090.main.net_verbatim +delete dump1090.main.forward_mlat + +commit dump1090 +EOF + +/etc/init.d/adsbcot stop +/etc/init.d/adsbcot disable +/etc/init.d/dump1090 stop +/etc/init.d/dump1090 disable + +touch /etc/adsbcot/.defaults_applied +exit 0 \ No newline at end of file diff --git a/package/openmanet/adsbtocot/files/adsbcot.ini b/package/openmanet/adsbtocot/files/adsbcot.ini new file mode 100644 index 0000000000..e010d9dd66 --- /dev/null +++ b/package/openmanet/adsbtocot/files/adsbcot.ini @@ -0,0 +1,9 @@ +[pytak] +# Multicast CoT out to your ATAK mesh +COT_URL = udp+wo://239.2.3.1:6969 +COT_STALE = 120 +COT_HEADER = TAK-ADSB + +[adsbcot] +FEED_URL = file:///var/run/dump1090/aircraft.json +IDENT = OPENMANET-ADSB01 \ No newline at end of file diff --git a/package/openmanet/adsbtocot/files/adsbcot.init b/package/openmanet/adsbtocot/files/adsbcot.init new file mode 100644 index 0000000000..75d03a4203 --- /dev/null +++ b/package/openmanet/adsbtocot/files/adsbcot.init @@ -0,0 +1,47 @@ +#!/bin/sh /etc/rc.common +START=95 +USE_PROCD=1 + +PROG="/usr/bin/adsbcot" +CONF="/etc/adsbcot/adsbcot.ini" +IFACE_DEV="br-ahwlan" + +# optional: restart when the config file changes +service_triggers() { + procd_add_reload_trigger adsbcot + procd_add_jail_mount "$CONF" + procd_add_config_trigger "config.change" adsbcot /etc/init.d/adsbcot reload +} + +get_iface_ipv4() { + # Extract first IPv4 on the bridge device (strip cidr) + ip -4 addr show dev "$IFACE_DEV" 2>/dev/null \ + | awk '/inet /{print $2; exit}' \ + | cut -d/ -f1 +} + +start_service() { + local ip + ip="$(get_iface_ipv4)" + + if [ -z "$ip" ]; then + logger -t adsbcot "No IPv4 found on $IFACE_DEV; not setting PYTAK_MULTICAST_LOCAL_ADDR" + fi + + procd_open_instance + procd_set_param command "$PROG" -c "$CONF" + # Export env var if we have it + [ -n "$ip" ] && procd_set_param env PYTAK_MULTICAST_LOCAL_ADDR="$ip" + + # Restart on crash: 5s min, 10s max, 5 tries + procd_set_param respawn 5 10 5 + + # Log to logread + procd_set_param stdout 1 + procd_set_param stderr 1 + + # Re-run if the config file changes + procd_set_param file "$CONF" + + procd_close_instance +} diff --git a/package/openmanet/alfred/Config.in b/package/openmanet/alfred/Config.in new file mode 100644 index 0000000000..bff9128634 --- /dev/null +++ b/package/openmanet/alfred/Config.in @@ -0,0 +1,22 @@ +config ALFRED_NEEDS_lua + bool + +config ALFRED_NEEDS_libgps + bool + +config PACKAGE_ALFRED_VIS + bool "enable vis server for alfred" + depends on PACKAGE_alfred + default y + +config PACKAGE_ALFRED_BATHOSTS + bool "enable autogeneration of /etc/bat-hosts" + depends on PACKAGE_alfred + select ALFRED_NEEDS_lua + default y + +config PACKAGE_ALFRED_GPSD + bool "enable gpsd service for alfred" + depends on PACKAGE_alfred + select ALFRED_NEEDS_libgps + default y diff --git a/package/openmanet/alfred/Makefile b/package/openmanet/alfred/Makefile new file mode 100644 index 0000000000..5d639924f7 --- /dev/null +++ b/package/openmanet/alfred/Makefile @@ -0,0 +1,87 @@ +# SPDX-License-Identifier: GPL-2.0-only + +include $(TOPDIR)/rules.mk + +PKG_NAME:=alfred +PKG_VERSION:=2023.1 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=https://downloads.open-mesh.org/batman/releases/batman-adv-$(PKG_VERSION) +PKG_HASH:=438048248f373757d3a8bde7cbc6db6685f4d0105d130da2f5a54f29090c6974 + +PKG_MAINTAINER:=Simon Wunderlich +PKG_LICENSE:=GPL-2.0-only MIT +PKG_LICENSE_FILES:=LICENSES/preferred/GPL-2.0 LICENSES/preferred/MIT + +PKG_BUILD_PARALLEL:=1 +PKG_BUILD_FLAGS:=gc-sections lto + +PKG_CONFIG_DEPENDS += \ + CONFIG_ALFRED_NEEDS_lua \ + CONFIG_ALFRED_NEEDS_libgps \ + CONFIG_PACKAGE_ALFRED_VIS \ + CONFIG_PACKAGE_ALFRED_BATHOSTS \ + CONFIG_PACKAGE_ALFRED_GPSD + +include $(INCLUDE_DIR)/package.mk + +define Package/alfred + SECTION:=net + CATEGORY:=Network + TITLE:=A.L.F.R.E.D. - Almighty Lightweight Fact Remote Exchange Daemon + URL:=https://www.open-mesh.org/ + DEPENDS:= +libc @IPV6 +libnl-tiny +librt \ + +ALFRED_NEEDS_lua:lua \ + +ALFRED_NEEDS_libgps:libgps +endef + +define Package/alfred/description + alfred is a user space daemon for distributing arbitrary local information + over the mesh/network in a decentralized fashion. This data can be anything + which appears to be useful - originally designed to replace the batman-adv + visualization (vis), you may distribute hostnames, phone books, administration + information, DNS information, the local weather forecast ... + + alfred runs as daemon in the background of the system. A user may insert + information by using the alfred binary on the command line, or use special + programs to communicate with alfred (done via unix sockets). alfred then takes + care of distributing the local information to other alfred servers on other + nodes. This is done via IPv6 link-local multicast, and does not require any + configuration. A user can request data from alfred, and will receive the + information available from all alfred servers in the network. +endef + +define Package/alfred/conffiles +/etc/config/alfred +endef + +define Package/alfred/config + source "$(SOURCE)/Config.in" +endef + +MAKE_FLAGS += \ + CONFIG_ALFRED_VIS=$(if $(CONFIG_PACKAGE_ALFRED_VIS),y,n) \ + CONFIG_ALFRED_GPSD=$(if $(CONFIG_PACKAGE_ALFRED_GPSD),y,n) \ + CONFIG_ALFRED_CAPABILITIES=n \ + LIBNL_NAME="libnl-tiny" \ + LIBNL_GENL_NAME="libnl-tiny" \ + REVISION="$(PKG_VERSION)-openwrt-$(PKG_RELEASE)" + +define Package/alfred/install + $(INSTALL_DIR) $(1)/usr/sbin + cp -fpR $(PKG_BUILD_DIR)/alfred $(1)/usr/sbin/ + [ "x$(CONFIG_PACKAGE_ALFRED_VIS)" == "xy" ] && cp -fpR $(PKG_BUILD_DIR)/vis/batadv-vis $(1)/usr/sbin/ ; true + [ "x$(CONFIG_PACKAGE_ALFRED_GPSD)" == "xy" ] && cp -fpR $(PKG_BUILD_DIR)/gpsd/alfred-gpsd $(1)/usr/sbin/ ; true + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/alfred.init $(1)/etc/init.d/alfred + $(INSTALL_DIR) $(1)/etc/config + $(INSTALL_DATA) ./files/alfred.config $(1)/etc/config/alfred + $(INSTALL_DIR) $(1)/etc/alfred + [ "x$(CONFIG_PACKAGE_ALFRED_BATHOSTS)" == "xy" ] && $(INSTALL_BIN) ./files/bat-hosts.lua $(1)/etc/alfred/bat-hosts.lua ; true + + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/mesh-routing.config $(1)/etc/init.d/mesh-routing ; true +endef + +$(eval $(call BuildPackage,alfred)) \ No newline at end of file diff --git a/package/openmanet/alfred/files/alfred.config b/package/openmanet/alfred/files/alfred.config new file mode 100644 index 0000000000..1fd4c04713 --- /dev/null +++ b/package/openmanet/alfred/files/alfred.config @@ -0,0 +1,7 @@ +config 'alfred' 'alfred' + list interface 'br-ahwlan' + option mode 'master' + option batmanif 'bat0' + option start_vis '0' + option run_facters '1' + option disabled '0' diff --git a/package/openmanet/alfred/files/alfred.init b/package/openmanet/alfred/files/alfred.init new file mode 100644 index 0000000000..f191827fd0 --- /dev/null +++ b/package/openmanet/alfred/files/alfred.init @@ -0,0 +1,97 @@ +#!/bin/sh /etc/rc.common + +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +START=99 +USE_PROCD=1 +alfred_args="" +vis_args="" +facters_dir="/etc/alfred" +enable=0 +vis_enable=0 + +append_interface() +{ + append "interfaces" "$1" "," +} + +alfred_start() { + local args="" + local section="$1" + local disabled interface mode + local interfaces + + # check if section is disabled + config_get_bool disabled "$section" disabled 0 + [ $disabled = 0 ] || return 1 + + args="-f" + + config_list_foreach "$section" "interface" append_interface + if [ -z "$interfaces" ]; then + config_get interface "$section" interface + append_interface "$interface" + fi + append args "-i $interfaces" + + config_get mode "$section" mode + [ "$mode" = "master" ] && append args "-m" + + config_get batmanif "$section" batmanif + append args "-b $batmanif" + + append alfred_args "$args" + enable=1 + + config_get_bool start_vis "$section" start_vis 0 + if [ "$start_vis" = 1 ] && [ -x /usr/sbin/batadv-vis ]; then + vis_enable=1 + append vis_args "-i $batmanif -s" + fi + + config_get_bool run_facters "$section" run_facters 0 + + return 0 +} + +start_service() { + config_load "alfred" + config_foreach alfred_start alfred + + [ "$enable" = "0" ] && return 0 + + procd_open_instance "alfred" + procd_set_param command /usr/sbin/alfred + procd_append_param command ${alfred_args} + procd_close_instance + + [ "$vis_enable" = "1" ] && { + procd_open_instance "batadv-vis" + procd_set_param command /usr/sbin/batadv-vis + procd_append_param command ${vis_args} + procd_close_instance + } + + [ "$run_facters" = "1" ] && { + ( for file in $facters_dir/* ; do [ -x $file ] && $file ; done ) + if ! ( grep -q "for file in $facters_dir/\* ; do " /etc/crontabs/root 2>/dev/null ) ; then + echo "*/5 * * * * ( for file in $facters_dir/* ; do [ -x \$file ] && \$file ; done )" >> /etc/crontabs/root + /etc/init.d/cron enable + /etc/init.d/cron restart + fi + } +} + +service_triggers() { + procd_add_reload_trigger "alfred" +} + +stop_service() { + [ -e /etc/crontabs/root ] && { + sed "\|for file in $facters_dir/\* ; do |d" -i /etc/crontabs/root + /etc/init.d/cron restart + } +} diff --git a/package/openmanet/alfred/files/bat-hosts.lua b/package/openmanet/alfred/files/bat-hosts.lua new file mode 100644 index 0000000000..bcfe72be66 --- /dev/null +++ b/package/openmanet/alfred/files/bat-hosts.lua @@ -0,0 +1,114 @@ +#!/usr/bin/lua + +local type_id = 64 -- bat-hosts + +function get_hostname() + local hostfile = io.open("/proc/sys/kernel/hostname", "r") + local ret_string = hostfile:read() + hostfile:close() + return ret_string +end + +function get_interfaces_names() + local ret = {} + + for name in io.popen("ls -1 /sys/class/net/"):lines() do + table.insert(ret, name) + end + + return ret +end + +function get_interface_address(name) + local addressfile = io.open("/sys/class/net/"..name.."/address", "r") + local ret_string = addressfile:read() + addressfile:close() + return ret_string +end + + +local function generate_bat_hosts() +-- get hostname and interface macs/names +-- then return a table containing valid bat-hosts lines + local n, i + local ifaces, ret = {}, {} + + local hostname = get_hostname() + + for n, i in ipairs(get_interfaces_names()) do + local address = get_interface_address(i) + if not ifaces[address] then ifaces[address] = i end + end + + for mac, iname in pairs(ifaces) do + -- Don't add invalid MAC addresses + -- Don't add morse0 MAC addresses (12:00:00:00:00:00) + if mac:match("^%x%x:%x%x:%x%x:%x%x:%x%x:%x%x$") and not mac:match("00:00:00:00:00:00") and not mac:match("12:00:00:00:00:00") then + table.insert(ret, mac.." "..hostname.."_"..iname.."\n") + end + end + + return ret +end + +local function publish_bat_hosts() +-- pass a raw chunk of data to alfred + local fd = io.popen("alfred -s " .. type_id, "w") + if fd then + local ret = generate_bat_hosts() + if ret then + fd:write(table.concat(ret)) + end + fd:close() + end +end + +local function write_bat_hosts(rows) + local content = { "### /tmp/bat-hosts generated by alfred-bat-hosts\n", + "### /!\\ This file is overwritten every 5 minutes /!\\\n", + "### (To keep manual changes, replace /etc/bat-hosts symlink with a static file)\n" } + + -- merge the chunks from all nodes, de-escaping newlines + for _, row in ipairs(rows) do + local node, value = unpack(row) + table.insert(content, "# Node ".. node .. "\n") + table.insert(content, value:gsub("\x0a", "\n") .. "\n") + end + + -- write parsed content down to disk + local fd = io.open("/tmp/bat-hosts", "w") + if fd then + fd:write(table.concat(content)) + fd:close() + end + + -- try to make a symlink in /etc pointing to /tmp, + -- if it exists, ln will do nothing. + os.execute("ln -ns /tmp/bat-hosts /etc/bat-hosts 2>/dev/null") +end + +local function receive_bat_hosts() +-- read raw chunks from alfred, convert them to a nested table and call write_bat_hosts +-- "alfred -r" can fail in slave nodes (returns empty stdout), so: +-- check output is not null before writing /tmp/bat-hosts, and retry 3 times before giving up. + for n = 1, 3 do + local fd = io.popen("alfred -r " .. type_id) + --[[ this command returns something like + { "54:e6:fc:b9:cb:37", "00:11:22:33:44:55 ham_wlan0\x0a00:22:33:22:33:22 ham_eth0\x0a" }, + { "90:f6:52:bb:ec:57", "00:22:33:22:33:23 spam\x0a" }, + ]]-- + + if fd then + local output = fd:read("*a") + fd:close() + if output and output ~= "" then + assert(loadstring("rows = {" .. output .. "}"))() + write_bat_hosts(rows) + break + end + end + end +end + +publish_bat_hosts() +receive_bat_hosts() \ No newline at end of file diff --git a/package/openmanet/alfred/files/mesh-routing.config b/package/openmanet/alfred/files/mesh-routing.config new file mode 100644 index 0000000000..a0f2e217bf --- /dev/null +++ b/package/openmanet/alfred/files/mesh-routing.config @@ -0,0 +1,53 @@ +#!/bin/sh /etc/rc.common + +START=96 +STOP=10 + +USE_PROCD=1 + +start_service() { + # Enable cross-mesh client routing through batman-adv + logger "mesh-routing: Setting up cross-mesh client routes" + + # Wait for network services to be ready + sleep 45 + + # Add routes for cross-mesh connectivity + ( + # Wait for bat0 interface to be fully operational + local retry=0 + while [ $retry -lt 30 ]; do + if ip link show bat0 >/dev/null 2>&1 && ip addr show bat0; then + logger "mesh-routing: bat0 interface is ready" + break + fi + retry=$((retry + 1)) + logger "mesh-routing: Waiting for bat0 interface (attempt $retry/30)" + sleep 2 + done + + # Enable IP forwarding for cross-mesh client communication + echo 1 > /proc/sys/net/ipv4/ip_forward + logger "mesh-routing: IP forwarding enabled" + + # Add routing rules for 10.41.0.0/16 mesh client subnet + if ! ip route show | grep -q "10.41.0.0/16"; then + ip route add 10.41.0.0/16 dev bat0 metric 100 2>/dev/null || true + logger "mesh-routing: Added route for mesh client subnet" + fi + + # Enable multicast forwarding for batman-adv + echo 1 > /proc/sys/net/ipv4/conf/bat0/mc_forwarding 2>/dev/null || true + echo 1 > /proc/sys/net/ipv4/conf/br-ahwlan/mc_forwarding 2>/dev/null || true + + # Setup ARP proxying for cross-mesh client discovery + echo 1 > /proc/sys/net/ipv4/conf/bat0/proxy_arp 2>/dev/null || true + echo 1 > /proc/sys/net/ipv4/conf/br-ahwlan/proxy_arp 2>/dev/null || true + + logger "mesh-routing: Cross-mesh client routing configured" + ) & +} + +stop() { + logger "mesh-routing: Stopping mesh routing service" +} diff --git a/package/openmanet/alfred/files/mesh-routing.init b/package/openmanet/alfred/files/mesh-routing.init new file mode 100644 index 0000000000..38b1c8298f --- /dev/null +++ b/package/openmanet/alfred/files/mesh-routing.init @@ -0,0 +1,8 @@ +#!/bin/sh + +/etc/init.d/mesh-routing enabled && { + /etc/init.d/mesh-routing stop + /etc/init.d/mesh-routing disable +} + +exit 0 \ No newline at end of file diff --git a/package/openmanet/avahi/Makefile b/package/openmanet/avahi/Makefile new file mode 100644 index 0000000000..1ea497c561 --- /dev/null +++ b/package/openmanet/avahi/Makefile @@ -0,0 +1,405 @@ +# +# Copyright (C) 2007-2016 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=avahi +PKG_VERSION:=0.8 +PKG_RELEASE:=8 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=https://github.com/lathiat/avahi/releases/download/v$(PKG_VERSION) \ + https://avahi.org/download +PKG_HASH:=060309d7a333d38d951bc27598c677af1796934dbd98e1024e7ad8de798fedda + +PKG_MAINTAINER:=Ted Hess +PKG_LICENSE:=LGPL-2.1-or-later +PKG_LICENSE_FILES:=LICENSE +PKG_CPE_ID:=cpe:/a:avahi:avahi + +PKG_FIXUP:=autoreconf +PKG_INSTALL:=1 +PKG_BUILD_PARALLEL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/avahi/Default + SECTION:=net + CATEGORY:=Network + TITLE:=An mDNS/DNS-SD implementation + URL:=http://www.avahi.org/ +endef + +define Package/avahi/Default/description + Avahi is an mDNS/DNS-SD (aka RendezVous/Bonjour/ZeroConf) + implementation (library). It facilitates + service discovery on a local network -- this means that + you can plug your laptop or computer into a network and + instantly be able to view other people who you can chat with, + find printers to print to or find files being shared. + This kind of technology is already found in MacOS X + (branded 'Rendezvous', 'Bonjour' and sometimes 'ZeroConf') + and is very convenient. +endef + +define Package/libavahi/Default + $(call Package/avahi/Default) + SECTION:=libs + CATEGORY:=Libraries + PROVIDES:=libavahi + DEPENDS:=+libpthread +endef + +define Package/libavahi/description +$(call Package/avahi/Default/description) + . + The libavahi package contains the mDNS/DNS-SD shared libraries, + used by other programs. Specifically, it provides + libavahi-core and libavahi-common libraries. +endef + +define Package/avahi-autoipd + $(call Package/avahi/Default) + SUBMENU:=IP Addresses and Names + DEPENDS:=+libdaemon + TITLE:=IPv4LL network address configuration daemon +endef + +define Package/avahi-autoipd/description +$(call Package/avahi/Default/description) + . + This package implements IPv4LL, "Dynamic Configuration of IPv4 Link-Local + Addresses" (IETF RFC3927), a protocol for automatic IP address configuration + from the link-local 169.254.0.0/16 range without the need for a central + server. It is primarily intended to be used in ad-hoc networks which lack a + DHCP server. +endef + +define Package/avahi-dbus-daemon + $(call Package/avahi/Default) + PROVIDES:=avahi-daemon + VARIANT:=dbus + SUBMENU:=IP Addresses and Names + DEPENDS:=+libavahi-dbus-support +libexpat +librt +libdaemon + TITLE+= (daemon) +endef + +define Package/avahi-nodbus-daemon + $(call Package/avahi/Default) + PROVIDES:=avahi-daemon + VARIANT:=nodbus + SUBMENU:=IP Addresses and Names + DEPENDS:=+libavahi-nodbus-support +libexpat +librt +libdaemon + TITLE+= (daemon) + USERID:=avahi=105:avahi=105 +endef + +define Package/avahi-daemon/description +$(call Package/avahi/Default/description) + . + This package contains an mDNS/DNS-SD daemon. +endef + +Package/avahi-dbus-daemon/description=$(Package/avahi-daemon/description) +Package/avahi-nodbus-daemon/description=$(Package/avahi-daemon/description) + +define Package/avahi-daemon/conffiles +/etc/avahi/avahi-daemon.conf +endef + +Package/avahi-dbus-daemon/conffiles=$(Package/avahi-daemon/conffiles) +Package/avahi-nodbus-daemon/conffiles=$(Package/avahi-daemon/conffiles) + +define Package/avahi-daemon-service-http + $(call Package/avahi/Default) + SUBMENU:=IP Addresses and Names + DEPENDS:=+avahi-daemon + TITLE:=Announce HTTP service +endef + +define Package/avahi-daemon-service-http/description +$(call Package/avahi/Default/description) + . + This package contains the service definition for announcing HTTP service. +endef + +define Package/avahi-daemon-service-http/conffiles +/etc/avahi/services/http.service +endef + +define Package/avahi-daemon-service-ssh + $(call Package/avahi/Default) + SUBMENU:=IP Addresses and Names + DEPENDS:=+avahi-daemon + TITLE:=Announce SSH service +endef + +define Package/avahi-daemon-service-ssh/description +$(call Package/avahi/Default/description) + . + This package contains the service definition for announcing SSH service. +endef + +define Package/avahi-daemon-service-ssh/conffiles +/etc/avahi/services/ssh.service +endef + +define Package/avahi-dnsconfd + $(call Package/avahi/Default) + SUBMENU:=IP Addresses and Names + DEPENDS:=+libavahi +libdaemon +libpthread + TITLE:=A Unicast DNS server using avahi-daemon +endef + +define Package/avahi-dnsconfd/description +$(call Package/avahi/Default/description) + . + This package contains a Unicast DNS server from mDNS/DNS-SD configuration + daemon, which may be used to configure conventional DNS servers using mDNS + in a DHCP-like fashion. Especially useful on IPv6. +endef + +define Package/libavahi-dbus-support + $(call Package/libavahi/Default) + VARIANT:=dbus + DEPENDS:=+dbus + TITLE+= (D-Bus support) +endef + +define Package/libavahi-nodbus-support + $(call Package/libavahi/Default) + VARIANT:=nodbus + TITLE+= (No D-Bus) +endef + +define Package/libavahi-dbus-support/description +$(call Package/libavahi/description) + . + The libavahi-dbus-support package enables + D-Bus support in avahi, needed to support + the libavahi-client library and avahi-utils. + . + Selecting this package modifies the build configuration + so that avahi packages are built with support for D-BUS enabled; + it does not generate a separate binary of its own. + It also automatically adds the D-Bus package to the build. + libavahi-dbus-support is selected automatically if you select + libavahi-client or avahi-utils. +endef + +define Package/libavahi-nodbus-support/description +$(call Package/libavahi/description) + . + Selecting this package modifies the build configuration + so that avahi packages are built without support for D-BUS enabled; + it does not generate a separate binary of its own. +endef + +define Package/libavahi-client + $(call Package/avahi/Default) + SECTION:=libs + CATEGORY:=Libraries + VARIANT:=dbus + DEPENDS:=+avahi-dbus-daemon + TITLE+= (libavahi-client library) +endef + +define Package/libavahi-client/description +$(call Package/avahi/Default/description) + . + This packages adds the libavahi-client library. + It also automatically adds the required + libavahi-dbus-support and the avahi-dbus-daemon packages. + For more information please see the avahi documentation. +endef + +define Package/libavahi-compat-libdnssd + $(call Package/avahi/Default) + SECTION:=libs + CATEGORY:=Libraries + VARIANT:=dbus + DEPENDS:=+libavahi-client + TITLE+= (libdnssd) +endef + +define Package/libavahi-compat-libdnssd/description +$(call Package/avahi/Default/description) + . + This packages adds the libavahi-compat-libdnssd library. + It also automatically adds the required libavahi-client package. + For more information please see the avahi documentation. +endef + +define Package/avahi-utils + $(call Package/avahi/Default) + SUBMENU:=IP Addresses and Names + VARIANT:=dbus + DEPENDS:=+libavahi-client +libgdbm + TITLE+= (utilities) +endef + +define Package/avahi-utils/description +$(call Package/avahi/Default/description) + . + This packages installs the following avahi utility programs: + avahi-browse, avahi-publish, avahi-resolve, avahi-set-host-name. + It also automatically adds the required libavahi-client package. + For more information please see the avahi documentation. +endef + +TARGET_CFLAGS += $(FPIC) -DGETTEXT_PACKAGE + +CONFIGURE_ARGS += \ + --enable-shared \ + --enable-static \ + --disable-glib \ + --disable-gobject \ + --disable-introspection \ + --disable-qt3 \ + --disable-qt4 \ + --disable-qt5 \ + --disable-gtk \ + --disable-gtk3 \ + --disable-dbm \ + --enable-gdbm \ + --enable-libdaemon \ + --disable-libevent \ + --disable-python \ + --disable-python-dbus \ + --disable-mono \ + --disable-monodoc \ + --disable-doxygen-doc \ + --disable-doxygen-dot \ + --disable-doxygen-man \ + --disable-doxygen-rtf \ + --disable-doxygen-xml \ + --disable-doxygen-chm \ + --disable-doxygen-chi \ + --disable-doxygen-html \ + --disable-doxygen-ps \ + --disable-doxygen-pdf \ + --disable-manpages \ + --disable-xmltoman \ + --disable-tests \ + --with-xml=expat \ + --with-distro=none \ + --with-avahi-user=nobody \ + --with-avahi-group=nogroup \ + --with-avahi-priv-access-group=nogroup \ + --with-autoipd-user=nobody \ + --with-autoipd-group=nogroup + +ifeq ($(BUILD_VARIANT),dbus) +ifneq ($(CONFIG_PACKAGE_libavahi-compat-libdnssd),) +CONFIGURE_ARGS += \ + --enable-compat-libdns_sd +endif +CONFIGURE_ARGS += \ + --enable-dbus +else +CONFIGURE_ARGS += \ + --disable-dbus +endif + +CONFIGURE_VARS+= \ + CFLAGS="$$$$CFLAGS -DNDEBUG -DDISABLE_SYSTEMD" \ + ac_cv_header_sys_capability_h=no + +define Build/InstallDev + $(INSTALL_DIR) $(1)/usr/include + $(CP) $(PKG_INSTALL_DIR)/usr/include/* $(1)/usr/include/ + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libavahi-* $(1)/usr/lib/ +ifneq ($(CONFIG_PACKAGE_libavahi-compat-libdnssd),) +ifeq ($(BUILD_VARIANT),dbus) + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libdns_sd* $(1)/usr/lib/ +endif +endif + $(INSTALL_DIR) $(1)/usr/lib/pkgconfig + $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/* $(1)/usr/lib/pkgconfig/ +endef + +define Package/libavahi/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libavahi-{common,core}.so.* $(1)/usr/lib/ +endef + +define Package/libavahi-dbus-support/install + $(call Package/libavahi/install,$(1)) + $(INSTALL_DIR) $(1)/etc/dbus-1/system.d + $(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/dbus-1/system.d/* $(1)/etc/dbus-1/system.d +endef + +Package/libavahi-nodbus-support/install=$(Package/libavahi/install) + +define Package/libavahi-client/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libavahi-client.so.* $(1)/usr/lib/ +endef + +define Package/libavahi-compat-libdnssd/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libdns_sd.so* $(1)/usr/lib/ +endef + +define Package/avahi-utils/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/* $(1)/usr/bin/ +endef + +define Package/avahi-autoipd/install + $(INSTALL_DIR) $(1)/etc/avahi + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/etc/avahi/avahi-autoipd.action $(1)/etc/avahi/ + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/avahi-autoipd $(1)/usr/sbin/ + $(INSTALL_DIR) $(1)/lib/netifd/proto + $(INSTALL_BIN) ./files/netifd-autoip.sh $(1)/lib/netifd/proto/autoip.sh +endef + +define Package/avahi-daemon/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/avahi-daemon $(1)/usr/sbin/ + $(INSTALL_DIR) $(1)/etc/avahi + $(INSTALL_DATA) ./files/avahi-daemon.conf $(1)/etc/avahi/ + # install empty service directory so that user knows where + # to place custom service files + $(INSTALL_DIR) $(1)/etc/avahi/services + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/avahi-daemon.init $(1)/etc/init.d/avahi-daemon +endef + +Package/avahi-dbus-daemon/install=$(Package/avahi-daemon/install) +Package/avahi-nodbus-daemon/install=$(Package/avahi-daemon/install) + +define Package/avahi-daemon-service-http/install + $(INSTALL_DIR) $(1)/etc/avahi/services + $(INSTALL_DATA) ./files/service-http $(1)/etc/avahi/services/http.service +endef + +define Package/avahi-daemon-service-ssh/install + $(INSTALL_DIR) $(1)/etc/avahi/services + $(INSTALL_DATA) ./files/service-ssh $(1)/etc/avahi/services/ssh.service +endef + +define Package/avahi-dnsconfd/install + $(INSTALL_DIR) $(1)/etc/avahi + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/etc/avahi/avahi-dnsconfd.action $(1)/etc/avahi/ + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/avahi-dnsconfd $(1)/usr/sbin/ +endef + +$(eval $(call BuildPackage,libavahi-client)) +$(eval $(call BuildPackage,libavahi-compat-libdnssd)) +$(eval $(call BuildPackage,avahi-utils)) +$(eval $(call BuildPackage,libavahi-dbus-support)) +$(eval $(call BuildPackage,libavahi-nodbus-support)) +$(eval $(call BuildPackage,avahi-autoipd)) +$(eval $(call BuildPackage,avahi-dbus-daemon)) +$(eval $(call BuildPackage,avahi-nodbus-daemon)) +$(eval $(call BuildPackage,avahi-daemon-service-http)) +$(eval $(call BuildPackage,avahi-daemon-service-ssh)) +$(eval $(call BuildPackage,avahi-dnsconfd)) diff --git a/package/openmanet/avahi/files/avahi-daemon.conf b/package/openmanet/avahi/files/avahi-daemon.conf new file mode 100644 index 0000000000..f14b964674 --- /dev/null +++ b/package/openmanet/avahi/files/avahi-daemon.conf @@ -0,0 +1,28 @@ +[server] +#host-name=foo +#domain-name=local +allow-interfaces=br-awhlan,bat0 +use-ipv4=yes +use-ipv6=yes +check-response-ttl=no +use-iff-running=yes +enable-dbus=yes + +[publish] +publish-addresses=yes +publish-hinfo=yes +publish-workstation=no +publish-domain=yes + +[reflector] +enable-reflector=yes +reflect-ipv=no + +[rlimits] +#rlimit-as= +rlimit-core=0 +rlimit-data=4194304 +rlimit-fsize=0 +rlimit-nofile=30 +rlimit-stack=4194304 +rlimit-nproc=3 diff --git a/package/openmanet/avahi/files/avahi-daemon.init b/package/openmanet/avahi/files/avahi-daemon.init new file mode 100644 index 0000000000..f580a31d8c --- /dev/null +++ b/package/openmanet/avahi/files/avahi-daemon.init @@ -0,0 +1,18 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2006 OpenWrt.org +START=61 + +USE_PROCD=1 +PROG=avahi-daemon + +start_service() { + procd_open_instance + procd_set_param command "$PROG" + procd_append_param command -s + procd_set_param respawn + procd_close_instance +} + +reload_service() { + procd_send_signal "$PROG" +} diff --git a/package/openmanet/avahi/files/netifd-autoip.sh b/package/openmanet/avahi/files/netifd-autoip.sh new file mode 100755 index 0000000000..be6725b837 --- /dev/null +++ b/package/openmanet/avahi/files/netifd-autoip.sh @@ -0,0 +1,20 @@ +#!/bin/sh + +. /lib/functions.sh +. ../netifd-proto.sh +init_proto "$@" + +proto_autoip_setup() { + local config="$1" + local iface="$2" + + proto_export "INTERFACE=$config" + proto_run_command "$config" avahi-autoipd "$iface" +} + +proto_autoip_teardown() { + local interface="$1" + proto_kill_command "$interface" +} + +add_protocol autoip diff --git a/package/openmanet/avahi/files/service-http b/package/openmanet/avahi/files/service-http new file mode 100644 index 0000000000..326203792e --- /dev/null +++ b/package/openmanet/avahi/files/service-http @@ -0,0 +1,10 @@ + + + + %h + + _http._tcp + 80 + path=/ + + diff --git a/package/openmanet/avahi/files/service-ssh b/package/openmanet/avahi/files/service-ssh new file mode 100644 index 0000000000..b445851577 --- /dev/null +++ b/package/openmanet/avahi/files/service-ssh @@ -0,0 +1,9 @@ + + + + %h + + _ssh._tcp + 22 + + diff --git a/package/openmanet/avahi/patches/010-pkgconfig.patch b/package/openmanet/avahi/patches/010-pkgconfig.patch new file mode 100644 index 0000000000..f5b6f7dfda --- /dev/null +++ b/package/openmanet/avahi/patches/010-pkgconfig.patch @@ -0,0 +1,178 @@ +From 229b216d274977967790e6e2cfe13dd38effa2cf Mon Sep 17 00:00:00 2001 +From: Rosen Penev +Date: Mon, 16 Sep 2019 18:04:58 -0700 +Subject: [PATCH] pkgconfig: Match the first three parameters + +For consistency between projects. Might also fix several cross compilation +cases. + +Signed-off-by: Rosen Penev +--- + avahi-client.pc.in | 4 ++-- + avahi-compat-howl.pc.in | 4 ++-- + avahi-compat-libdns_sd.pc.in | 4 ++-- + avahi-core.pc.in | 4 ++-- + avahi-glib.pc.in | 4 ++-- + avahi-gobject.pc.in | 4 ++-- + avahi-libevent.pc.in | 4 ++-- + avahi-qt3.pc.in | 4 ++-- + avahi-qt4.pc.in | 4 ++-- + avahi-qt5.pc.in | 4 ++-- + avahi-sharp.pc.in | 2 +- + avahi-ui-gtk3.pc.in | 4 ++-- + avahi-ui-sharp.pc.in | 2 +- + avahi-ui.pc.in | 4 ++-- + 14 files changed, 26 insertions(+), 26 deletions(-) + +--- a/avahi-client.pc.in ++++ b/avahi-client.pc.in +@@ -1,6 +1,6 @@ + prefix=@prefix@ +-exec_prefix=${prefix} +-libdir=@libdir@ ++exec_prefix=@prefix@ ++libdir=${exec_prefix}/lib + includedir=${prefix}/include + + Name: avahi-client +--- a/avahi-compat-howl.pc.in ++++ b/avahi-compat-howl.pc.in +@@ -1,6 +1,6 @@ + prefix=@prefix@ +-exec_prefix=${prefix} +-libdir=@libdir@ ++exec_prefix=@prefix@ ++libdir=${exec_prefix}/lib + includedir=${prefix}/include/avahi-compat-howl/ + + Name: avahi-compat-howl +--- a/avahi-compat-libdns_sd.pc.in ++++ b/avahi-compat-libdns_sd.pc.in +@@ -1,6 +1,6 @@ + prefix=@prefix@ +-exec_prefix=${prefix} +-libdir=@libdir@ ++exec_prefix=@prefix@ ++libdir=${exec_prefix}/lib + includedir=${prefix}/include/avahi-compat-libdns_sd/ + + Name: avahi-compat-libdns_sd +--- a/avahi-core.pc.in ++++ b/avahi-core.pc.in +@@ -1,6 +1,6 @@ + prefix=@prefix@ +-exec_prefix=${prefix} +-libdir=@libdir@ ++exec_prefix=@prefix@ ++libdir=${exec_prefix}/lib + includedir=${prefix}/include + + Name: avahi-core +--- a/avahi-glib.pc.in ++++ b/avahi-glib.pc.in +@@ -1,6 +1,6 @@ + prefix=@prefix@ +-exec_prefix=${prefix} +-libdir=@libdir@ ++exec_prefix=@prefix@ ++libdir=${exec_prefix}/lib + includedir=${prefix}/include + + Name: avahi-glib +--- a/avahi-gobject.pc.in ++++ b/avahi-gobject.pc.in +@@ -1,6 +1,6 @@ + prefix=@prefix@ +-exec_prefix=${prefix} +-libdir=@libdir@ ++exec_prefix=@prefix@ ++libdir=${exec_prefix}/lib + includedir=${prefix}/include + + Name: avahi-gobject +--- a/avahi-libevent.pc.in ++++ b/avahi-libevent.pc.in +@@ -1,6 +1,6 @@ + prefix=@prefix@ +-exec_prefix=${prefix} +-libdir=@libdir@ ++exec_prefix=@prefix@ ++libdir=${exec_prefix}/lib + includedir=${prefix}/include + + Name: avahi-libevent +--- a/avahi-qt3.pc.in ++++ b/avahi-qt3.pc.in +@@ -1,6 +1,6 @@ + prefix=@prefix@ +-exec_prefix=${prefix} +-libdir=@libdir@ ++exec_prefix=@prefix@ ++libdir=${exec_prefix}/lib + includedir=${prefix}/include + + Name: avahi-qt3 +--- a/avahi-qt4.pc.in ++++ b/avahi-qt4.pc.in +@@ -1,6 +1,6 @@ + prefix=@prefix@ +-exec_prefix=${prefix} +-libdir=@libdir@ ++exec_prefix=@prefix@ ++libdir=${exec_prefix}/lib + includedir=${prefix}/include + + Name: avahi-qt4 +--- a/avahi-qt5.pc.in ++++ b/avahi-qt5.pc.in +@@ -1,6 +1,6 @@ + prefix=@prefix@ +-exec_prefix=${prefix} +-libdir=@libdir@ ++exec_prefix=@prefix@ ++libdir=${exec_prefix}/lib + includedir=${prefix}/include + + Name: avahi-qt5 +--- a/avahi-sharp.pc.in ++++ b/avahi-sharp.pc.in +@@ -1,6 +1,6 @@ + prefix=@prefix@ + exec_prefix=@prefix@ +-libdir=@libdir@ ++libdir=${exec_prefix}/lib + + Name: avahi-sharp + Description: Mono bindings for the Avahi mDNS/DNS-SD stack +--- a/avahi-ui-gtk3.pc.in ++++ b/avahi-ui-gtk3.pc.in +@@ -1,6 +1,6 @@ + prefix=@prefix@ +-exec_prefix=${prefix} +-libdir=@libdir@ ++exec_prefix=@prefix@ ++libdir=${exec_prefix}/lib + includedir=${prefix}/include + + Name: avahi-ui +--- a/avahi-ui-sharp.pc.in ++++ b/avahi-ui-sharp.pc.in +@@ -1,6 +1,6 @@ + prefix=@prefix@ + exec_prefix=@prefix@ +-libdir=@libdir@ ++libdir=${exec_prefix}/lib + + Name: avahi-ui-sharp + Description: Mono bindings for the Avahi mDNS/DNS-SD stack +--- a/avahi-ui.pc.in ++++ b/avahi-ui.pc.in +@@ -1,6 +1,6 @@ + prefix=@prefix@ +-exec_prefix=${prefix} +-libdir=@libdir@ ++exec_prefix=@prefix@ ++libdir=${exec_prefix}/lib + includedir=${prefix}/include + + Name: avahi-ui diff --git a/package/openmanet/avahi/patches/020-revert-runtime-dir-systemd-change.patch b/package/openmanet/avahi/patches/020-revert-runtime-dir-systemd-change.patch new file mode 100644 index 0000000000..6a6f903084 --- /dev/null +++ b/package/openmanet/avahi/patches/020-revert-runtime-dir-systemd-change.patch @@ -0,0 +1,11 @@ +--- a/configure.ac ++++ b/configure.ac +@@ -1004,7 +1004,7 @@ AC_DEFINE_UNQUOTED(AVAHI_AUTOIPD_GROUP," + # + # Avahi runtime dir + # +-avahi_runtime_dir="/run" ++avahi_runtime_dir="${localstatedir}/run" + avahi_socket="${avahi_runtime_dir}/avahi-daemon/socket" + AC_SUBST(avahi_runtime_dir) + AC_SUBST(avahi_socket) diff --git a/package/openmanet/avahi/patches/100-p2p-no-iff_multicast-required.patch b/package/openmanet/avahi/patches/100-p2p-no-iff_multicast-required.patch new file mode 100644 index 0000000000..11a0dc7a24 --- /dev/null +++ b/package/openmanet/avahi/patches/100-p2p-no-iff_multicast-required.patch @@ -0,0 +1,45 @@ +commit 2b6bccca5d9d8ab7f11219a639707b325910a0b1 +Author: Philip Prindeville +Date: Thu Sep 17 00:27:55 2020 +0000 + + Logic for p2p on tunnels incorrectly requires IFF_MULTICAST (#305) + + Signed-off-by: Philip Prindeville + +--- a/avahi-core/iface-linux.c ++++ b/avahi-core/iface-linux.c +@@ -105,8 +105,8 @@ static void netlink_callback(AvahiNetlin + (ifinfomsg->ifi_flags & IFF_UP) && + (!m->server->config.use_iff_running || (ifinfomsg->ifi_flags & IFF_RUNNING)) && + ((ifinfomsg->ifi_flags & IFF_LOOPBACK) || +- (ifinfomsg->ifi_flags & IFF_MULTICAST)) && +- (m->server->config.allow_point_to_point || !(ifinfomsg->ifi_flags & IFF_POINTOPOINT)); ++ (ifinfomsg->ifi_flags & IFF_MULTICAST) || ++ ((ifinfomsg->ifi_flags & IFF_POINTOPOINT) && m->server->config.allow_point_to_point)); + + /* Handle interface attributes */ + l = NLMSG_PAYLOAD(n, sizeof(struct ifinfomsg)); +--- a/avahi-core/iface-pfroute.c ++++ b/avahi-core/iface-pfroute.c +@@ -81,8 +81,8 @@ static void rtm_info(struct rt_msghdr *r + (ifm->ifm_flags & IFF_UP) && + (!m->server->config.use_iff_running || (ifm->ifm_flags & IFF_RUNNING)) && + ((ifm->ifm_flags & IFF_LOOPBACK) || +- (ifm->ifm_flags & IFF_MULTICAST)) && +- (m->server->config.allow_point_to_point || !(ifm->ifm_flags & IFF_POINTOPOINT)); ++ (ifm->ifm_flags & IFF_MULTICAST) || ++ ((ifm->ifm_flags & IFF_POINTOPOINT) && m->server->config.allow_point_to_point)); + + avahi_free(hw->name); + hw->name = avahi_strndup(sdl->sdl_data, sdl->sdl_nlen); +@@ -428,8 +428,8 @@ static void if_add_interface(struct lifr + (flags & IFF_UP) && + (!m->server->config.use_iff_running || (flags & IFF_RUNNING)) && + ((flags & IFF_LOOPBACK) || +- (flags & IFF_MULTICAST)) && +- (m->server->config.allow_point_to_point || !(flags & IFF_POINTOPOINT)); ++ (flags & IFF_MULTICAST) || ++ ((flags & IFF_POINTOPOINT) && m->server->config.allow_point_to_point)); + hw->name = avahi_strdup(lifreq->lifr_name); + hw->mtu = mtu; + /* TODO get mac address */ diff --git a/package/openmanet/avahi/patches/200-Fix-NULL-pointer-crashes-from-175.patch b/package/openmanet/avahi/patches/200-Fix-NULL-pointer-crashes-from-175.patch new file mode 100644 index 0000000000..fbf8e8ecc0 --- /dev/null +++ b/package/openmanet/avahi/patches/200-Fix-NULL-pointer-crashes-from-175.patch @@ -0,0 +1,136 @@ +From 9d31939e55280a733d930b15ac9e4dda4497680c Mon Sep 17 00:00:00 2001 +From: Tommi Rantala +Date: Mon, 8 Feb 2021 11:04:43 +0200 +Subject: [PATCH] Fix NULL pointer crashes from #175 + +avahi-daemon is crashing when running "ping .local". +The crash is due to failing assertion from NULL pointer. +Add missing NULL pointer checks to fix it. + +Introduced in #175 - merge commit 8f75a045709a780c8cf92a6a21e9d35b593bdecd + +[Retrieved from: +https://github.com/lathiat/avahi/commit/9d31939e55280a733d930b15ac9e4dda4497680c] +Signed-off-by: Fabrice Fontaine +--- + avahi-core/browse-dns-server.c | 5 ++++- + avahi-core/browse-domain.c | 5 ++++- + avahi-core/browse-service-type.c | 3 +++ + avahi-core/browse-service.c | 3 +++ + avahi-core/browse.c | 3 +++ + avahi-core/resolve-address.c | 5 ++++- + avahi-core/resolve-host-name.c | 5 ++++- + avahi-core/resolve-service.c | 5 ++++- + 8 files changed, 29 insertions(+), 5 deletions(-) + +--- a/avahi-core/browse-dns-server.c ++++ b/avahi-core/browse-dns-server.c +@@ -343,7 +343,10 @@ AvahiSDNSServerBrowser *avahi_s_dns_serv + AvahiSDNSServerBrowser* b; + + b = avahi_s_dns_server_browser_prepare(server, interface, protocol, domain, type, aprotocol, flags, callback, userdata); ++ if (!b) ++ return NULL; ++ + avahi_s_dns_server_browser_start(b); + + return b; +-} +\ No newline at end of file ++} +--- a/avahi-core/browse-domain.c ++++ b/avahi-core/browse-domain.c +@@ -253,7 +253,10 @@ AvahiSDomainBrowser *avahi_s_domain_brow + AvahiSDomainBrowser *b; + + b = avahi_s_domain_browser_prepare(server, interface, protocol, domain, type, flags, callback, userdata); ++ if (!b) ++ return NULL; ++ + avahi_s_domain_browser_start(b); + + return b; +-} +\ No newline at end of file ++} +--- a/avahi-core/browse-service-type.c ++++ b/avahi-core/browse-service-type.c +@@ -171,6 +171,9 @@ AvahiSServiceTypeBrowser *avahi_s_servic + AvahiSServiceTypeBrowser *b; + + b = avahi_s_service_type_browser_prepare(server, interface, protocol, domain, flags, callback, userdata); ++ if (!b) ++ return NULL; ++ + avahi_s_service_type_browser_start(b); + + return b; +--- a/avahi-core/browse-service.c ++++ b/avahi-core/browse-service.c +@@ -184,6 +184,9 @@ AvahiSServiceBrowser *avahi_s_service_br + AvahiSServiceBrowser *b; + + b = avahi_s_service_browser_prepare(server, interface, protocol, service_type, domain, flags, callback, userdata); ++ if (!b) ++ return NULL; ++ + avahi_s_service_browser_start(b); + + return b; +--- a/avahi-core/browse.c ++++ b/avahi-core/browse.c +@@ -634,6 +634,9 @@ AvahiSRecordBrowser *avahi_s_record_brow + AvahiSRecordBrowser *b; + + b = avahi_s_record_browser_prepare(server, interface, protocol, key, flags, callback, userdata); ++ if (!b) ++ return NULL; ++ + avahi_s_record_browser_start_query(b); + + return b; +--- a/avahi-core/resolve-address.c ++++ b/avahi-core/resolve-address.c +@@ -286,7 +286,10 @@ AvahiSAddressResolver *avahi_s_address_r + AvahiSAddressResolver *b; + + b = avahi_s_address_resolver_prepare(server, interface, protocol, address, flags, callback, userdata); ++ if (!b) ++ return NULL; ++ + avahi_s_address_resolver_start(b); + + return b; +-} +\ No newline at end of file ++} +--- a/avahi-core/resolve-host-name.c ++++ b/avahi-core/resolve-host-name.c +@@ -318,7 +318,10 @@ AvahiSHostNameResolver *avahi_s_host_nam + AvahiSHostNameResolver *b; + + b = avahi_s_host_name_resolver_prepare(server, interface, protocol, host_name, aprotocol, flags, callback, userdata); ++ if (!b) ++ return NULL; ++ + avahi_s_host_name_resolver_start(b); + + return b; +-} +\ No newline at end of file ++} +--- a/avahi-core/resolve-service.c ++++ b/avahi-core/resolve-service.c +@@ -519,7 +519,10 @@ AvahiSServiceResolver *avahi_s_service_r + AvahiSServiceResolver *b; + + b = avahi_s_service_resolver_prepare(server, interface, protocol, name, type, domain, aprotocol, flags, callback, userdata); ++ if (!b) ++ return NULL; ++ + avahi_s_service_resolver_start(b); + + return b; +-} +\ No newline at end of file ++} diff --git a/package/openmanet/avahi/patches/201-Avoid-infinite-loop-in-avahi-daemon-by-handling-HUP-event.patch b/package/openmanet/avahi/patches/201-Avoid-infinite-loop-in-avahi-daemon-by-handling-HUP-event.patch new file mode 100644 index 0000000000..6a2123f519 --- /dev/null +++ b/package/openmanet/avahi/patches/201-Avoid-infinite-loop-in-avahi-daemon-by-handling-HUP-event.patch @@ -0,0 +1,36 @@ +From: Riccardo Schirone +Date: Fri, 26 Mar 2021 11:50:24 +0100 +Subject: Avoid infinite-loop in avahi-daemon by handling HUP event in + client_work + +If a client fills the input buffer, client_work() disables the +AVAHI_WATCH_IN event, thus preventing the function from executing the +`read` syscall the next times it is called. However, if the client then +terminates the connection, the socket file descriptor receives a HUP +event, which is not handled, thus the kernel keeps marking the HUP event +as occurring. While iterating over the file descriptors that triggered +an event, the client file descriptor will keep having the HUP event and +the client_work() function is always called with AVAHI_WATCH_HUP but +without nothing being done, thus entering an infinite loop. + +See https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=984938 + +(cherry picked from commit 447affe29991ee99c6b9732fc5f2c1048a611d3b) +--- + avahi-daemon/simple-protocol.c | 5 +++++ + 1 file changed, 5 insertions(+) + +--- a/avahi-daemon/simple-protocol.c ++++ b/avahi-daemon/simple-protocol.c +@@ -424,6 +424,11 @@ static void client_work(AvahiWatch *watc + } + } + ++ if (events & AVAHI_WATCH_HUP) { ++ client_free(c); ++ return; ++ } ++ + c->server->poll_api->watch_update( + watch, + (c->outbuf_length > 0 ? AVAHI_WATCH_OUT : 0) | diff --git a/package/openmanet/avahi/patches/202-avahi_dns_packet_consume_uint32-fix-potential-undefined-b.patch b/package/openmanet/avahi/patches/202-avahi_dns_packet_consume_uint32-fix-potential-undefined-b.patch new file mode 100644 index 0000000000..c757d6b787 --- /dev/null +++ b/package/openmanet/avahi/patches/202-avahi_dns_packet_consume_uint32-fix-potential-undefined-b.patch @@ -0,0 +1,27 @@ +From: traffic-millions <60914101+traffic-millions@users.noreply.github.com> +Date: Tue, 3 Mar 2020 11:15:48 +0800 +Subject: avahi_dns_packet_consume_uint32: fix potential undefined behavior + +avahi_dns_packet_consume_uint32 left shifts uint8_t values by 8, 16 and 24 bits to combine them into a 32-bit value. This produces an undefined behavior warning with gcc -fsanitize when fed input values of 128 or 255 however in testing no actual unexpected behavior occurs in practice and the 32-bit uint32_t is always correctly produced as the final value is immediately stored into a uint32_t and the compiler appears to handle this "correctly". + +Cast the intermediate values to uint32_t to prevent this warning and ensure the intended result is explicit. + +Closes: #267 +Closes: #268 +Reference: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=19304 +Origin: upstream, 0.9, commit:b897ca43ac100d326d118e5877da710eb7f836f9 +--- + avahi-core/dns.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/avahi-core/dns.c ++++ b/avahi-core/dns.c +@@ -455,7 +455,7 @@ int avahi_dns_packet_consume_uint32(Avah + return -1; + + d = (uint8_t*) (AVAHI_DNS_PACKET_DATA(p) + p->rindex); +- *ret_v = (d[0] << 24) | (d[1] << 16) | (d[2] << 8) | d[3]; ++ *ret_v = ((uint32_t)d[0] << 24) | ((uint32_t)d[1] << 16) | ((uint32_t)d[2] << 8) | (uint32_t)d[3]; + p->rindex += sizeof(uint32_t); + + return 0; diff --git a/package/openmanet/avahi/patches/203-Do-not-disable-timeout-cleanup-on-watch-cleanup.patch b/package/openmanet/avahi/patches/203-Do-not-disable-timeout-cleanup-on-watch-cleanup.patch new file mode 100644 index 0000000000..d6d5490ead --- /dev/null +++ b/package/openmanet/avahi/patches/203-Do-not-disable-timeout-cleanup-on-watch-cleanup.patch @@ -0,0 +1,22 @@ +From: Gustavo Noronha Silva +Date: Sun, 2 Jan 2022 22:29:04 -0300 +Subject: Do not disable timeout cleanup on watch cleanup + +This was causing timeouts to never be removed from the linked list that +tracks them, resulting in both memory and CPU usage to grow larger over +time. +--- + avahi-common/simple-watch.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/avahi-common/simple-watch.c ++++ b/avahi-common/simple-watch.c +@@ -238,7 +238,7 @@ static void cleanup_watches(AvahiSimpleP + destroy_watch(w); + } + +- s->timeout_req_cleanup = 0; ++ s->watch_req_cleanup = 0; + } + + static AvahiTimeout* timeout_new(const AvahiPoll *api, const struct timeval *tv, AvahiTimeoutCallback callback, void *userdata) { diff --git a/package/openmanet/avahi/patches/204-Emit-error-if-requested-service-is-not-found.patch b/package/openmanet/avahi/patches/204-Emit-error-if-requested-service-is-not-found.patch new file mode 100644 index 0000000000..c4c87b4fd9 --- /dev/null +++ b/package/openmanet/avahi/patches/204-Emit-error-if-requested-service-is-not-found.patch @@ -0,0 +1,54 @@ +From: =?utf-8?b?UGV0ciBNZW7FocOtaw==?= +Date: Thu, 17 Nov 2022 01:51:53 +0100 +Subject: Emit error if requested service is not found + +It currently just crashes instead of replying with error. Check return +value and emit error instead of passing NULL pointer to reply. + +Fixes #375 + +(cherry picked from commit a2696da2f2c50ac43b6c4903f72290d5c3fa9f6f) +--- + avahi-daemon/dbus-protocol.c | 20 ++++++++++++++------ + 1 file changed, 14 insertions(+), 6 deletions(-) + +--- a/avahi-daemon/dbus-protocol.c ++++ b/avahi-daemon/dbus-protocol.c +@@ -375,10 +375,14 @@ static DBusHandlerResult dbus_get_altern + } + + t = avahi_alternative_host_name(n); +- avahi_dbus_respond_string(c, m, t); +- avahi_free(t); +- +- return DBUS_HANDLER_RESULT_HANDLED; ++ if (t) { ++ avahi_dbus_respond_string(c, m, t); ++ avahi_free(t); ++ ++ return DBUS_HANDLER_RESULT_HANDLED; ++ } else { ++ return avahi_dbus_respond_error(c, m, AVAHI_ERR_NOT_FOUND, "Hostname not found"); ++ } + } + + static DBusHandlerResult dbus_get_alternative_service_name(DBusConnection *c, DBusMessage *m, DBusError *error) { +@@ -389,10 +393,14 @@ static DBusHandlerResult dbus_get_altern + } + + t = avahi_alternative_service_name(n); +- avahi_dbus_respond_string(c, m, t); +- avahi_free(t); +- +- return DBUS_HANDLER_RESULT_HANDLED; ++ if (t) { ++ avahi_dbus_respond_string(c, m, t); ++ avahi_free(t); ++ ++ return DBUS_HANDLER_RESULT_HANDLED; ++ } else { ++ return avahi_dbus_respond_error(c, m, AVAHI_ERR_NOT_FOUND, "Service not found"); ++ } + } + + static DBusHandlerResult dbus_create_new_entry_group(DBusConnection *c, DBusMessage *m, DBusError *error) { diff --git a/package/openmanet/avahi/patches/205-conf-file-line-lengths.patch b/package/openmanet/avahi/patches/205-conf-file-line-lengths.patch new file mode 100644 index 0000000000..3ea8a1de1e --- /dev/null +++ b/package/openmanet/avahi/patches/205-conf-file-line-lengths.patch @@ -0,0 +1,11 @@ +--- a/avahi-daemon/ini-file-parser.c ++++ b/avahi-daemon/ini-file-parser.c +@@ -50,7 +50,7 @@ AvahiIniFile* avahi_ini_file_load(const + + line = 0; + while (!feof(fo)) { +- char ln[256], *s, *e; ++ char ln[1024], *s, *e; + AvahiIniFilePair *pair; + + if (!(fgets(ln, sizeof(ln), fo))) diff --git a/package/openmanet/gpsd/Makefile b/package/openmanet/gpsd/Makefile new file mode 100644 index 0000000000..2307133b0b --- /dev/null +++ b/package/openmanet/gpsd/Makefile @@ -0,0 +1,175 @@ +# +# Copyright (C) 2006-2015 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=gpsd +PKG_VERSION:=3.26.1 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz +PKG_SOURCE_URL:=@SAVANNAH/$(PKG_NAME) +PKG_HASH:=45c0d4779324bd59a47cfcb7ac57180d2dbdf418603d398a079392dabf1f740c + +PKG_MAINTAINER:=Pushpal Sidhu +PKG_LICENSE:=BSD-3-Clause +PKG_LICENSE_FILES:=COPYING +PKG_CPE_ID:=cpe:/a:gpsd_project:gpsd + +PKG_BUILD_DEPENDS:=scons/host + +include $(INCLUDE_DIR)/package.mk +include ../../devel/scons/scons.mk + +define Package/gpsd/Default + DEPENDS+= +libusb-1.0 + URL:=https://gpsd.gitlab.io/gpsd/ +endef + +define Package/gpsd/Default/description + gpsd is a userland daemon acting as a translator between GPS and AIS receivers + and their clients. gpsd listens on port 2947 for clients requesting + position/time/velocity information. The receivers are expected to generate + position information in a well-known format -- as NMEA-0183 sentences, SiRF + binary, Rockwell binary, Garmin binary format, or other vendor binary + protocols. gpsd takes this information from the GPS and translates it into + something uniform and easier to understand for clients. +endef + +define Package/gpsd + $(call Package/gpsd/Default) + SECTION:=utils + CATEGORY:=Utilities + TITLE:=An interface daemon for GPS receivers + DEPENDS+= +gpsd-utils +endef + +define Package/gpsd/conffiles +/etc/config/gpsd +endef + +define Package/gpsd/description + $(call Package/gpsd/Default/description) + This package contains the GPS daemon. +endef + +define Package/gpsd-clients + $(call Package/gpsd/Default) + SECTION:=utils + CATEGORY:=Utilities + DEPENDS+= +libncurses + TITLE:=GPS tools and clients +endef + +define Package/gpsd-clients/description + $(call Package/gpsd/Default/description) + This package contains auxiliary tools and example clients for monitoring and + testing the GPS daemon. +endef + +define Package/gpsd-utils + $(call Package/gpsd/Default) + SECTION:=utils + CATEGORY:=Utilities + TITLE:=GPS daemon utils +endef + +define Package/gpsd-utils/description + $(call Package/gpsd/Default/description) + This package contains utilities for interacting with GPS daemon. +endef + +define Package/libgps + $(call Package/gpsd/Default) + SECTION:=libs + CATEGORY:=Libraries + TITLE:=C service library for communicating with the GPS daemon + ABI_VERSION:=31 +endef + +define Package/libgps/description + $(call Package/gpsd/Default/description) + This package contains the libgps library. +endef + +SCONS_VARS += \ + CFLAGS="$(TARGET_CFLAGS) $(EXTRA_CFLAGS) -L$(STAGING_DIR)/usr/lib" \ + LINKFLAGS="$(TARGET_LDFLAGS)" + +SCONS_OPTIONS += \ + target_platform=linux \ + dbus_export=no \ + tsip=no \ + fv18=no \ + tripmate=no \ + earthmate=no \ + itrax=no \ + navcom=no \ + ubx=no \ + evermore=no \ + ntrip=no \ + libgpsmm=no \ + libQgpsmm=no \ + bluez=no \ + nostrip=yes \ + python=no \ + implicit_link=no \ + chrpath=no \ + manbuild=no \ + sysroot="$(TOOLCHAIN_ROOT_DIR)" \ + target="$(TARGET_CROSS:-=)" + +define Build/InstallDev + $(INSTALL_DIR) $(1)/usr/include + $(CP) $(PKG_INSTALL_DIR)/usr/include/gps.h $(1)/usr/include/ + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgps*.so* $(1)/usr/lib/ + $(INSTALL_DIR) $(1)/usr/lib/pkgconfig + $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libgps.pc $(1)/usr/lib/pkgconfig + $(SED) 's,/usr/include,$$$${prefix}/include,g' $(1)/usr/lib/pkgconfig/libgps.pc + $(SED) 's,/usr/lib,$$$${exec_prefix}/lib,g' $(1)/usr/lib/pkgconfig/libgps.pc +endef + +define Package/gpsd/install + $(INSTALL_DIR) $(1)/etc/config + $(INSTALL_CONF) ./files/gpsd.config $(1)/etc/config/gpsd + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/gpsd.init $(1)/etc/init.d/gpsd + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/gpsd $(1)/usr/sbin/ + + $(INSTALL_DIR) $(1)/etc/gpsd + $(INSTALL_BIN) ./files/etc/gpsd/device-hook $(1)/etc/gpsd/ + + $(INSTALL_DIR) $(1)/etc/uci-defaults + $(INSTALL_DATA) ./files/etc/uci-defaults/* $(1)/etc/uci-defaults/ +endef + +define Package/gpsd-clients/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) \ + $(PKG_INSTALL_DIR)/usr/bin/cgps \ + $(PKG_INSTALL_DIR)/usr/bin/gps{ctl,decode,mon,pipe} \ + $(PKG_INSTALL_DIR)/usr/bin/gpxlogger \ + $(PKG_INSTALL_DIR)/usr/bin/lcdgps \ + $(1)/usr/bin/ +endef + +define Package/gpsd-utils/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/gpsdctl $(1)/usr/sbin/ +endef + +define Package/libgps/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgps.so.$(ABI_VERSION)* $(1)/usr/lib/ +endef + +$(eval $(call BuildPackage,gpsd)) +$(eval $(call BuildPackage,gpsd-clients)) +$(eval $(call BuildPackage,gpsd-utils)) +$(eval $(call BuildPackage,libgps)) diff --git a/package/openmanet/gpsd/files/gpsd.config b/package/openmanet/gpsd/files/gpsd.config new file mode 100644 index 0000000000..05966ab739 --- /dev/null +++ b/package/openmanet/gpsd/files/gpsd.config @@ -0,0 +1,5 @@ +config gpsd 'core' + option enabled '1' + option device '/dev/ttyS0' + option port '2947' + option listen_globally '0' diff --git a/package/openmanet/gpsd/files/gpsd.init b/package/openmanet/gpsd/files/gpsd.init new file mode 100644 index 0000000000..3271d43fdc --- /dev/null +++ b/package/openmanet/gpsd/files/gpsd.init @@ -0,0 +1,47 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2009-2011 OpenWrt.org +START=50 + +USE_PROCD=1 +PROG=/usr/sbin/gpsd +NAME=gpsd + +validate_section_gpsd() +{ + uci_load_validate gpsd gpsd "$1" "$2" \ + 'enabled:bool:1' \ + 'device:string' \ + 'listen_globally:bool:0' \ + 'port:port:2947' +} + +gpsd_instance() +{ + [ "$2" = 0 ] || { + echo "validation failed" + return 1 + } + + [ "$enabled" = "0" ] && return 1 + + procd_open_instance + procd_set_param command "$PROG" -N -n + + [ "$listen_globally" -ne 0 ] && procd_append_param command -G + procd_append_param command -S "$port" + procd_append_param command "$device" + procd_set_param respawn + + procd_close_instance +} + +start_service() +{ + config_load "$NAME" + config_foreach validate_section_gpsd gpsd gpsd_instance +} + +service_triggers() { + procd_add_reload_trigger "$NAME" + procd_add_validation validate_section_gpsd +} diff --git a/package/openmanet/openmanetd/Makefile b/package/openmanet/openmanetd/Makefile new file mode 100644 index 0000000000..8469eae09e --- /dev/null +++ b/package/openmanet/openmanetd/Makefile @@ -0,0 +1,57 @@ +include $(TOPDIR)/rules.mk + +PKG_NAME:=openmanetd +PKG_VERSION:=0.0.4 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=https://codeload.github.com/openmanet/openmanetd/tar.gz/$(PKG_VERSION)? +PKG_SOURCE_VERSION:=$(PKG_VERSION) +PKG_HASH:=skip + +PKG_LICENSE:=MIT +PKG_MAINTAINER:=Corey Wagehoft + +PKG_BUILD_DEPENDS:=golang/host +PKG_BUILD_PARALLEL:=1 +PKG_BUILD_FLAGS:=no-mips16 + +GO_PKG:=github.com/openmanet/openmanetd +GO_PKG_LDFLAGS_X:=cmd.Version=$(PKG_VERSION) + +include $(INCLUDE_DIR)/package.mk +include ../../../feeds/packages/lang/golang/golang-package.mk + +# Explicit runtime deps (correct OpenWrt syntax) +RDEPENDS:$(PKG_NAME) += libopusfile + +define Package/openmanetd + SECTION:=utils + CATEGORY:=Utilities + TITLE:=OpenMANET Manager + DEPENDS:=$(GO_ARCH_DEPENDS) +kmod-batman-adv +alfred +portaudio +libopus +libevdev +alsa-lib +kmod-usb-core +kmod-usb-audio +kmod-sound-core +libopusfile +endef + +define Package/openmanetd/description +A management application for openmanetd written in Go. +Includes: +- pttgo: A multicast push-to-talk voice application written in Go using PortAudio, Opus, and evdev. +endef + +define Package/openmanetd/conffiles +/etc/openmanetd/ +endef + +define Package/openmanetd/install + $(call GoPackage/Package/Install/Bin,$(1)) + + $(INSTALL_DIR) $(1)/etc/openmanetd/ + $(INSTALL_CONF) $(CURDIR)/files/sample_config.yml $(1)/etc/openmanetd/config.yml + $(INSTALL_DIR) $(1)/etc/config/ + $(INSTALL_CONF) $(CURDIR)/files/openmanetd.config $(1)/etc/config/openmanetd + $(INSTALL_DIR) $(1)/etc/init.d/ + $(INSTALL_BIN) $(CURDIR)/files/openmanetd.init $(1)/etc/init.d/openmanetd +endef + +$(eval $(call GoBinPackage,openmanetd)) +$(eval $(call BuildPackage,openmanetd)) diff --git a/package/openmanet/openmanetd/files/openmanetd.config b/package/openmanet/openmanetd/files/openmanetd.config new file mode 100644 index 0000000000..edba37ba80 --- /dev/null +++ b/package/openmanet/openmanetd/files/openmanetd.config @@ -0,0 +1,5 @@ +config openmanet 'config' + option enabled '0' + option config '/etc/openmanet/config.yml' + option loglevel 'info' + option logfile '/var/log/openmanet.log' diff --git a/package/openmanet/openmanetd/files/openmanetd.init b/package/openmanet/openmanetd/files/openmanetd.init new file mode 100644 index 0000000000..d6c8d6bb8b --- /dev/null +++ b/package/openmanet/openmanetd/files/openmanetd.init @@ -0,0 +1,39 @@ +#!/bin/sh /etc/rc.common + +USE_PROCD=1 +START=99 + +CONF="openmanet" +PROG="/usr/bin/openmanet" + +append_param_arg() { + local value + config_get value "config" "$1" $2 + [ -n "$value" ] && procd_append_param command "--${1//_/-}" "$value" +} + +start_service() { + config_load "$CONF" + + local enabled + config_get_bool enabled "config" "enabled" + [ "$enabled" -eq "1" ] || return 1 + + procd_open_instance "$CONF" + procd_set_param command "$PROG" "tunnel" + procd_append_param command "--no-autoupdate" + + append_param_arg "config" "/etc/openmanet/config.yml" + + procd_append_param command "run" + + procd_set_param respawn + procd_set_param stderr 1 + + procd_close_instance +} + +service_triggers() { + procd_add_reload_trigger "$CONF" + procd_add_interface_trigger "interface.*.up" "wan" /etc/init.d/openmanet restart +} \ No newline at end of file diff --git a/package/openmanet/openmanetd/files/sample_config.yml b/package/openmanet/openmanetd/files/sample_config.yml new file mode 100644 index 0000000000..a3dbebeb68 --- /dev/null +++ b/package/openmanet/openmanetd/files/sample_config.yml @@ -0,0 +1 @@ +#loglevel: info From ca6cf96372da66a01b142b211237130f2c183dc4 Mon Sep 17 00:00:00 2001 From: Corey Wagehoft Date: Sat, 15 Nov 2025 12:38:25 -0700 Subject: [PATCH 22/37] move packages --- feeds.conf.default | 1 + package/openmanet/adsbtocot/Makefile | 83 ---- .../adsbtocot/files/99-adsb-defaults | 48 --- package/openmanet/adsbtocot/files/adsbcot.ini | 9 - .../openmanet/adsbtocot/files/adsbcot.init | 47 -- package/openmanet/alfred/Config.in | 22 - package/openmanet/alfred/Makefile | 87 ---- package/openmanet/alfred/files/alfred.config | 7 - package/openmanet/alfred/files/alfred.init | 97 ----- package/openmanet/alfred/files/bat-hosts.lua | 114 ----- .../alfred/files/mesh-routing.config | 53 --- .../openmanet/alfred/files/mesh-routing.init | 8 - package/openmanet/avahi/Makefile | 405 ------------------ .../openmanet/avahi/files/avahi-daemon.conf | 28 -- .../openmanet/avahi/files/avahi-daemon.init | 18 - .../openmanet/avahi/files/netifd-autoip.sh | 20 - package/openmanet/avahi/files/service-http | 10 - package/openmanet/avahi/files/service-ssh | 9 - .../avahi/patches/010-pkgconfig.patch | 178 -------- ...20-revert-runtime-dir-systemd-change.patch | 11 - .../100-p2p-no-iff_multicast-required.patch | 45 -- ...00-Fix-NULL-pointer-crashes-from-175.patch | 136 ------ ...n-avahi-daemon-by-handling-HUP-event.patch | 36 -- ...ume_uint32-fix-potential-undefined-b.patch | 27 -- ...ble-timeout-cleanup-on-watch-cleanup.patch | 22 - ...or-if-requested-service-is-not-found.patch | 54 --- .../patches/205-conf-file-line-lengths.patch | 11 - package/openmanet/gpsd/Makefile | 175 -------- package/openmanet/gpsd/files/gpsd.config | 5 - package/openmanet/gpsd/files/gpsd.init | 47 -- package/openmanet/openmanetd/Makefile | 57 --- .../openmanetd/files/openmanetd.config | 5 - .../openmanetd/files/openmanetd.init | 39 -- .../openmanetd/files/sample_config.yml | 1 - 34 files changed, 1 insertion(+), 1914 deletions(-) delete mode 100644 package/openmanet/adsbtocot/Makefile delete mode 100755 package/openmanet/adsbtocot/files/99-adsb-defaults delete mode 100644 package/openmanet/adsbtocot/files/adsbcot.ini delete mode 100644 package/openmanet/adsbtocot/files/adsbcot.init delete mode 100644 package/openmanet/alfred/Config.in delete mode 100644 package/openmanet/alfred/Makefile delete mode 100644 package/openmanet/alfred/files/alfred.config delete mode 100644 package/openmanet/alfred/files/alfred.init delete mode 100644 package/openmanet/alfred/files/bat-hosts.lua delete mode 100644 package/openmanet/alfred/files/mesh-routing.config delete mode 100644 package/openmanet/alfred/files/mesh-routing.init delete mode 100644 package/openmanet/avahi/Makefile delete mode 100644 package/openmanet/avahi/files/avahi-daemon.conf delete mode 100644 package/openmanet/avahi/files/avahi-daemon.init delete mode 100755 package/openmanet/avahi/files/netifd-autoip.sh delete mode 100644 package/openmanet/avahi/files/service-http delete mode 100644 package/openmanet/avahi/files/service-ssh delete mode 100644 package/openmanet/avahi/patches/010-pkgconfig.patch delete mode 100644 package/openmanet/avahi/patches/020-revert-runtime-dir-systemd-change.patch delete mode 100644 package/openmanet/avahi/patches/100-p2p-no-iff_multicast-required.patch delete mode 100644 package/openmanet/avahi/patches/200-Fix-NULL-pointer-crashes-from-175.patch delete mode 100644 package/openmanet/avahi/patches/201-Avoid-infinite-loop-in-avahi-daemon-by-handling-HUP-event.patch delete mode 100644 package/openmanet/avahi/patches/202-avahi_dns_packet_consume_uint32-fix-potential-undefined-b.patch delete mode 100644 package/openmanet/avahi/patches/203-Do-not-disable-timeout-cleanup-on-watch-cleanup.patch delete mode 100644 package/openmanet/avahi/patches/204-Emit-error-if-requested-service-is-not-found.patch delete mode 100644 package/openmanet/avahi/patches/205-conf-file-line-lengths.patch delete mode 100644 package/openmanet/gpsd/Makefile delete mode 100644 package/openmanet/gpsd/files/gpsd.config delete mode 100644 package/openmanet/gpsd/files/gpsd.init delete mode 100644 package/openmanet/openmanetd/Makefile delete mode 100644 package/openmanet/openmanetd/files/openmanetd.config delete mode 100644 package/openmanet/openmanetd/files/openmanetd.init delete mode 100644 package/openmanet/openmanetd/files/sample_config.yml diff --git a/feeds.conf.default b/feeds.conf.default index bccc9030dc..f59ee5edf4 100644 --- a/feeds.conf.default +++ b/feeds.conf.default @@ -1,3 +1,4 @@ +src-git openmanet https://github.com/OpenMANET/packages^ebae8ae8eaf9be2b99bd0608a687fa486bf84371 src-git packages https://github.com/openwrt/packages.git^b5ed85f6e94aa08de1433272dc007550f4a28201 src-git routing https://github.com/openwrt/routing.git^e351d1e623e9ef2ab78f28cb1ce8d271d28c902d src-git telephony https://github.com/openwrt/telephony.git^98c8a5aa4624312ed758e2e2b6d4039050a1649d diff --git a/package/openmanet/adsbtocot/Makefile b/package/openmanet/adsbtocot/Makefile deleted file mode 100644 index a584ab85d2..0000000000 --- a/package/openmanet/adsbtocot/Makefile +++ /dev/null @@ -1,83 +0,0 @@ -include $(TOPDIR)/rules.mk - -PKG_NAME:=adsbtocot -PKG_VERSION:=1 -PKG_RELEASE:=2 -PKG_MAINTAINER:=info@openmanet.net -PKG_LICENSE:=MIT -PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME) -HOST_BUILD_DEPENDS:=python3/host -PKGARCH:=all - -include $(INCLUDE_DIR)/package.mk - -define Package/adsbtocot - SECTION:=utils - CATEGORY:=Utilities - TITLE:=ADS-B to Cursor-on-Target (ADSBCOT) for OpenWrt (dump1090 local) - DEPENDS:=+python3 +dump1090 +rtl-sdr -endef - -define Package/adsbtocot/description -Installs ADSBCOT from PyPI and provides a procd service to forward ADS-B tracks -from dump1090 to CoT/TAK (multicast or unicast). -endef - -# Persist user edits -define Package/adsbtocot/conffiles -/etc/adsbcot/adsbcot.ini -endef - -define Build/Prepare - mkdir -p $(PKG_BUILD_DIR) -endef - -# Vendor ADSBCOT as pure Python: -# - drop 'with_pymodes' to avoid numpy/ELF -# - disable aiohttp/yarl/multidict/frozenlist C-extensions -# - forbid wheels so pip builds pure-Python installs -define Build/Compile - AIOHTTP_NO_EXTENSIONS=1 \ - YARL_NO_EXTENSIONS=1 \ - MULTIDICT_NO_EXTENSIONS=1 \ - FROZENLIST_NO_EXTENSIONS=1 \ - PIP_NO_BINARY=:all: \ - $(STAGING_DIR_HOSTPKG)/bin/pip3 install 'adsbcot' \ - --prefix=/usr --root='$(PKG_INSTALL_DIR)' --no-cache-dir --no-compile - - # Safety: ensure no native .so crept in - find '$(PKG_INSTALL_DIR)/usr' -type f \( -name '*.so' -o -name '*.so.*' \) -print -delete || true -endef - -define Package/adsbtocot/install - # Config + init - $(INSTALL_DIR) $(1)/etc/adsbcot $(1)/etc/init.d - $(INSTALL_CONF) ./files/adsbcot.ini $(1)/etc/adsbcot/adsbcot.ini - $(INSTALL_BIN) ./files/adsbcot.init $(1)/etc/init.d/adsbcot - - # Python site-packages and console scripts - $(INSTALL_DIR) $(1)/usr - cp -a $(PKG_INSTALL_DIR)/usr/* $(1)/usr/ - - # Ensure no ELF in final image - find '$(1)/usr' -type f \( -name '*.so' -o -name '*.so.*' \) -print -delete || true - - # Normalize console-script shebangs to the target Python - [ -f "$(1)/usr/bin/adsbcot" ] && $(SED) '1s|^#!.*|#!/usr/bin/python3|' "$(1)/usr/bin/adsbcot" && chmod 0755 "$(1)/usr/bin/adsbcot" - for f in pytak aircot; do \ - if [ -f "$(1)/usr/bin/$$f" ]; then \ - $(SED) '1s|^#!.*|#!/usr/bin/python3|' "$(1)/usr/bin/$$f"; \ - chmod 0755 "$(1)/usr/bin/$$f"; \ - fi; \ - done - - # Trim caches to save space - find "$(1)/usr/lib/python3"* -name '__pycache__' -type d -exec rm -rf {} + 2>/dev/null || true - find "$(1)/usr/lib/python3"* -type f -name '*.pyc' -delete 2>/dev/null || true - - # First-boot defaults (gain, ports, etc.) - $(INSTALL_DIR) $(1)/etc/uci-defaults - $(INSTALL_BIN) ./files/99-adsb-defaults $(1)/etc/uci-defaults/99-adsb-defaults -endef - -$(eval $(call BuildPackage,adsbtocot)) diff --git a/package/openmanet/adsbtocot/files/99-adsb-defaults b/package/openmanet/adsbtocot/files/99-adsb-defaults deleted file mode 100755 index ab28969e59..0000000000 --- a/package/openmanet/adsbtocot/files/99-adsb-defaults +++ /dev/null @@ -1,48 +0,0 @@ -#!/bin/sh -# /etc/uci-defaults/99-adsb-defaults -# Apply once on first boot -[ -f /etc/adsbcot/.defaults_applied ] && exit 0 - -# Ensure dump1090 JSON path exists -mkdir -p /var/run/dump1090 - -uci -q batch <<'EOF' -set dump1090.main=dump1090 -set dump1090.main.enabled='1' -set dump1090.main.disabled='0' - -# SDR + decoding -set dump1090.main.device_index='0' -set dump1090.main.gain='49.6' -set dump1090.main.no_fix='0' -set dump1090.main.fix='1' - -# JSON output only -set dump1090.main.write_json='/var/run/dump1090' -set dump1090.main.write_json_every='1' -delete dump1090.main.html_dir - -# *** Disable all dump1090 network sockets *** -set dump1090.main.net='0' -set dump1090.main.net_only='0' -delete dump1090.main.net_bind_address -delete dump1090.main.net_ri_port -delete dump1090.main.net_ro_port -delete dump1090.main.net_sbs_port -delete dump1090.main.net_bi_port -delete dump1090.main.net_bo_port -delete dump1090.main.net_heartbeat -delete dump1090.main.net_buffer -delete dump1090.main.net_verbatim -delete dump1090.main.forward_mlat - -commit dump1090 -EOF - -/etc/init.d/adsbcot stop -/etc/init.d/adsbcot disable -/etc/init.d/dump1090 stop -/etc/init.d/dump1090 disable - -touch /etc/adsbcot/.defaults_applied -exit 0 \ No newline at end of file diff --git a/package/openmanet/adsbtocot/files/adsbcot.ini b/package/openmanet/adsbtocot/files/adsbcot.ini deleted file mode 100644 index e010d9dd66..0000000000 --- a/package/openmanet/adsbtocot/files/adsbcot.ini +++ /dev/null @@ -1,9 +0,0 @@ -[pytak] -# Multicast CoT out to your ATAK mesh -COT_URL = udp+wo://239.2.3.1:6969 -COT_STALE = 120 -COT_HEADER = TAK-ADSB - -[adsbcot] -FEED_URL = file:///var/run/dump1090/aircraft.json -IDENT = OPENMANET-ADSB01 \ No newline at end of file diff --git a/package/openmanet/adsbtocot/files/adsbcot.init b/package/openmanet/adsbtocot/files/adsbcot.init deleted file mode 100644 index 75d03a4203..0000000000 --- a/package/openmanet/adsbtocot/files/adsbcot.init +++ /dev/null @@ -1,47 +0,0 @@ -#!/bin/sh /etc/rc.common -START=95 -USE_PROCD=1 - -PROG="/usr/bin/adsbcot" -CONF="/etc/adsbcot/adsbcot.ini" -IFACE_DEV="br-ahwlan" - -# optional: restart when the config file changes -service_triggers() { - procd_add_reload_trigger adsbcot - procd_add_jail_mount "$CONF" - procd_add_config_trigger "config.change" adsbcot /etc/init.d/adsbcot reload -} - -get_iface_ipv4() { - # Extract first IPv4 on the bridge device (strip cidr) - ip -4 addr show dev "$IFACE_DEV" 2>/dev/null \ - | awk '/inet /{print $2; exit}' \ - | cut -d/ -f1 -} - -start_service() { - local ip - ip="$(get_iface_ipv4)" - - if [ -z "$ip" ]; then - logger -t adsbcot "No IPv4 found on $IFACE_DEV; not setting PYTAK_MULTICAST_LOCAL_ADDR" - fi - - procd_open_instance - procd_set_param command "$PROG" -c "$CONF" - # Export env var if we have it - [ -n "$ip" ] && procd_set_param env PYTAK_MULTICAST_LOCAL_ADDR="$ip" - - # Restart on crash: 5s min, 10s max, 5 tries - procd_set_param respawn 5 10 5 - - # Log to logread - procd_set_param stdout 1 - procd_set_param stderr 1 - - # Re-run if the config file changes - procd_set_param file "$CONF" - - procd_close_instance -} diff --git a/package/openmanet/alfred/Config.in b/package/openmanet/alfred/Config.in deleted file mode 100644 index bff9128634..0000000000 --- a/package/openmanet/alfred/Config.in +++ /dev/null @@ -1,22 +0,0 @@ -config ALFRED_NEEDS_lua - bool - -config ALFRED_NEEDS_libgps - bool - -config PACKAGE_ALFRED_VIS - bool "enable vis server for alfred" - depends on PACKAGE_alfred - default y - -config PACKAGE_ALFRED_BATHOSTS - bool "enable autogeneration of /etc/bat-hosts" - depends on PACKAGE_alfred - select ALFRED_NEEDS_lua - default y - -config PACKAGE_ALFRED_GPSD - bool "enable gpsd service for alfred" - depends on PACKAGE_alfred - select ALFRED_NEEDS_libgps - default y diff --git a/package/openmanet/alfred/Makefile b/package/openmanet/alfred/Makefile deleted file mode 100644 index 5d639924f7..0000000000 --- a/package/openmanet/alfred/Makefile +++ /dev/null @@ -1,87 +0,0 @@ -# SPDX-License-Identifier: GPL-2.0-only - -include $(TOPDIR)/rules.mk - -PKG_NAME:=alfred -PKG_VERSION:=2023.1 -PKG_RELEASE:=1 - -PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz -PKG_SOURCE_URL:=https://downloads.open-mesh.org/batman/releases/batman-adv-$(PKG_VERSION) -PKG_HASH:=438048248f373757d3a8bde7cbc6db6685f4d0105d130da2f5a54f29090c6974 - -PKG_MAINTAINER:=Simon Wunderlich -PKG_LICENSE:=GPL-2.0-only MIT -PKG_LICENSE_FILES:=LICENSES/preferred/GPL-2.0 LICENSES/preferred/MIT - -PKG_BUILD_PARALLEL:=1 -PKG_BUILD_FLAGS:=gc-sections lto - -PKG_CONFIG_DEPENDS += \ - CONFIG_ALFRED_NEEDS_lua \ - CONFIG_ALFRED_NEEDS_libgps \ - CONFIG_PACKAGE_ALFRED_VIS \ - CONFIG_PACKAGE_ALFRED_BATHOSTS \ - CONFIG_PACKAGE_ALFRED_GPSD - -include $(INCLUDE_DIR)/package.mk - -define Package/alfred - SECTION:=net - CATEGORY:=Network - TITLE:=A.L.F.R.E.D. - Almighty Lightweight Fact Remote Exchange Daemon - URL:=https://www.open-mesh.org/ - DEPENDS:= +libc @IPV6 +libnl-tiny +librt \ - +ALFRED_NEEDS_lua:lua \ - +ALFRED_NEEDS_libgps:libgps -endef - -define Package/alfred/description - alfred is a user space daemon for distributing arbitrary local information - over the mesh/network in a decentralized fashion. This data can be anything - which appears to be useful - originally designed to replace the batman-adv - visualization (vis), you may distribute hostnames, phone books, administration - information, DNS information, the local weather forecast ... - - alfred runs as daemon in the background of the system. A user may insert - information by using the alfred binary on the command line, or use special - programs to communicate with alfred (done via unix sockets). alfred then takes - care of distributing the local information to other alfred servers on other - nodes. This is done via IPv6 link-local multicast, and does not require any - configuration. A user can request data from alfred, and will receive the - information available from all alfred servers in the network. -endef - -define Package/alfred/conffiles -/etc/config/alfred -endef - -define Package/alfred/config - source "$(SOURCE)/Config.in" -endef - -MAKE_FLAGS += \ - CONFIG_ALFRED_VIS=$(if $(CONFIG_PACKAGE_ALFRED_VIS),y,n) \ - CONFIG_ALFRED_GPSD=$(if $(CONFIG_PACKAGE_ALFRED_GPSD),y,n) \ - CONFIG_ALFRED_CAPABILITIES=n \ - LIBNL_NAME="libnl-tiny" \ - LIBNL_GENL_NAME="libnl-tiny" \ - REVISION="$(PKG_VERSION)-openwrt-$(PKG_RELEASE)" - -define Package/alfred/install - $(INSTALL_DIR) $(1)/usr/sbin - cp -fpR $(PKG_BUILD_DIR)/alfred $(1)/usr/sbin/ - [ "x$(CONFIG_PACKAGE_ALFRED_VIS)" == "xy" ] && cp -fpR $(PKG_BUILD_DIR)/vis/batadv-vis $(1)/usr/sbin/ ; true - [ "x$(CONFIG_PACKAGE_ALFRED_GPSD)" == "xy" ] && cp -fpR $(PKG_BUILD_DIR)/gpsd/alfred-gpsd $(1)/usr/sbin/ ; true - $(INSTALL_DIR) $(1)/etc/init.d - $(INSTALL_BIN) ./files/alfred.init $(1)/etc/init.d/alfred - $(INSTALL_DIR) $(1)/etc/config - $(INSTALL_DATA) ./files/alfred.config $(1)/etc/config/alfred - $(INSTALL_DIR) $(1)/etc/alfred - [ "x$(CONFIG_PACKAGE_ALFRED_BATHOSTS)" == "xy" ] && $(INSTALL_BIN) ./files/bat-hosts.lua $(1)/etc/alfred/bat-hosts.lua ; true - - $(INSTALL_DIR) $(1)/etc/init.d - $(INSTALL_BIN) ./files/mesh-routing.config $(1)/etc/init.d/mesh-routing ; true -endef - -$(eval $(call BuildPackage,alfred)) \ No newline at end of file diff --git a/package/openmanet/alfred/files/alfred.config b/package/openmanet/alfred/files/alfred.config deleted file mode 100644 index 1fd4c04713..0000000000 --- a/package/openmanet/alfred/files/alfred.config +++ /dev/null @@ -1,7 +0,0 @@ -config 'alfred' 'alfred' - list interface 'br-ahwlan' - option mode 'master' - option batmanif 'bat0' - option start_vis '0' - option run_facters '1' - option disabled '0' diff --git a/package/openmanet/alfred/files/alfred.init b/package/openmanet/alfred/files/alfred.init deleted file mode 100644 index f191827fd0..0000000000 --- a/package/openmanet/alfred/files/alfred.init +++ /dev/null @@ -1,97 +0,0 @@ -#!/bin/sh /etc/rc.common - -# -# This is free software, licensed under the GNU General Public License v2. -# See /LICENSE for more information. -# - -START=99 -USE_PROCD=1 -alfred_args="" -vis_args="" -facters_dir="/etc/alfred" -enable=0 -vis_enable=0 - -append_interface() -{ - append "interfaces" "$1" "," -} - -alfred_start() { - local args="" - local section="$1" - local disabled interface mode - local interfaces - - # check if section is disabled - config_get_bool disabled "$section" disabled 0 - [ $disabled = 0 ] || return 1 - - args="-f" - - config_list_foreach "$section" "interface" append_interface - if [ -z "$interfaces" ]; then - config_get interface "$section" interface - append_interface "$interface" - fi - append args "-i $interfaces" - - config_get mode "$section" mode - [ "$mode" = "master" ] && append args "-m" - - config_get batmanif "$section" batmanif - append args "-b $batmanif" - - append alfred_args "$args" - enable=1 - - config_get_bool start_vis "$section" start_vis 0 - if [ "$start_vis" = 1 ] && [ -x /usr/sbin/batadv-vis ]; then - vis_enable=1 - append vis_args "-i $batmanif -s" - fi - - config_get_bool run_facters "$section" run_facters 0 - - return 0 -} - -start_service() { - config_load "alfred" - config_foreach alfred_start alfred - - [ "$enable" = "0" ] && return 0 - - procd_open_instance "alfred" - procd_set_param command /usr/sbin/alfred - procd_append_param command ${alfred_args} - procd_close_instance - - [ "$vis_enable" = "1" ] && { - procd_open_instance "batadv-vis" - procd_set_param command /usr/sbin/batadv-vis - procd_append_param command ${vis_args} - procd_close_instance - } - - [ "$run_facters" = "1" ] && { - ( for file in $facters_dir/* ; do [ -x $file ] && $file ; done ) - if ! ( grep -q "for file in $facters_dir/\* ; do " /etc/crontabs/root 2>/dev/null ) ; then - echo "*/5 * * * * ( for file in $facters_dir/* ; do [ -x \$file ] && \$file ; done )" >> /etc/crontabs/root - /etc/init.d/cron enable - /etc/init.d/cron restart - fi - } -} - -service_triggers() { - procd_add_reload_trigger "alfred" -} - -stop_service() { - [ -e /etc/crontabs/root ] && { - sed "\|for file in $facters_dir/\* ; do |d" -i /etc/crontabs/root - /etc/init.d/cron restart - } -} diff --git a/package/openmanet/alfred/files/bat-hosts.lua b/package/openmanet/alfred/files/bat-hosts.lua deleted file mode 100644 index bcfe72be66..0000000000 --- a/package/openmanet/alfred/files/bat-hosts.lua +++ /dev/null @@ -1,114 +0,0 @@ -#!/usr/bin/lua - -local type_id = 64 -- bat-hosts - -function get_hostname() - local hostfile = io.open("/proc/sys/kernel/hostname", "r") - local ret_string = hostfile:read() - hostfile:close() - return ret_string -end - -function get_interfaces_names() - local ret = {} - - for name in io.popen("ls -1 /sys/class/net/"):lines() do - table.insert(ret, name) - end - - return ret -end - -function get_interface_address(name) - local addressfile = io.open("/sys/class/net/"..name.."/address", "r") - local ret_string = addressfile:read() - addressfile:close() - return ret_string -end - - -local function generate_bat_hosts() --- get hostname and interface macs/names --- then return a table containing valid bat-hosts lines - local n, i - local ifaces, ret = {}, {} - - local hostname = get_hostname() - - for n, i in ipairs(get_interfaces_names()) do - local address = get_interface_address(i) - if not ifaces[address] then ifaces[address] = i end - end - - for mac, iname in pairs(ifaces) do - -- Don't add invalid MAC addresses - -- Don't add morse0 MAC addresses (12:00:00:00:00:00) - if mac:match("^%x%x:%x%x:%x%x:%x%x:%x%x:%x%x$") and not mac:match("00:00:00:00:00:00") and not mac:match("12:00:00:00:00:00") then - table.insert(ret, mac.." "..hostname.."_"..iname.."\n") - end - end - - return ret -end - -local function publish_bat_hosts() --- pass a raw chunk of data to alfred - local fd = io.popen("alfred -s " .. type_id, "w") - if fd then - local ret = generate_bat_hosts() - if ret then - fd:write(table.concat(ret)) - end - fd:close() - end -end - -local function write_bat_hosts(rows) - local content = { "### /tmp/bat-hosts generated by alfred-bat-hosts\n", - "### /!\\ This file is overwritten every 5 minutes /!\\\n", - "### (To keep manual changes, replace /etc/bat-hosts symlink with a static file)\n" } - - -- merge the chunks from all nodes, de-escaping newlines - for _, row in ipairs(rows) do - local node, value = unpack(row) - table.insert(content, "# Node ".. node .. "\n") - table.insert(content, value:gsub("\x0a", "\n") .. "\n") - end - - -- write parsed content down to disk - local fd = io.open("/tmp/bat-hosts", "w") - if fd then - fd:write(table.concat(content)) - fd:close() - end - - -- try to make a symlink in /etc pointing to /tmp, - -- if it exists, ln will do nothing. - os.execute("ln -ns /tmp/bat-hosts /etc/bat-hosts 2>/dev/null") -end - -local function receive_bat_hosts() --- read raw chunks from alfred, convert them to a nested table and call write_bat_hosts --- "alfred -r" can fail in slave nodes (returns empty stdout), so: --- check output is not null before writing /tmp/bat-hosts, and retry 3 times before giving up. - for n = 1, 3 do - local fd = io.popen("alfred -r " .. type_id) - --[[ this command returns something like - { "54:e6:fc:b9:cb:37", "00:11:22:33:44:55 ham_wlan0\x0a00:22:33:22:33:22 ham_eth0\x0a" }, - { "90:f6:52:bb:ec:57", "00:22:33:22:33:23 spam\x0a" }, - ]]-- - - if fd then - local output = fd:read("*a") - fd:close() - if output and output ~= "" then - assert(loadstring("rows = {" .. output .. "}"))() - write_bat_hosts(rows) - break - end - end - end -end - -publish_bat_hosts() -receive_bat_hosts() \ No newline at end of file diff --git a/package/openmanet/alfred/files/mesh-routing.config b/package/openmanet/alfred/files/mesh-routing.config deleted file mode 100644 index a0f2e217bf..0000000000 --- a/package/openmanet/alfred/files/mesh-routing.config +++ /dev/null @@ -1,53 +0,0 @@ -#!/bin/sh /etc/rc.common - -START=96 -STOP=10 - -USE_PROCD=1 - -start_service() { - # Enable cross-mesh client routing through batman-adv - logger "mesh-routing: Setting up cross-mesh client routes" - - # Wait for network services to be ready - sleep 45 - - # Add routes for cross-mesh connectivity - ( - # Wait for bat0 interface to be fully operational - local retry=0 - while [ $retry -lt 30 ]; do - if ip link show bat0 >/dev/null 2>&1 && ip addr show bat0; then - logger "mesh-routing: bat0 interface is ready" - break - fi - retry=$((retry + 1)) - logger "mesh-routing: Waiting for bat0 interface (attempt $retry/30)" - sleep 2 - done - - # Enable IP forwarding for cross-mesh client communication - echo 1 > /proc/sys/net/ipv4/ip_forward - logger "mesh-routing: IP forwarding enabled" - - # Add routing rules for 10.41.0.0/16 mesh client subnet - if ! ip route show | grep -q "10.41.0.0/16"; then - ip route add 10.41.0.0/16 dev bat0 metric 100 2>/dev/null || true - logger "mesh-routing: Added route for mesh client subnet" - fi - - # Enable multicast forwarding for batman-adv - echo 1 > /proc/sys/net/ipv4/conf/bat0/mc_forwarding 2>/dev/null || true - echo 1 > /proc/sys/net/ipv4/conf/br-ahwlan/mc_forwarding 2>/dev/null || true - - # Setup ARP proxying for cross-mesh client discovery - echo 1 > /proc/sys/net/ipv4/conf/bat0/proxy_arp 2>/dev/null || true - echo 1 > /proc/sys/net/ipv4/conf/br-ahwlan/proxy_arp 2>/dev/null || true - - logger "mesh-routing: Cross-mesh client routing configured" - ) & -} - -stop() { - logger "mesh-routing: Stopping mesh routing service" -} diff --git a/package/openmanet/alfred/files/mesh-routing.init b/package/openmanet/alfred/files/mesh-routing.init deleted file mode 100644 index 38b1c8298f..0000000000 --- a/package/openmanet/alfred/files/mesh-routing.init +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh - -/etc/init.d/mesh-routing enabled && { - /etc/init.d/mesh-routing stop - /etc/init.d/mesh-routing disable -} - -exit 0 \ No newline at end of file diff --git a/package/openmanet/avahi/Makefile b/package/openmanet/avahi/Makefile deleted file mode 100644 index 1ea497c561..0000000000 --- a/package/openmanet/avahi/Makefile +++ /dev/null @@ -1,405 +0,0 @@ -# -# Copyright (C) 2007-2016 OpenWrt.org -# -# This is free software, licensed under the GNU General Public License v2. -# See /LICENSE for more information. -# - -include $(TOPDIR)/rules.mk - -PKG_NAME:=avahi -PKG_VERSION:=0.8 -PKG_RELEASE:=8 - -PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz -PKG_SOURCE_URL:=https://github.com/lathiat/avahi/releases/download/v$(PKG_VERSION) \ - https://avahi.org/download -PKG_HASH:=060309d7a333d38d951bc27598c677af1796934dbd98e1024e7ad8de798fedda - -PKG_MAINTAINER:=Ted Hess -PKG_LICENSE:=LGPL-2.1-or-later -PKG_LICENSE_FILES:=LICENSE -PKG_CPE_ID:=cpe:/a:avahi:avahi - -PKG_FIXUP:=autoreconf -PKG_INSTALL:=1 -PKG_BUILD_PARALLEL:=1 - -include $(INCLUDE_DIR)/package.mk - -define Package/avahi/Default - SECTION:=net - CATEGORY:=Network - TITLE:=An mDNS/DNS-SD implementation - URL:=http://www.avahi.org/ -endef - -define Package/avahi/Default/description - Avahi is an mDNS/DNS-SD (aka RendezVous/Bonjour/ZeroConf) - implementation (library). It facilitates - service discovery on a local network -- this means that - you can plug your laptop or computer into a network and - instantly be able to view other people who you can chat with, - find printers to print to or find files being shared. - This kind of technology is already found in MacOS X - (branded 'Rendezvous', 'Bonjour' and sometimes 'ZeroConf') - and is very convenient. -endef - -define Package/libavahi/Default - $(call Package/avahi/Default) - SECTION:=libs - CATEGORY:=Libraries - PROVIDES:=libavahi - DEPENDS:=+libpthread -endef - -define Package/libavahi/description -$(call Package/avahi/Default/description) - . - The libavahi package contains the mDNS/DNS-SD shared libraries, - used by other programs. Specifically, it provides - libavahi-core and libavahi-common libraries. -endef - -define Package/avahi-autoipd - $(call Package/avahi/Default) - SUBMENU:=IP Addresses and Names - DEPENDS:=+libdaemon - TITLE:=IPv4LL network address configuration daemon -endef - -define Package/avahi-autoipd/description -$(call Package/avahi/Default/description) - . - This package implements IPv4LL, "Dynamic Configuration of IPv4 Link-Local - Addresses" (IETF RFC3927), a protocol for automatic IP address configuration - from the link-local 169.254.0.0/16 range without the need for a central - server. It is primarily intended to be used in ad-hoc networks which lack a - DHCP server. -endef - -define Package/avahi-dbus-daemon - $(call Package/avahi/Default) - PROVIDES:=avahi-daemon - VARIANT:=dbus - SUBMENU:=IP Addresses and Names - DEPENDS:=+libavahi-dbus-support +libexpat +librt +libdaemon - TITLE+= (daemon) -endef - -define Package/avahi-nodbus-daemon - $(call Package/avahi/Default) - PROVIDES:=avahi-daemon - VARIANT:=nodbus - SUBMENU:=IP Addresses and Names - DEPENDS:=+libavahi-nodbus-support +libexpat +librt +libdaemon - TITLE+= (daemon) - USERID:=avahi=105:avahi=105 -endef - -define Package/avahi-daemon/description -$(call Package/avahi/Default/description) - . - This package contains an mDNS/DNS-SD daemon. -endef - -Package/avahi-dbus-daemon/description=$(Package/avahi-daemon/description) -Package/avahi-nodbus-daemon/description=$(Package/avahi-daemon/description) - -define Package/avahi-daemon/conffiles -/etc/avahi/avahi-daemon.conf -endef - -Package/avahi-dbus-daemon/conffiles=$(Package/avahi-daemon/conffiles) -Package/avahi-nodbus-daemon/conffiles=$(Package/avahi-daemon/conffiles) - -define Package/avahi-daemon-service-http - $(call Package/avahi/Default) - SUBMENU:=IP Addresses and Names - DEPENDS:=+avahi-daemon - TITLE:=Announce HTTP service -endef - -define Package/avahi-daemon-service-http/description -$(call Package/avahi/Default/description) - . - This package contains the service definition for announcing HTTP service. -endef - -define Package/avahi-daemon-service-http/conffiles -/etc/avahi/services/http.service -endef - -define Package/avahi-daemon-service-ssh - $(call Package/avahi/Default) - SUBMENU:=IP Addresses and Names - DEPENDS:=+avahi-daemon - TITLE:=Announce SSH service -endef - -define Package/avahi-daemon-service-ssh/description -$(call Package/avahi/Default/description) - . - This package contains the service definition for announcing SSH service. -endef - -define Package/avahi-daemon-service-ssh/conffiles -/etc/avahi/services/ssh.service -endef - -define Package/avahi-dnsconfd - $(call Package/avahi/Default) - SUBMENU:=IP Addresses and Names - DEPENDS:=+libavahi +libdaemon +libpthread - TITLE:=A Unicast DNS server using avahi-daemon -endef - -define Package/avahi-dnsconfd/description -$(call Package/avahi/Default/description) - . - This package contains a Unicast DNS server from mDNS/DNS-SD configuration - daemon, which may be used to configure conventional DNS servers using mDNS - in a DHCP-like fashion. Especially useful on IPv6. -endef - -define Package/libavahi-dbus-support - $(call Package/libavahi/Default) - VARIANT:=dbus - DEPENDS:=+dbus - TITLE+= (D-Bus support) -endef - -define Package/libavahi-nodbus-support - $(call Package/libavahi/Default) - VARIANT:=nodbus - TITLE+= (No D-Bus) -endef - -define Package/libavahi-dbus-support/description -$(call Package/libavahi/description) - . - The libavahi-dbus-support package enables - D-Bus support in avahi, needed to support - the libavahi-client library and avahi-utils. - . - Selecting this package modifies the build configuration - so that avahi packages are built with support for D-BUS enabled; - it does not generate a separate binary of its own. - It also automatically adds the D-Bus package to the build. - libavahi-dbus-support is selected automatically if you select - libavahi-client or avahi-utils. -endef - -define Package/libavahi-nodbus-support/description -$(call Package/libavahi/description) - . - Selecting this package modifies the build configuration - so that avahi packages are built without support for D-BUS enabled; - it does not generate a separate binary of its own. -endef - -define Package/libavahi-client - $(call Package/avahi/Default) - SECTION:=libs - CATEGORY:=Libraries - VARIANT:=dbus - DEPENDS:=+avahi-dbus-daemon - TITLE+= (libavahi-client library) -endef - -define Package/libavahi-client/description -$(call Package/avahi/Default/description) - . - This packages adds the libavahi-client library. - It also automatically adds the required - libavahi-dbus-support and the avahi-dbus-daemon packages. - For more information please see the avahi documentation. -endef - -define Package/libavahi-compat-libdnssd - $(call Package/avahi/Default) - SECTION:=libs - CATEGORY:=Libraries - VARIANT:=dbus - DEPENDS:=+libavahi-client - TITLE+= (libdnssd) -endef - -define Package/libavahi-compat-libdnssd/description -$(call Package/avahi/Default/description) - . - This packages adds the libavahi-compat-libdnssd library. - It also automatically adds the required libavahi-client package. - For more information please see the avahi documentation. -endef - -define Package/avahi-utils - $(call Package/avahi/Default) - SUBMENU:=IP Addresses and Names - VARIANT:=dbus - DEPENDS:=+libavahi-client +libgdbm - TITLE+= (utilities) -endef - -define Package/avahi-utils/description -$(call Package/avahi/Default/description) - . - This packages installs the following avahi utility programs: - avahi-browse, avahi-publish, avahi-resolve, avahi-set-host-name. - It also automatically adds the required libavahi-client package. - For more information please see the avahi documentation. -endef - -TARGET_CFLAGS += $(FPIC) -DGETTEXT_PACKAGE - -CONFIGURE_ARGS += \ - --enable-shared \ - --enable-static \ - --disable-glib \ - --disable-gobject \ - --disable-introspection \ - --disable-qt3 \ - --disable-qt4 \ - --disable-qt5 \ - --disable-gtk \ - --disable-gtk3 \ - --disable-dbm \ - --enable-gdbm \ - --enable-libdaemon \ - --disable-libevent \ - --disable-python \ - --disable-python-dbus \ - --disable-mono \ - --disable-monodoc \ - --disable-doxygen-doc \ - --disable-doxygen-dot \ - --disable-doxygen-man \ - --disable-doxygen-rtf \ - --disable-doxygen-xml \ - --disable-doxygen-chm \ - --disable-doxygen-chi \ - --disable-doxygen-html \ - --disable-doxygen-ps \ - --disable-doxygen-pdf \ - --disable-manpages \ - --disable-xmltoman \ - --disable-tests \ - --with-xml=expat \ - --with-distro=none \ - --with-avahi-user=nobody \ - --with-avahi-group=nogroup \ - --with-avahi-priv-access-group=nogroup \ - --with-autoipd-user=nobody \ - --with-autoipd-group=nogroup - -ifeq ($(BUILD_VARIANT),dbus) -ifneq ($(CONFIG_PACKAGE_libavahi-compat-libdnssd),) -CONFIGURE_ARGS += \ - --enable-compat-libdns_sd -endif -CONFIGURE_ARGS += \ - --enable-dbus -else -CONFIGURE_ARGS += \ - --disable-dbus -endif - -CONFIGURE_VARS+= \ - CFLAGS="$$$$CFLAGS -DNDEBUG -DDISABLE_SYSTEMD" \ - ac_cv_header_sys_capability_h=no - -define Build/InstallDev - $(INSTALL_DIR) $(1)/usr/include - $(CP) $(PKG_INSTALL_DIR)/usr/include/* $(1)/usr/include/ - $(INSTALL_DIR) $(1)/usr/lib - $(CP) $(PKG_INSTALL_DIR)/usr/lib/libavahi-* $(1)/usr/lib/ -ifneq ($(CONFIG_PACKAGE_libavahi-compat-libdnssd),) -ifeq ($(BUILD_VARIANT),dbus) - $(CP) $(PKG_INSTALL_DIR)/usr/lib/libdns_sd* $(1)/usr/lib/ -endif -endif - $(INSTALL_DIR) $(1)/usr/lib/pkgconfig - $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/* $(1)/usr/lib/pkgconfig/ -endef - -define Package/libavahi/install - $(INSTALL_DIR) $(1)/usr/lib - $(CP) $(PKG_INSTALL_DIR)/usr/lib/libavahi-{common,core}.so.* $(1)/usr/lib/ -endef - -define Package/libavahi-dbus-support/install - $(call Package/libavahi/install,$(1)) - $(INSTALL_DIR) $(1)/etc/dbus-1/system.d - $(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/dbus-1/system.d/* $(1)/etc/dbus-1/system.d -endef - -Package/libavahi-nodbus-support/install=$(Package/libavahi/install) - -define Package/libavahi-client/install - $(INSTALL_DIR) $(1)/usr/lib - $(CP) $(PKG_INSTALL_DIR)/usr/lib/libavahi-client.so.* $(1)/usr/lib/ -endef - -define Package/libavahi-compat-libdnssd/install - $(INSTALL_DIR) $(1)/usr/lib - $(CP) $(PKG_INSTALL_DIR)/usr/lib/libdns_sd.so* $(1)/usr/lib/ -endef - -define Package/avahi-utils/install - $(INSTALL_DIR) $(1)/usr/bin - $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/* $(1)/usr/bin/ -endef - -define Package/avahi-autoipd/install - $(INSTALL_DIR) $(1)/etc/avahi - $(INSTALL_BIN) $(PKG_INSTALL_DIR)/etc/avahi/avahi-autoipd.action $(1)/etc/avahi/ - $(INSTALL_DIR) $(1)/usr/sbin - $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/avahi-autoipd $(1)/usr/sbin/ - $(INSTALL_DIR) $(1)/lib/netifd/proto - $(INSTALL_BIN) ./files/netifd-autoip.sh $(1)/lib/netifd/proto/autoip.sh -endef - -define Package/avahi-daemon/install - $(INSTALL_DIR) $(1)/usr/sbin - $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/avahi-daemon $(1)/usr/sbin/ - $(INSTALL_DIR) $(1)/etc/avahi - $(INSTALL_DATA) ./files/avahi-daemon.conf $(1)/etc/avahi/ - # install empty service directory so that user knows where - # to place custom service files - $(INSTALL_DIR) $(1)/etc/avahi/services - $(INSTALL_DIR) $(1)/etc/init.d - $(INSTALL_BIN) ./files/avahi-daemon.init $(1)/etc/init.d/avahi-daemon -endef - -Package/avahi-dbus-daemon/install=$(Package/avahi-daemon/install) -Package/avahi-nodbus-daemon/install=$(Package/avahi-daemon/install) - -define Package/avahi-daemon-service-http/install - $(INSTALL_DIR) $(1)/etc/avahi/services - $(INSTALL_DATA) ./files/service-http $(1)/etc/avahi/services/http.service -endef - -define Package/avahi-daemon-service-ssh/install - $(INSTALL_DIR) $(1)/etc/avahi/services - $(INSTALL_DATA) ./files/service-ssh $(1)/etc/avahi/services/ssh.service -endef - -define Package/avahi-dnsconfd/install - $(INSTALL_DIR) $(1)/etc/avahi - $(INSTALL_BIN) $(PKG_INSTALL_DIR)/etc/avahi/avahi-dnsconfd.action $(1)/etc/avahi/ - $(INSTALL_DIR) $(1)/usr/sbin - $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/avahi-dnsconfd $(1)/usr/sbin/ -endef - -$(eval $(call BuildPackage,libavahi-client)) -$(eval $(call BuildPackage,libavahi-compat-libdnssd)) -$(eval $(call BuildPackage,avahi-utils)) -$(eval $(call BuildPackage,libavahi-dbus-support)) -$(eval $(call BuildPackage,libavahi-nodbus-support)) -$(eval $(call BuildPackage,avahi-autoipd)) -$(eval $(call BuildPackage,avahi-dbus-daemon)) -$(eval $(call BuildPackage,avahi-nodbus-daemon)) -$(eval $(call BuildPackage,avahi-daemon-service-http)) -$(eval $(call BuildPackage,avahi-daemon-service-ssh)) -$(eval $(call BuildPackage,avahi-dnsconfd)) diff --git a/package/openmanet/avahi/files/avahi-daemon.conf b/package/openmanet/avahi/files/avahi-daemon.conf deleted file mode 100644 index f14b964674..0000000000 --- a/package/openmanet/avahi/files/avahi-daemon.conf +++ /dev/null @@ -1,28 +0,0 @@ -[server] -#host-name=foo -#domain-name=local -allow-interfaces=br-awhlan,bat0 -use-ipv4=yes -use-ipv6=yes -check-response-ttl=no -use-iff-running=yes -enable-dbus=yes - -[publish] -publish-addresses=yes -publish-hinfo=yes -publish-workstation=no -publish-domain=yes - -[reflector] -enable-reflector=yes -reflect-ipv=no - -[rlimits] -#rlimit-as= -rlimit-core=0 -rlimit-data=4194304 -rlimit-fsize=0 -rlimit-nofile=30 -rlimit-stack=4194304 -rlimit-nproc=3 diff --git a/package/openmanet/avahi/files/avahi-daemon.init b/package/openmanet/avahi/files/avahi-daemon.init deleted file mode 100644 index f580a31d8c..0000000000 --- a/package/openmanet/avahi/files/avahi-daemon.init +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/sh /etc/rc.common -# Copyright (C) 2006 OpenWrt.org -START=61 - -USE_PROCD=1 -PROG=avahi-daemon - -start_service() { - procd_open_instance - procd_set_param command "$PROG" - procd_append_param command -s - procd_set_param respawn - procd_close_instance -} - -reload_service() { - procd_send_signal "$PROG" -} diff --git a/package/openmanet/avahi/files/netifd-autoip.sh b/package/openmanet/avahi/files/netifd-autoip.sh deleted file mode 100755 index be6725b837..0000000000 --- a/package/openmanet/avahi/files/netifd-autoip.sh +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/sh - -. /lib/functions.sh -. ../netifd-proto.sh -init_proto "$@" - -proto_autoip_setup() { - local config="$1" - local iface="$2" - - proto_export "INTERFACE=$config" - proto_run_command "$config" avahi-autoipd "$iface" -} - -proto_autoip_teardown() { - local interface="$1" - proto_kill_command "$interface" -} - -add_protocol autoip diff --git a/package/openmanet/avahi/files/service-http b/package/openmanet/avahi/files/service-http deleted file mode 100644 index 326203792e..0000000000 --- a/package/openmanet/avahi/files/service-http +++ /dev/null @@ -1,10 +0,0 @@ - - - - %h - - _http._tcp - 80 - path=/ - - diff --git a/package/openmanet/avahi/files/service-ssh b/package/openmanet/avahi/files/service-ssh deleted file mode 100644 index b445851577..0000000000 --- a/package/openmanet/avahi/files/service-ssh +++ /dev/null @@ -1,9 +0,0 @@ - - - - %h - - _ssh._tcp - 22 - - diff --git a/package/openmanet/avahi/patches/010-pkgconfig.patch b/package/openmanet/avahi/patches/010-pkgconfig.patch deleted file mode 100644 index f5b6f7dfda..0000000000 --- a/package/openmanet/avahi/patches/010-pkgconfig.patch +++ /dev/null @@ -1,178 +0,0 @@ -From 229b216d274977967790e6e2cfe13dd38effa2cf Mon Sep 17 00:00:00 2001 -From: Rosen Penev -Date: Mon, 16 Sep 2019 18:04:58 -0700 -Subject: [PATCH] pkgconfig: Match the first three parameters - -For consistency between projects. Might also fix several cross compilation -cases. - -Signed-off-by: Rosen Penev ---- - avahi-client.pc.in | 4 ++-- - avahi-compat-howl.pc.in | 4 ++-- - avahi-compat-libdns_sd.pc.in | 4 ++-- - avahi-core.pc.in | 4 ++-- - avahi-glib.pc.in | 4 ++-- - avahi-gobject.pc.in | 4 ++-- - avahi-libevent.pc.in | 4 ++-- - avahi-qt3.pc.in | 4 ++-- - avahi-qt4.pc.in | 4 ++-- - avahi-qt5.pc.in | 4 ++-- - avahi-sharp.pc.in | 2 +- - avahi-ui-gtk3.pc.in | 4 ++-- - avahi-ui-sharp.pc.in | 2 +- - avahi-ui.pc.in | 4 ++-- - 14 files changed, 26 insertions(+), 26 deletions(-) - ---- a/avahi-client.pc.in -+++ b/avahi-client.pc.in -@@ -1,6 +1,6 @@ - prefix=@prefix@ --exec_prefix=${prefix} --libdir=@libdir@ -+exec_prefix=@prefix@ -+libdir=${exec_prefix}/lib - includedir=${prefix}/include - - Name: avahi-client ---- a/avahi-compat-howl.pc.in -+++ b/avahi-compat-howl.pc.in -@@ -1,6 +1,6 @@ - prefix=@prefix@ --exec_prefix=${prefix} --libdir=@libdir@ -+exec_prefix=@prefix@ -+libdir=${exec_prefix}/lib - includedir=${prefix}/include/avahi-compat-howl/ - - Name: avahi-compat-howl ---- a/avahi-compat-libdns_sd.pc.in -+++ b/avahi-compat-libdns_sd.pc.in -@@ -1,6 +1,6 @@ - prefix=@prefix@ --exec_prefix=${prefix} --libdir=@libdir@ -+exec_prefix=@prefix@ -+libdir=${exec_prefix}/lib - includedir=${prefix}/include/avahi-compat-libdns_sd/ - - Name: avahi-compat-libdns_sd ---- a/avahi-core.pc.in -+++ b/avahi-core.pc.in -@@ -1,6 +1,6 @@ - prefix=@prefix@ --exec_prefix=${prefix} --libdir=@libdir@ -+exec_prefix=@prefix@ -+libdir=${exec_prefix}/lib - includedir=${prefix}/include - - Name: avahi-core ---- a/avahi-glib.pc.in -+++ b/avahi-glib.pc.in -@@ -1,6 +1,6 @@ - prefix=@prefix@ --exec_prefix=${prefix} --libdir=@libdir@ -+exec_prefix=@prefix@ -+libdir=${exec_prefix}/lib - includedir=${prefix}/include - - Name: avahi-glib ---- a/avahi-gobject.pc.in -+++ b/avahi-gobject.pc.in -@@ -1,6 +1,6 @@ - prefix=@prefix@ --exec_prefix=${prefix} --libdir=@libdir@ -+exec_prefix=@prefix@ -+libdir=${exec_prefix}/lib - includedir=${prefix}/include - - Name: avahi-gobject ---- a/avahi-libevent.pc.in -+++ b/avahi-libevent.pc.in -@@ -1,6 +1,6 @@ - prefix=@prefix@ --exec_prefix=${prefix} --libdir=@libdir@ -+exec_prefix=@prefix@ -+libdir=${exec_prefix}/lib - includedir=${prefix}/include - - Name: avahi-libevent ---- a/avahi-qt3.pc.in -+++ b/avahi-qt3.pc.in -@@ -1,6 +1,6 @@ - prefix=@prefix@ --exec_prefix=${prefix} --libdir=@libdir@ -+exec_prefix=@prefix@ -+libdir=${exec_prefix}/lib - includedir=${prefix}/include - - Name: avahi-qt3 ---- a/avahi-qt4.pc.in -+++ b/avahi-qt4.pc.in -@@ -1,6 +1,6 @@ - prefix=@prefix@ --exec_prefix=${prefix} --libdir=@libdir@ -+exec_prefix=@prefix@ -+libdir=${exec_prefix}/lib - includedir=${prefix}/include - - Name: avahi-qt4 ---- a/avahi-qt5.pc.in -+++ b/avahi-qt5.pc.in -@@ -1,6 +1,6 @@ - prefix=@prefix@ --exec_prefix=${prefix} --libdir=@libdir@ -+exec_prefix=@prefix@ -+libdir=${exec_prefix}/lib - includedir=${prefix}/include - - Name: avahi-qt5 ---- a/avahi-sharp.pc.in -+++ b/avahi-sharp.pc.in -@@ -1,6 +1,6 @@ - prefix=@prefix@ - exec_prefix=@prefix@ --libdir=@libdir@ -+libdir=${exec_prefix}/lib - - Name: avahi-sharp - Description: Mono bindings for the Avahi mDNS/DNS-SD stack ---- a/avahi-ui-gtk3.pc.in -+++ b/avahi-ui-gtk3.pc.in -@@ -1,6 +1,6 @@ - prefix=@prefix@ --exec_prefix=${prefix} --libdir=@libdir@ -+exec_prefix=@prefix@ -+libdir=${exec_prefix}/lib - includedir=${prefix}/include - - Name: avahi-ui ---- a/avahi-ui-sharp.pc.in -+++ b/avahi-ui-sharp.pc.in -@@ -1,6 +1,6 @@ - prefix=@prefix@ - exec_prefix=@prefix@ --libdir=@libdir@ -+libdir=${exec_prefix}/lib - - Name: avahi-ui-sharp - Description: Mono bindings for the Avahi mDNS/DNS-SD stack ---- a/avahi-ui.pc.in -+++ b/avahi-ui.pc.in -@@ -1,6 +1,6 @@ - prefix=@prefix@ --exec_prefix=${prefix} --libdir=@libdir@ -+exec_prefix=@prefix@ -+libdir=${exec_prefix}/lib - includedir=${prefix}/include - - Name: avahi-ui diff --git a/package/openmanet/avahi/patches/020-revert-runtime-dir-systemd-change.patch b/package/openmanet/avahi/patches/020-revert-runtime-dir-systemd-change.patch deleted file mode 100644 index 6a6f903084..0000000000 --- a/package/openmanet/avahi/patches/020-revert-runtime-dir-systemd-change.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/configure.ac -+++ b/configure.ac -@@ -1004,7 +1004,7 @@ AC_DEFINE_UNQUOTED(AVAHI_AUTOIPD_GROUP," - # - # Avahi runtime dir - # --avahi_runtime_dir="/run" -+avahi_runtime_dir="${localstatedir}/run" - avahi_socket="${avahi_runtime_dir}/avahi-daemon/socket" - AC_SUBST(avahi_runtime_dir) - AC_SUBST(avahi_socket) diff --git a/package/openmanet/avahi/patches/100-p2p-no-iff_multicast-required.patch b/package/openmanet/avahi/patches/100-p2p-no-iff_multicast-required.patch deleted file mode 100644 index 11a0dc7a24..0000000000 --- a/package/openmanet/avahi/patches/100-p2p-no-iff_multicast-required.patch +++ /dev/null @@ -1,45 +0,0 @@ -commit 2b6bccca5d9d8ab7f11219a639707b325910a0b1 -Author: Philip Prindeville -Date: Thu Sep 17 00:27:55 2020 +0000 - - Logic for p2p on tunnels incorrectly requires IFF_MULTICAST (#305) - - Signed-off-by: Philip Prindeville - ---- a/avahi-core/iface-linux.c -+++ b/avahi-core/iface-linux.c -@@ -105,8 +105,8 @@ static void netlink_callback(AvahiNetlin - (ifinfomsg->ifi_flags & IFF_UP) && - (!m->server->config.use_iff_running || (ifinfomsg->ifi_flags & IFF_RUNNING)) && - ((ifinfomsg->ifi_flags & IFF_LOOPBACK) || -- (ifinfomsg->ifi_flags & IFF_MULTICAST)) && -- (m->server->config.allow_point_to_point || !(ifinfomsg->ifi_flags & IFF_POINTOPOINT)); -+ (ifinfomsg->ifi_flags & IFF_MULTICAST) || -+ ((ifinfomsg->ifi_flags & IFF_POINTOPOINT) && m->server->config.allow_point_to_point)); - - /* Handle interface attributes */ - l = NLMSG_PAYLOAD(n, sizeof(struct ifinfomsg)); ---- a/avahi-core/iface-pfroute.c -+++ b/avahi-core/iface-pfroute.c -@@ -81,8 +81,8 @@ static void rtm_info(struct rt_msghdr *r - (ifm->ifm_flags & IFF_UP) && - (!m->server->config.use_iff_running || (ifm->ifm_flags & IFF_RUNNING)) && - ((ifm->ifm_flags & IFF_LOOPBACK) || -- (ifm->ifm_flags & IFF_MULTICAST)) && -- (m->server->config.allow_point_to_point || !(ifm->ifm_flags & IFF_POINTOPOINT)); -+ (ifm->ifm_flags & IFF_MULTICAST) || -+ ((ifm->ifm_flags & IFF_POINTOPOINT) && m->server->config.allow_point_to_point)); - - avahi_free(hw->name); - hw->name = avahi_strndup(sdl->sdl_data, sdl->sdl_nlen); -@@ -428,8 +428,8 @@ static void if_add_interface(struct lifr - (flags & IFF_UP) && - (!m->server->config.use_iff_running || (flags & IFF_RUNNING)) && - ((flags & IFF_LOOPBACK) || -- (flags & IFF_MULTICAST)) && -- (m->server->config.allow_point_to_point || !(flags & IFF_POINTOPOINT)); -+ (flags & IFF_MULTICAST) || -+ ((flags & IFF_POINTOPOINT) && m->server->config.allow_point_to_point)); - hw->name = avahi_strdup(lifreq->lifr_name); - hw->mtu = mtu; - /* TODO get mac address */ diff --git a/package/openmanet/avahi/patches/200-Fix-NULL-pointer-crashes-from-175.patch b/package/openmanet/avahi/patches/200-Fix-NULL-pointer-crashes-from-175.patch deleted file mode 100644 index fbf8e8ecc0..0000000000 --- a/package/openmanet/avahi/patches/200-Fix-NULL-pointer-crashes-from-175.patch +++ /dev/null @@ -1,136 +0,0 @@ -From 9d31939e55280a733d930b15ac9e4dda4497680c Mon Sep 17 00:00:00 2001 -From: Tommi Rantala -Date: Mon, 8 Feb 2021 11:04:43 +0200 -Subject: [PATCH] Fix NULL pointer crashes from #175 - -avahi-daemon is crashing when running "ping .local". -The crash is due to failing assertion from NULL pointer. -Add missing NULL pointer checks to fix it. - -Introduced in #175 - merge commit 8f75a045709a780c8cf92a6a21e9d35b593bdecd - -[Retrieved from: -https://github.com/lathiat/avahi/commit/9d31939e55280a733d930b15ac9e4dda4497680c] -Signed-off-by: Fabrice Fontaine ---- - avahi-core/browse-dns-server.c | 5 ++++- - avahi-core/browse-domain.c | 5 ++++- - avahi-core/browse-service-type.c | 3 +++ - avahi-core/browse-service.c | 3 +++ - avahi-core/browse.c | 3 +++ - avahi-core/resolve-address.c | 5 ++++- - avahi-core/resolve-host-name.c | 5 ++++- - avahi-core/resolve-service.c | 5 ++++- - 8 files changed, 29 insertions(+), 5 deletions(-) - ---- a/avahi-core/browse-dns-server.c -+++ b/avahi-core/browse-dns-server.c -@@ -343,7 +343,10 @@ AvahiSDNSServerBrowser *avahi_s_dns_serv - AvahiSDNSServerBrowser* b; - - b = avahi_s_dns_server_browser_prepare(server, interface, protocol, domain, type, aprotocol, flags, callback, userdata); -+ if (!b) -+ return NULL; -+ - avahi_s_dns_server_browser_start(b); - - return b; --} -\ No newline at end of file -+} ---- a/avahi-core/browse-domain.c -+++ b/avahi-core/browse-domain.c -@@ -253,7 +253,10 @@ AvahiSDomainBrowser *avahi_s_domain_brow - AvahiSDomainBrowser *b; - - b = avahi_s_domain_browser_prepare(server, interface, protocol, domain, type, flags, callback, userdata); -+ if (!b) -+ return NULL; -+ - avahi_s_domain_browser_start(b); - - return b; --} -\ No newline at end of file -+} ---- a/avahi-core/browse-service-type.c -+++ b/avahi-core/browse-service-type.c -@@ -171,6 +171,9 @@ AvahiSServiceTypeBrowser *avahi_s_servic - AvahiSServiceTypeBrowser *b; - - b = avahi_s_service_type_browser_prepare(server, interface, protocol, domain, flags, callback, userdata); -+ if (!b) -+ return NULL; -+ - avahi_s_service_type_browser_start(b); - - return b; ---- a/avahi-core/browse-service.c -+++ b/avahi-core/browse-service.c -@@ -184,6 +184,9 @@ AvahiSServiceBrowser *avahi_s_service_br - AvahiSServiceBrowser *b; - - b = avahi_s_service_browser_prepare(server, interface, protocol, service_type, domain, flags, callback, userdata); -+ if (!b) -+ return NULL; -+ - avahi_s_service_browser_start(b); - - return b; ---- a/avahi-core/browse.c -+++ b/avahi-core/browse.c -@@ -634,6 +634,9 @@ AvahiSRecordBrowser *avahi_s_record_brow - AvahiSRecordBrowser *b; - - b = avahi_s_record_browser_prepare(server, interface, protocol, key, flags, callback, userdata); -+ if (!b) -+ return NULL; -+ - avahi_s_record_browser_start_query(b); - - return b; ---- a/avahi-core/resolve-address.c -+++ b/avahi-core/resolve-address.c -@@ -286,7 +286,10 @@ AvahiSAddressResolver *avahi_s_address_r - AvahiSAddressResolver *b; - - b = avahi_s_address_resolver_prepare(server, interface, protocol, address, flags, callback, userdata); -+ if (!b) -+ return NULL; -+ - avahi_s_address_resolver_start(b); - - return b; --} -\ No newline at end of file -+} ---- a/avahi-core/resolve-host-name.c -+++ b/avahi-core/resolve-host-name.c -@@ -318,7 +318,10 @@ AvahiSHostNameResolver *avahi_s_host_nam - AvahiSHostNameResolver *b; - - b = avahi_s_host_name_resolver_prepare(server, interface, protocol, host_name, aprotocol, flags, callback, userdata); -+ if (!b) -+ return NULL; -+ - avahi_s_host_name_resolver_start(b); - - return b; --} -\ No newline at end of file -+} ---- a/avahi-core/resolve-service.c -+++ b/avahi-core/resolve-service.c -@@ -519,7 +519,10 @@ AvahiSServiceResolver *avahi_s_service_r - AvahiSServiceResolver *b; - - b = avahi_s_service_resolver_prepare(server, interface, protocol, name, type, domain, aprotocol, flags, callback, userdata); -+ if (!b) -+ return NULL; -+ - avahi_s_service_resolver_start(b); - - return b; --} -\ No newline at end of file -+} diff --git a/package/openmanet/avahi/patches/201-Avoid-infinite-loop-in-avahi-daemon-by-handling-HUP-event.patch b/package/openmanet/avahi/patches/201-Avoid-infinite-loop-in-avahi-daemon-by-handling-HUP-event.patch deleted file mode 100644 index 6a2123f519..0000000000 --- a/package/openmanet/avahi/patches/201-Avoid-infinite-loop-in-avahi-daemon-by-handling-HUP-event.patch +++ /dev/null @@ -1,36 +0,0 @@ -From: Riccardo Schirone -Date: Fri, 26 Mar 2021 11:50:24 +0100 -Subject: Avoid infinite-loop in avahi-daemon by handling HUP event in - client_work - -If a client fills the input buffer, client_work() disables the -AVAHI_WATCH_IN event, thus preventing the function from executing the -`read` syscall the next times it is called. However, if the client then -terminates the connection, the socket file descriptor receives a HUP -event, which is not handled, thus the kernel keeps marking the HUP event -as occurring. While iterating over the file descriptors that triggered -an event, the client file descriptor will keep having the HUP event and -the client_work() function is always called with AVAHI_WATCH_HUP but -without nothing being done, thus entering an infinite loop. - -See https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=984938 - -(cherry picked from commit 447affe29991ee99c6b9732fc5f2c1048a611d3b) ---- - avahi-daemon/simple-protocol.c | 5 +++++ - 1 file changed, 5 insertions(+) - ---- a/avahi-daemon/simple-protocol.c -+++ b/avahi-daemon/simple-protocol.c -@@ -424,6 +424,11 @@ static void client_work(AvahiWatch *watc - } - } - -+ if (events & AVAHI_WATCH_HUP) { -+ client_free(c); -+ return; -+ } -+ - c->server->poll_api->watch_update( - watch, - (c->outbuf_length > 0 ? AVAHI_WATCH_OUT : 0) | diff --git a/package/openmanet/avahi/patches/202-avahi_dns_packet_consume_uint32-fix-potential-undefined-b.patch b/package/openmanet/avahi/patches/202-avahi_dns_packet_consume_uint32-fix-potential-undefined-b.patch deleted file mode 100644 index c757d6b787..0000000000 --- a/package/openmanet/avahi/patches/202-avahi_dns_packet_consume_uint32-fix-potential-undefined-b.patch +++ /dev/null @@ -1,27 +0,0 @@ -From: traffic-millions <60914101+traffic-millions@users.noreply.github.com> -Date: Tue, 3 Mar 2020 11:15:48 +0800 -Subject: avahi_dns_packet_consume_uint32: fix potential undefined behavior - -avahi_dns_packet_consume_uint32 left shifts uint8_t values by 8, 16 and 24 bits to combine them into a 32-bit value. This produces an undefined behavior warning with gcc -fsanitize when fed input values of 128 or 255 however in testing no actual unexpected behavior occurs in practice and the 32-bit uint32_t is always correctly produced as the final value is immediately stored into a uint32_t and the compiler appears to handle this "correctly". - -Cast the intermediate values to uint32_t to prevent this warning and ensure the intended result is explicit. - -Closes: #267 -Closes: #268 -Reference: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=19304 -Origin: upstream, 0.9, commit:b897ca43ac100d326d118e5877da710eb7f836f9 ---- - avahi-core/dns.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - ---- a/avahi-core/dns.c -+++ b/avahi-core/dns.c -@@ -455,7 +455,7 @@ int avahi_dns_packet_consume_uint32(Avah - return -1; - - d = (uint8_t*) (AVAHI_DNS_PACKET_DATA(p) + p->rindex); -- *ret_v = (d[0] << 24) | (d[1] << 16) | (d[2] << 8) | d[3]; -+ *ret_v = ((uint32_t)d[0] << 24) | ((uint32_t)d[1] << 16) | ((uint32_t)d[2] << 8) | (uint32_t)d[3]; - p->rindex += sizeof(uint32_t); - - return 0; diff --git a/package/openmanet/avahi/patches/203-Do-not-disable-timeout-cleanup-on-watch-cleanup.patch b/package/openmanet/avahi/patches/203-Do-not-disable-timeout-cleanup-on-watch-cleanup.patch deleted file mode 100644 index d6d5490ead..0000000000 --- a/package/openmanet/avahi/patches/203-Do-not-disable-timeout-cleanup-on-watch-cleanup.patch +++ /dev/null @@ -1,22 +0,0 @@ -From: Gustavo Noronha Silva -Date: Sun, 2 Jan 2022 22:29:04 -0300 -Subject: Do not disable timeout cleanup on watch cleanup - -This was causing timeouts to never be removed from the linked list that -tracks them, resulting in both memory and CPU usage to grow larger over -time. ---- - avahi-common/simple-watch.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - ---- a/avahi-common/simple-watch.c -+++ b/avahi-common/simple-watch.c -@@ -238,7 +238,7 @@ static void cleanup_watches(AvahiSimpleP - destroy_watch(w); - } - -- s->timeout_req_cleanup = 0; -+ s->watch_req_cleanup = 0; - } - - static AvahiTimeout* timeout_new(const AvahiPoll *api, const struct timeval *tv, AvahiTimeoutCallback callback, void *userdata) { diff --git a/package/openmanet/avahi/patches/204-Emit-error-if-requested-service-is-not-found.patch b/package/openmanet/avahi/patches/204-Emit-error-if-requested-service-is-not-found.patch deleted file mode 100644 index c4c87b4fd9..0000000000 --- a/package/openmanet/avahi/patches/204-Emit-error-if-requested-service-is-not-found.patch +++ /dev/null @@ -1,54 +0,0 @@ -From: =?utf-8?b?UGV0ciBNZW7FocOtaw==?= -Date: Thu, 17 Nov 2022 01:51:53 +0100 -Subject: Emit error if requested service is not found - -It currently just crashes instead of replying with error. Check return -value and emit error instead of passing NULL pointer to reply. - -Fixes #375 - -(cherry picked from commit a2696da2f2c50ac43b6c4903f72290d5c3fa9f6f) ---- - avahi-daemon/dbus-protocol.c | 20 ++++++++++++++------ - 1 file changed, 14 insertions(+), 6 deletions(-) - ---- a/avahi-daemon/dbus-protocol.c -+++ b/avahi-daemon/dbus-protocol.c -@@ -375,10 +375,14 @@ static DBusHandlerResult dbus_get_altern - } - - t = avahi_alternative_host_name(n); -- avahi_dbus_respond_string(c, m, t); -- avahi_free(t); -- -- return DBUS_HANDLER_RESULT_HANDLED; -+ if (t) { -+ avahi_dbus_respond_string(c, m, t); -+ avahi_free(t); -+ -+ return DBUS_HANDLER_RESULT_HANDLED; -+ } else { -+ return avahi_dbus_respond_error(c, m, AVAHI_ERR_NOT_FOUND, "Hostname not found"); -+ } - } - - static DBusHandlerResult dbus_get_alternative_service_name(DBusConnection *c, DBusMessage *m, DBusError *error) { -@@ -389,10 +393,14 @@ static DBusHandlerResult dbus_get_altern - } - - t = avahi_alternative_service_name(n); -- avahi_dbus_respond_string(c, m, t); -- avahi_free(t); -- -- return DBUS_HANDLER_RESULT_HANDLED; -+ if (t) { -+ avahi_dbus_respond_string(c, m, t); -+ avahi_free(t); -+ -+ return DBUS_HANDLER_RESULT_HANDLED; -+ } else { -+ return avahi_dbus_respond_error(c, m, AVAHI_ERR_NOT_FOUND, "Service not found"); -+ } - } - - static DBusHandlerResult dbus_create_new_entry_group(DBusConnection *c, DBusMessage *m, DBusError *error) { diff --git a/package/openmanet/avahi/patches/205-conf-file-line-lengths.patch b/package/openmanet/avahi/patches/205-conf-file-line-lengths.patch deleted file mode 100644 index 3ea8a1de1e..0000000000 --- a/package/openmanet/avahi/patches/205-conf-file-line-lengths.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/avahi-daemon/ini-file-parser.c -+++ b/avahi-daemon/ini-file-parser.c -@@ -50,7 +50,7 @@ AvahiIniFile* avahi_ini_file_load(const - - line = 0; - while (!feof(fo)) { -- char ln[256], *s, *e; -+ char ln[1024], *s, *e; - AvahiIniFilePair *pair; - - if (!(fgets(ln, sizeof(ln), fo))) diff --git a/package/openmanet/gpsd/Makefile b/package/openmanet/gpsd/Makefile deleted file mode 100644 index 2307133b0b..0000000000 --- a/package/openmanet/gpsd/Makefile +++ /dev/null @@ -1,175 +0,0 @@ -# -# Copyright (C) 2006-2015 OpenWrt.org -# -# This is free software, licensed under the GNU General Public License v2. -# See /LICENSE for more information. -# - -include $(TOPDIR)/rules.mk - -PKG_NAME:=gpsd -PKG_VERSION:=3.26.1 -PKG_RELEASE:=1 - -PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz -PKG_SOURCE_URL:=@SAVANNAH/$(PKG_NAME) -PKG_HASH:=45c0d4779324bd59a47cfcb7ac57180d2dbdf418603d398a079392dabf1f740c - -PKG_MAINTAINER:=Pushpal Sidhu -PKG_LICENSE:=BSD-3-Clause -PKG_LICENSE_FILES:=COPYING -PKG_CPE_ID:=cpe:/a:gpsd_project:gpsd - -PKG_BUILD_DEPENDS:=scons/host - -include $(INCLUDE_DIR)/package.mk -include ../../devel/scons/scons.mk - -define Package/gpsd/Default - DEPENDS+= +libusb-1.0 - URL:=https://gpsd.gitlab.io/gpsd/ -endef - -define Package/gpsd/Default/description - gpsd is a userland daemon acting as a translator between GPS and AIS receivers - and their clients. gpsd listens on port 2947 for clients requesting - position/time/velocity information. The receivers are expected to generate - position information in a well-known format -- as NMEA-0183 sentences, SiRF - binary, Rockwell binary, Garmin binary format, or other vendor binary - protocols. gpsd takes this information from the GPS and translates it into - something uniform and easier to understand for clients. -endef - -define Package/gpsd - $(call Package/gpsd/Default) - SECTION:=utils - CATEGORY:=Utilities - TITLE:=An interface daemon for GPS receivers - DEPENDS+= +gpsd-utils -endef - -define Package/gpsd/conffiles -/etc/config/gpsd -endef - -define Package/gpsd/description - $(call Package/gpsd/Default/description) - This package contains the GPS daemon. -endef - -define Package/gpsd-clients - $(call Package/gpsd/Default) - SECTION:=utils - CATEGORY:=Utilities - DEPENDS+= +libncurses - TITLE:=GPS tools and clients -endef - -define Package/gpsd-clients/description - $(call Package/gpsd/Default/description) - This package contains auxiliary tools and example clients for monitoring and - testing the GPS daemon. -endef - -define Package/gpsd-utils - $(call Package/gpsd/Default) - SECTION:=utils - CATEGORY:=Utilities - TITLE:=GPS daemon utils -endef - -define Package/gpsd-utils/description - $(call Package/gpsd/Default/description) - This package contains utilities for interacting with GPS daemon. -endef - -define Package/libgps - $(call Package/gpsd/Default) - SECTION:=libs - CATEGORY:=Libraries - TITLE:=C service library for communicating with the GPS daemon - ABI_VERSION:=31 -endef - -define Package/libgps/description - $(call Package/gpsd/Default/description) - This package contains the libgps library. -endef - -SCONS_VARS += \ - CFLAGS="$(TARGET_CFLAGS) $(EXTRA_CFLAGS) -L$(STAGING_DIR)/usr/lib" \ - LINKFLAGS="$(TARGET_LDFLAGS)" - -SCONS_OPTIONS += \ - target_platform=linux \ - dbus_export=no \ - tsip=no \ - fv18=no \ - tripmate=no \ - earthmate=no \ - itrax=no \ - navcom=no \ - ubx=no \ - evermore=no \ - ntrip=no \ - libgpsmm=no \ - libQgpsmm=no \ - bluez=no \ - nostrip=yes \ - python=no \ - implicit_link=no \ - chrpath=no \ - manbuild=no \ - sysroot="$(TOOLCHAIN_ROOT_DIR)" \ - target="$(TARGET_CROSS:-=)" - -define Build/InstallDev - $(INSTALL_DIR) $(1)/usr/include - $(CP) $(PKG_INSTALL_DIR)/usr/include/gps.h $(1)/usr/include/ - $(INSTALL_DIR) $(1)/usr/lib - $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgps*.so* $(1)/usr/lib/ - $(INSTALL_DIR) $(1)/usr/lib/pkgconfig - $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libgps.pc $(1)/usr/lib/pkgconfig - $(SED) 's,/usr/include,$$$${prefix}/include,g' $(1)/usr/lib/pkgconfig/libgps.pc - $(SED) 's,/usr/lib,$$$${exec_prefix}/lib,g' $(1)/usr/lib/pkgconfig/libgps.pc -endef - -define Package/gpsd/install - $(INSTALL_DIR) $(1)/etc/config - $(INSTALL_CONF) ./files/gpsd.config $(1)/etc/config/gpsd - $(INSTALL_DIR) $(1)/etc/init.d - $(INSTALL_BIN) ./files/gpsd.init $(1)/etc/init.d/gpsd - $(INSTALL_DIR) $(1)/usr/sbin - $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/gpsd $(1)/usr/sbin/ - - $(INSTALL_DIR) $(1)/etc/gpsd - $(INSTALL_BIN) ./files/etc/gpsd/device-hook $(1)/etc/gpsd/ - - $(INSTALL_DIR) $(1)/etc/uci-defaults - $(INSTALL_DATA) ./files/etc/uci-defaults/* $(1)/etc/uci-defaults/ -endef - -define Package/gpsd-clients/install - $(INSTALL_DIR) $(1)/usr/bin - $(INSTALL_BIN) \ - $(PKG_INSTALL_DIR)/usr/bin/cgps \ - $(PKG_INSTALL_DIR)/usr/bin/gps{ctl,decode,mon,pipe} \ - $(PKG_INSTALL_DIR)/usr/bin/gpxlogger \ - $(PKG_INSTALL_DIR)/usr/bin/lcdgps \ - $(1)/usr/bin/ -endef - -define Package/gpsd-utils/install - $(INSTALL_DIR) $(1)/usr/sbin - $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/gpsdctl $(1)/usr/sbin/ -endef - -define Package/libgps/install - $(INSTALL_DIR) $(1)/usr/lib - $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgps.so.$(ABI_VERSION)* $(1)/usr/lib/ -endef - -$(eval $(call BuildPackage,gpsd)) -$(eval $(call BuildPackage,gpsd-clients)) -$(eval $(call BuildPackage,gpsd-utils)) -$(eval $(call BuildPackage,libgps)) diff --git a/package/openmanet/gpsd/files/gpsd.config b/package/openmanet/gpsd/files/gpsd.config deleted file mode 100644 index 05966ab739..0000000000 --- a/package/openmanet/gpsd/files/gpsd.config +++ /dev/null @@ -1,5 +0,0 @@ -config gpsd 'core' - option enabled '1' - option device '/dev/ttyS0' - option port '2947' - option listen_globally '0' diff --git a/package/openmanet/gpsd/files/gpsd.init b/package/openmanet/gpsd/files/gpsd.init deleted file mode 100644 index 3271d43fdc..0000000000 --- a/package/openmanet/gpsd/files/gpsd.init +++ /dev/null @@ -1,47 +0,0 @@ -#!/bin/sh /etc/rc.common -# Copyright (C) 2009-2011 OpenWrt.org -START=50 - -USE_PROCD=1 -PROG=/usr/sbin/gpsd -NAME=gpsd - -validate_section_gpsd() -{ - uci_load_validate gpsd gpsd "$1" "$2" \ - 'enabled:bool:1' \ - 'device:string' \ - 'listen_globally:bool:0' \ - 'port:port:2947' -} - -gpsd_instance() -{ - [ "$2" = 0 ] || { - echo "validation failed" - return 1 - } - - [ "$enabled" = "0" ] && return 1 - - procd_open_instance - procd_set_param command "$PROG" -N -n - - [ "$listen_globally" -ne 0 ] && procd_append_param command -G - procd_append_param command -S "$port" - procd_append_param command "$device" - procd_set_param respawn - - procd_close_instance -} - -start_service() -{ - config_load "$NAME" - config_foreach validate_section_gpsd gpsd gpsd_instance -} - -service_triggers() { - procd_add_reload_trigger "$NAME" - procd_add_validation validate_section_gpsd -} diff --git a/package/openmanet/openmanetd/Makefile b/package/openmanet/openmanetd/Makefile deleted file mode 100644 index 8469eae09e..0000000000 --- a/package/openmanet/openmanetd/Makefile +++ /dev/null @@ -1,57 +0,0 @@ -include $(TOPDIR)/rules.mk - -PKG_NAME:=openmanetd -PKG_VERSION:=0.0.4 -PKG_RELEASE:=1 - -PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz -PKG_SOURCE_URL:=https://codeload.github.com/openmanet/openmanetd/tar.gz/$(PKG_VERSION)? -PKG_SOURCE_VERSION:=$(PKG_VERSION) -PKG_HASH:=skip - -PKG_LICENSE:=MIT -PKG_MAINTAINER:=Corey Wagehoft - -PKG_BUILD_DEPENDS:=golang/host -PKG_BUILD_PARALLEL:=1 -PKG_BUILD_FLAGS:=no-mips16 - -GO_PKG:=github.com/openmanet/openmanetd -GO_PKG_LDFLAGS_X:=cmd.Version=$(PKG_VERSION) - -include $(INCLUDE_DIR)/package.mk -include ../../../feeds/packages/lang/golang/golang-package.mk - -# Explicit runtime deps (correct OpenWrt syntax) -RDEPENDS:$(PKG_NAME) += libopusfile - -define Package/openmanetd - SECTION:=utils - CATEGORY:=Utilities - TITLE:=OpenMANET Manager - DEPENDS:=$(GO_ARCH_DEPENDS) +kmod-batman-adv +alfred +portaudio +libopus +libevdev +alsa-lib +kmod-usb-core +kmod-usb-audio +kmod-sound-core +libopusfile -endef - -define Package/openmanetd/description -A management application for openmanetd written in Go. -Includes: -- pttgo: A multicast push-to-talk voice application written in Go using PortAudio, Opus, and evdev. -endef - -define Package/openmanetd/conffiles -/etc/openmanetd/ -endef - -define Package/openmanetd/install - $(call GoPackage/Package/Install/Bin,$(1)) - - $(INSTALL_DIR) $(1)/etc/openmanetd/ - $(INSTALL_CONF) $(CURDIR)/files/sample_config.yml $(1)/etc/openmanetd/config.yml - $(INSTALL_DIR) $(1)/etc/config/ - $(INSTALL_CONF) $(CURDIR)/files/openmanetd.config $(1)/etc/config/openmanetd - $(INSTALL_DIR) $(1)/etc/init.d/ - $(INSTALL_BIN) $(CURDIR)/files/openmanetd.init $(1)/etc/init.d/openmanetd -endef - -$(eval $(call GoBinPackage,openmanetd)) -$(eval $(call BuildPackage,openmanetd)) diff --git a/package/openmanet/openmanetd/files/openmanetd.config b/package/openmanet/openmanetd/files/openmanetd.config deleted file mode 100644 index edba37ba80..0000000000 --- a/package/openmanet/openmanetd/files/openmanetd.config +++ /dev/null @@ -1,5 +0,0 @@ -config openmanet 'config' - option enabled '0' - option config '/etc/openmanet/config.yml' - option loglevel 'info' - option logfile '/var/log/openmanet.log' diff --git a/package/openmanet/openmanetd/files/openmanetd.init b/package/openmanet/openmanetd/files/openmanetd.init deleted file mode 100644 index d6c8d6bb8b..0000000000 --- a/package/openmanet/openmanetd/files/openmanetd.init +++ /dev/null @@ -1,39 +0,0 @@ -#!/bin/sh /etc/rc.common - -USE_PROCD=1 -START=99 - -CONF="openmanet" -PROG="/usr/bin/openmanet" - -append_param_arg() { - local value - config_get value "config" "$1" $2 - [ -n "$value" ] && procd_append_param command "--${1//_/-}" "$value" -} - -start_service() { - config_load "$CONF" - - local enabled - config_get_bool enabled "config" "enabled" - [ "$enabled" -eq "1" ] || return 1 - - procd_open_instance "$CONF" - procd_set_param command "$PROG" "tunnel" - procd_append_param command "--no-autoupdate" - - append_param_arg "config" "/etc/openmanet/config.yml" - - procd_append_param command "run" - - procd_set_param respawn - procd_set_param stderr 1 - - procd_close_instance -} - -service_triggers() { - procd_add_reload_trigger "$CONF" - procd_add_interface_trigger "interface.*.up" "wan" /etc/init.d/openmanet restart -} \ No newline at end of file diff --git a/package/openmanet/openmanetd/files/sample_config.yml b/package/openmanet/openmanetd/files/sample_config.yml deleted file mode 100644 index a3dbebeb68..0000000000 --- a/package/openmanet/openmanetd/files/sample_config.yml +++ /dev/null @@ -1 +0,0 @@ -#loglevel: info From 28364405427c03f42a2f98e1af25aaddde69abe4 Mon Sep 17 00:00:00 2001 From: Corey Wagehoft Date: Sat, 15 Nov 2025 12:57:24 -0700 Subject: [PATCH 23/37] update feed --- feeds.conf.default | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/feeds.conf.default b/feeds.conf.default index f59ee5edf4..c5c8c032aa 100644 --- a/feeds.conf.default +++ b/feeds.conf.default @@ -1,4 +1,4 @@ -src-git openmanet https://github.com/OpenMANET/packages^ebae8ae8eaf9be2b99bd0608a687fa486bf84371 +src-git openmanet https://github.com/OpenMANET/packages^7cc991e9964300425fa92a10750bbcdc022c4459 src-git packages https://github.com/openwrt/packages.git^b5ed85f6e94aa08de1433272dc007550f4a28201 src-git routing https://github.com/openwrt/routing.git^e351d1e623e9ef2ab78f28cb1ce8d271d28c902d src-git telephony https://github.com/openwrt/telephony.git^98c8a5aa4624312ed758e2e2b6d4039050a1649d From 06548a118c2fe647997cae02acb40e9b5affae47 Mon Sep 17 00:00:00 2001 From: Corey Wagehoft Date: Sat, 15 Nov 2025 13:16:14 -0700 Subject: [PATCH 24/37] update feed --- feeds.conf.default | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/feeds.conf.default b/feeds.conf.default index c5c8c032aa..15eb2dedfd 100644 --- a/feeds.conf.default +++ b/feeds.conf.default @@ -1,4 +1,4 @@ -src-git openmanet https://github.com/OpenMANET/packages^7cc991e9964300425fa92a10750bbcdc022c4459 +src-git openmanet https://github.com/OpenMANET/packages^ce94912a3d46f699a556d4e30f091df7aa296045 src-git packages https://github.com/openwrt/packages.git^b5ed85f6e94aa08de1433272dc007550f4a28201 src-git routing https://github.com/openwrt/routing.git^e351d1e623e9ef2ab78f28cb1ce8d271d28c902d src-git telephony https://github.com/openwrt/telephony.git^98c8a5aa4624312ed758e2e2b6d4039050a1649d From 6b5085cc8c52e84050b5cb51f457538d759e5d95 Mon Sep 17 00:00:00 2001 From: Corey Wagehoft Date: Sat, 15 Nov 2025 13:19:34 -0700 Subject: [PATCH 25/37] update feed --- feeds.conf.default | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/feeds.conf.default b/feeds.conf.default index 15eb2dedfd..1c2a38ef1d 100644 --- a/feeds.conf.default +++ b/feeds.conf.default @@ -1,4 +1,4 @@ -src-git openmanet https://github.com/OpenMANET/packages^ce94912a3d46f699a556d4e30f091df7aa296045 +src-git openmanet https://github.com/OpenMANET/packages^df910901993457a13260291646c8ada86ebd3aef src-git packages https://github.com/openwrt/packages.git^b5ed85f6e94aa08de1433272dc007550f4a28201 src-git routing https://github.com/openwrt/routing.git^e351d1e623e9ef2ab78f28cb1ce8d271d28c902d src-git telephony https://github.com/openwrt/telephony.git^98c8a5aa4624312ed758e2e2b6d4039050a1649d From 12fbb1614d84b485d3b31172f9379890d3bbaca5 Mon Sep 17 00:00:00 2001 From: Corey Wagehoft Date: Sat, 15 Nov 2025 14:41:06 -0700 Subject: [PATCH 26/37] update feed --- feeds.conf.default | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/feeds.conf.default b/feeds.conf.default index 1c2a38ef1d..2399d13568 100644 --- a/feeds.conf.default +++ b/feeds.conf.default @@ -1,4 +1,4 @@ -src-git openmanet https://github.com/OpenMANET/packages^df910901993457a13260291646c8ada86ebd3aef +src-git openmanet https://github.com/OpenMANET/packages^0dfb16e9524f53bbe479681c9c9cbd6e268f4b6a src-git packages https://github.com/openwrt/packages.git^b5ed85f6e94aa08de1433272dc007550f4a28201 src-git routing https://github.com/openwrt/routing.git^e351d1e623e9ef2ab78f28cb1ce8d271d28c902d src-git telephony https://github.com/openwrt/telephony.git^98c8a5aa4624312ed758e2e2b6d4039050a1649d From 7bfada2bfb27cb07fdf8490c746ace8db7ed234f Mon Sep 17 00:00:00 2001 From: Corey Wagehoft Date: Sat, 15 Nov 2025 15:33:41 -0700 Subject: [PATCH 27/37] update feed --- feeds.conf.default | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/feeds.conf.default b/feeds.conf.default index 2399d13568..3655056e42 100644 --- a/feeds.conf.default +++ b/feeds.conf.default @@ -1,4 +1,4 @@ -src-git openmanet https://github.com/OpenMANET/packages^0dfb16e9524f53bbe479681c9c9cbd6e268f4b6a +src-git openmanet https://github.com/OpenMANET/packages^1faa1404d4704866cc9e9cbbb49833f4dd55d69b src-git packages https://github.com/openwrt/packages.git^b5ed85f6e94aa08de1433272dc007550f4a28201 src-git routing https://github.com/openwrt/routing.git^e351d1e623e9ef2ab78f28cb1ce8d271d28c902d src-git telephony https://github.com/openwrt/telephony.git^98c8a5aa4624312ed758e2e2b6d4039050a1649d From bb50d89a4df335de0a288e27642472d412f7fd6b Mon Sep 17 00:00:00 2001 From: Corey Wagehoft Date: Sat, 15 Nov 2025 16:38:44 -0700 Subject: [PATCH 28/37] update packages --- boards/common/openmanet_diffconfig | 3 ++- package/network/services/umdns/files/umdns.config | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/boards/common/openmanet_diffconfig b/boards/common/openmanet_diffconfig index 7eacc238cd..338603a33d 100644 --- a/boards/common/openmanet_diffconfig +++ b/boards/common/openmanet_diffconfig @@ -131,7 +131,8 @@ CONFIG_PACKAGE_dump1090=y CONFIG_PACKAGE_rtl-sdr=y # mDNS / Avahi -CONFIG_PACKAGE_avahi-dbus-daemon=y +CONFIG_PACKAGE_mdnsresponder=y +CONFIG_PACKAGE_announce=y CONFIG_PACKAGE_avahi-daemon-service-http=y CONFIG_PACKAGE_avahi-daemon-service-ssh=y CONFIG_PACKAGE_avahi-utils=y diff --git a/package/network/services/umdns/files/umdns.config b/package/network/services/umdns/files/umdns.config index d4936bb092..79ac1faa21 100644 --- a/package/network/services/umdns/files/umdns.config +++ b/package/network/services/umdns/files/umdns.config @@ -1,3 +1,3 @@ config umdns option jail 1 - list network lan + list network ahwlan From c989990cb04b3727859452059b0595ce585de619 Mon Sep 17 00:00:00 2001 From: Corey Wagehoft Date: Sat, 15 Nov 2025 17:04:06 -0700 Subject: [PATCH 29/37] update feed --- feeds.conf.default | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/feeds.conf.default b/feeds.conf.default index 3655056e42..29c57590c4 100644 --- a/feeds.conf.default +++ b/feeds.conf.default @@ -1,4 +1,4 @@ -src-git openmanet https://github.com/OpenMANET/packages^1faa1404d4704866cc9e9cbbb49833f4dd55d69b +src-git openmanet https://github.com/OpenMANET/packages^4a6df118368c23c80f849b4cb27a4d65c7242f4f src-git packages https://github.com/openwrt/packages.git^b5ed85f6e94aa08de1433272dc007550f4a28201 src-git routing https://github.com/openwrt/routing.git^e351d1e623e9ef2ab78f28cb1ce8d271d28c902d src-git telephony https://github.com/openwrt/telephony.git^98c8a5aa4624312ed758e2e2b6d4039050a1649d From aec6fb64efd83b5f1c1116150a284225b87172a7 Mon Sep 17 00:00:00 2001 From: Corey Wagehoft Date: Sat, 15 Nov 2025 17:16:59 -0700 Subject: [PATCH 30/37] remove packages --- boards/common/openmanet_diffconfig | 2 -- 1 file changed, 2 deletions(-) diff --git a/boards/common/openmanet_diffconfig b/boards/common/openmanet_diffconfig index 338603a33d..82f410fe8b 100644 --- a/boards/common/openmanet_diffconfig +++ b/boards/common/openmanet_diffconfig @@ -131,8 +131,6 @@ CONFIG_PACKAGE_dump1090=y CONFIG_PACKAGE_rtl-sdr=y # mDNS / Avahi -CONFIG_PACKAGE_mdnsresponder=y -CONFIG_PACKAGE_announce=y CONFIG_PACKAGE_avahi-daemon-service-http=y CONFIG_PACKAGE_avahi-daemon-service-ssh=y CONFIG_PACKAGE_avahi-utils=y From 608faa6bb61643f1e768be0cf4610d263819ba96 Mon Sep 17 00:00:00 2001 From: Corey Wagehoft Date: Sat, 15 Nov 2025 17:43:23 -0700 Subject: [PATCH 31/37] update feed --- feeds.conf.default | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/feeds.conf.default b/feeds.conf.default index 29c57590c4..1e1f04c232 100644 --- a/feeds.conf.default +++ b/feeds.conf.default @@ -1,4 +1,4 @@ -src-git openmanet https://github.com/OpenMANET/packages^4a6df118368c23c80f849b4cb27a4d65c7242f4f +src-git openmanet https://github.com/OpenMANET/packages^9ac92ccac2b84a24e436d8a1e7ab44b05c47a7e8 src-git packages https://github.com/openwrt/packages.git^b5ed85f6e94aa08de1433272dc007550f4a28201 src-git routing https://github.com/openwrt/routing.git^e351d1e623e9ef2ab78f28cb1ce8d271d28c902d src-git telephony https://github.com/openwrt/telephony.git^98c8a5aa4624312ed758e2e2b6d4039050a1649d From 3ad6bd9b09aa974ada9b5182e47294baa906770d Mon Sep 17 00:00:00 2001 From: Corey Wagehoft Date: Sun, 16 Nov 2025 12:46:04 -0700 Subject: [PATCH 32/37] add mt76 kmods --- boards/common/openmanet_diffconfig | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/boards/common/openmanet_diffconfig b/boards/common/openmanet_diffconfig index 82f410fe8b..20d6485a3b 100644 --- a/boards/common/openmanet_diffconfig +++ b/boards/common/openmanet_diffconfig @@ -150,4 +150,6 @@ CONFIG_PACKAGE_kmod-mt7915-firmware=y CONFIG_PACKAGE_kmod-mt7916-firmware=y CONFIG_PACKAGE_kmod-mt7915e=y CONFIG_PACKAGE_kmod-mt7921-firmware=y -CONFIG_PACKAGE_kmod-mt7921e=y \ No newline at end of file +CONFIG_PACKAGE_kmod-mt7921e=y +CONFIG_PACKAGE_kmod-mt7921s=y +CONFIG_PACKAGE_kmod-mt7921u=y From 05a7f196dfecacc71c7aa7c0b1d6960b60100712 Mon Sep 17 00:00:00 2001 From: Corey Wagehoft Date: Tue, 18 Nov 2025 16:01:42 -0700 Subject: [PATCH 33/37] test removing patch --- ...orse-spi-fix-spi-bcm2835-driver-v5.3.patch | 1139 ----------------- 1 file changed, 1139 deletions(-) delete mode 100644 target/linux/bcm27xx/patches-5.15/999-001-morse-spi-fix-spi-bcm2835-driver-v5.3.patch diff --git a/target/linux/bcm27xx/patches-5.15/999-001-morse-spi-fix-spi-bcm2835-driver-v5.3.patch b/target/linux/bcm27xx/patches-5.15/999-001-morse-spi-fix-spi-bcm2835-driver-v5.3.patch deleted file mode 100644 index 8fab175274..0000000000 --- a/target/linux/bcm27xx/patches-5.15/999-001-morse-spi-fix-spi-bcm2835-driver-v5.3.patch +++ /dev/null @@ -1,1139 +0,0 @@ ---- a/drivers/spi/spi-bcm2835.c -+++ b/drivers/spi/spi-bcm2835.c -@@ -25,9 +25,7 @@ - #include - #include - #include --#include --#include /* FIXME: using chip internals */ --#include /* FIXME: using chip internals */ -+#include - #include - #include - -@@ -74,7 +72,7 @@ - #define DRV_NAME "spi-bcm2835" - - /* define polling limits */ --static unsigned int polling_limit_us = 30; -+unsigned int polling_limit_us = 30; - module_param(polling_limit_us, uint, 0664); - MODULE_PARM_DESC(polling_limit_us, - "time in us to run a transfer in polling mode\n"); -@@ -83,10 +81,8 @@ MODULE_PARM_DESC(polling_limit_us, - * struct bcm2835_spi - BCM2835 SPI controller - * @regs: base address of register map - * @clk: core clock, divided to calculate serial clock -- * @clk_hz: core clock cached speed - * @irq: interrupt, signals TX FIFO empty or RX FIFO ¾ full - * @tfr: SPI transfer currently processed -- * @ctlr: SPI controller reverse lookup - * @tx_buf: pointer whence next transmitted byte is read - * @rx_buf: pointer where next received byte is written - * @tx_len: remaining bytes to transmit -@@ -96,6 +92,7 @@ MODULE_PARM_DESC(polling_limit_us, - * @rx_prologue: bytes received without DMA if first RX sglist entry's - * length is not a multiple of 4 (to overcome hardware limitation) - * @tx_spillover: whether @tx_prologue spills over to second TX sglist entry -+ * @dma_pending: whether a DMA transfer is in progress - * @debugfs_dir: the debugfs directory - neede to remove debugfs when - * unloading the module - * @count_transfer_polling: count of how often polling mode is used -@@ -105,19 +102,10 @@ MODULE_PARM_DESC(polling_limit_us, - * These are counted as well in @count_transfer_polling and - * @count_transfer_irq - * @count_transfer_dma: count how often dma mode is used -- * @slv: SPI slave currently selected -- * (used by bcm2835_spi_dma_tx_done() to write @clear_rx_cs) -- * @tx_dma_active: whether a TX DMA descriptor is in progress -- * @rx_dma_active: whether a RX DMA descriptor is in progress -- * (used by bcm2835_spi_dma_tx_done() to handle a race) -- * @fill_tx_desc: preallocated TX DMA descriptor used for RX-only transfers -- * (cyclically copies from zero page to TX FIFO) -- * @fill_tx_addr: bus address of zero page - */ - struct bcm2835_spi { - void __iomem *regs; - struct clk *clk; -- unsigned long clk_hz; - int irq; - struct spi_transfer *tfr; - struct spi_controller *ctlr; -@@ -128,35 +116,13 @@ struct bcm2835_spi { - int tx_prologue; - int rx_prologue; - unsigned int tx_spillover; -+ unsigned int dma_pending; - - struct dentry *debugfs_dir; - u64 count_transfer_polling; - u64 count_transfer_irq; - u64 count_transfer_irq_after_polling; - u64 count_transfer_dma; -- -- struct bcm2835_spidev *slv; -- unsigned int tx_dma_active; -- unsigned int rx_dma_active; -- struct dma_async_tx_descriptor *fill_tx_desc; -- dma_addr_t fill_tx_addr; --}; -- --/** -- * struct bcm2835_spidev - BCM2835 SPI slave -- * @prepare_cs: precalculated CS register value for ->prepare_message() -- * (uses slave-specific clock polarity and phase settings) -- * @clear_rx_desc: preallocated RX DMA descriptor used for TX-only transfers -- * (cyclically clears RX FIFO by writing @clear_rx_cs to CS register) -- * @clear_rx_addr: bus address of @clear_rx_cs -- * @clear_rx_cs: precalculated CS register value to clear RX FIFO -- * (uses slave-specific clock polarity and phase settings) -- */ --struct bcm2835_spidev { -- u32 prepare_cs; -- struct dma_async_tx_descriptor *clear_rx_desc; -- dma_addr_t clear_rx_addr; -- u32 clear_rx_cs ____cacheline_aligned; - }; - - #if defined(CONFIG_DEBUG_FS) -@@ -200,12 +166,12 @@ static void bcm2835_debugfs_remove(struc - } - #endif /* CONFIG_DEBUG_FS */ - --static inline u32 bcm2835_rd(struct bcm2835_spi *bs, unsigned int reg) -+static inline u32 bcm2835_rd(struct bcm2835_spi *bs, unsigned reg) - { - return readl(bs->regs + reg); - } - --static inline void bcm2835_wr(struct bcm2835_spi *bs, unsigned int reg, u32 val) -+static inline void bcm2835_wr(struct bcm2835_spi *bs, unsigned reg, u32 val) - { - writel(val, bs->regs + reg); - } -@@ -252,13 +218,13 @@ static inline void bcm2835_rd_fifo_count - - bs->rx_len -= count; - -- do { -+ while (count > 0) { - val = bcm2835_rd(bs, BCM2835_SPI_FIFO); - len = min(count, 4); - memcpy(bs->rx_buf, &val, len); - bs->rx_buf += len; - count -= 4; -- } while (count > 0); -+ } - } - - /** -@@ -278,7 +244,7 @@ static inline void bcm2835_wr_fifo_count - - bs->tx_len -= count; - -- do { -+ while (count > 0) { - if (bs->tx_buf) { - len = min(count, 4); - memcpy(&val, bs->tx_buf, len); -@@ -288,7 +254,7 @@ static inline void bcm2835_wr_fifo_count - } - bcm2835_wr(bs, BCM2835_SPI_FIFO, val); - count -= 4; -- } while (count > 0); -+ } - } - - /** -@@ -317,11 +283,12 @@ static inline void bcm2835_rd_fifo_blind - count = min(count, bs->rx_len); - bs->rx_len -= count; - -- do { -+ while (count) { - val = bcm2835_rd(bs, BCM2835_SPI_FIFO); - if (bs->rx_buf) - *bs->rx_buf++ = val; -- } while (--count); -+ count--; -+ } - } - - /** -@@ -336,14 +303,16 @@ static inline void bcm2835_wr_fifo_blind - count = min(count, bs->tx_len); - bs->tx_len -= count; - -- do { -+ while (count) { - val = bs->tx_buf ? *bs->tx_buf++ : 0; - bcm2835_wr(bs, BCM2835_SPI_FIFO, val); -- } while (--count); -+ count--; -+ } - } - --static void bcm2835_spi_reset_hw(struct bcm2835_spi *bs) -+static void bcm2835_spi_reset_hw(struct spi_controller *ctlr) - { -+ struct bcm2835_spi *bs = spi_controller_get_devdata(ctlr); - u32 cs = bcm2835_rd(bs, BCM2835_SPI_CS); - - /* Disable SPI interrupts and transfer */ -@@ -351,13 +320,6 @@ static void bcm2835_spi_reset_hw(struct - BCM2835_SPI_CS_INTD | - BCM2835_SPI_CS_DMAEN | - BCM2835_SPI_CS_TA); -- /* -- * Transmission sometimes breaks unless the DONE bit is written at the -- * end of every transfer. The spec says it's a RO bit. Either the -- * spec is wrong and the bit is actually of type RW1C, or it's a -- * hardware erratum. -- */ -- cs |= BCM2835_SPI_CS_DONE; - /* and reset RX/TX FIFOS */ - cs |= BCM2835_SPI_CS_CLEAR_RX | BCM2835_SPI_CS_CLEAR_TX; - -@@ -369,7 +331,8 @@ static void bcm2835_spi_reset_hw(struct - - static irqreturn_t bcm2835_spi_interrupt(int irq, void *dev_id) - { -- struct bcm2835_spi *bs = dev_id; -+ struct spi_controller *ctlr = dev_id; -+ struct bcm2835_spi *bs = spi_controller_get_devdata(ctlr); - u32 cs = bcm2835_rd(bs, BCM2835_SPI_CS); - - /* -@@ -395,7 +358,7 @@ static irqreturn_t bcm2835_spi_interrupt - - if (!bs->rx_len) { - /* Transfer complete - reset SPI HW */ -- bcm2835_spi_reset_hw(bs); -+ bcm2835_spi_reset_hw(ctlr); - /* wake up the framework */ - spi_finalize_current_transfer(bs->ctlr); - } -@@ -490,14 +453,14 @@ static void bcm2835_spi_transfer_prologu - bs->rx_prologue = 0; - bs->tx_spillover = false; - -- if (bs->tx_buf && !sg_is_last(&tfr->tx_sg.sgl[0])) -+ if (!sg_is_last(&tfr->tx_sg.sgl[0])) - bs->tx_prologue = sg_dma_len(&tfr->tx_sg.sgl[0]) & 3; - -- if (bs->rx_buf && !sg_is_last(&tfr->rx_sg.sgl[0])) { -+ if (!sg_is_last(&tfr->rx_sg.sgl[0])) { - bs->rx_prologue = sg_dma_len(&tfr->rx_sg.sgl[0]) & 3; - - if (bs->rx_prologue > bs->tx_prologue) { -- if (!bs->tx_buf || sg_is_last(&tfr->tx_sg.sgl[0])) { -+ if (sg_is_last(&tfr->tx_sg.sgl[0])) { - bs->tx_prologue = bs->rx_prologue; - } else { - bs->tx_prologue += 4; -@@ -519,9 +482,7 @@ static void bcm2835_spi_transfer_prologu - bcm2835_wr_fifo_count(bs, bs->rx_prologue); - bcm2835_wait_tx_fifo_empty(bs); - bcm2835_rd_fifo_count(bs, bs->rx_prologue); -- bcm2835_wr(bs, BCM2835_SPI_CS, cs | BCM2835_SPI_CS_CLEAR_RX -- | BCM2835_SPI_CS_CLEAR_TX -- | BCM2835_SPI_CS_DONE); -+ bcm2835_spi_reset_hw(ctlr); - - dma_sync_single_for_device(ctlr->dma_rx->device->dev, - sg_dma_address(&tfr->rx_sg.sgl[0]), -@@ -531,9 +492,6 @@ static void bcm2835_spi_transfer_prologu - sg_dma_len(&tfr->rx_sg.sgl[0]) -= bs->rx_prologue; - } - -- if (!bs->tx_buf) -- return; -- - /* - * Write remaining TX prologue. Adjust first entry in TX sglist. - * Also adjust second entry if prologue spills over to it. -@@ -545,8 +503,7 @@ static void bcm2835_spi_transfer_prologu - | BCM2835_SPI_CS_DMAEN); - bcm2835_wr_fifo_count(bs, tx_remaining); - bcm2835_wait_tx_fifo_empty(bs); -- bcm2835_wr(bs, BCM2835_SPI_CS, cs | BCM2835_SPI_CS_CLEAR_TX -- | BCM2835_SPI_CS_DONE); -+ bcm2835_wr(bs, BCM2835_SPI_CS, cs | BCM2835_SPI_CS_CLEAR_TX); - } - - if (likely(!bs->tx_spillover)) { -@@ -579,9 +536,6 @@ static void bcm2835_spi_undo_prologue(st - sg_dma_len(&tfr->rx_sg.sgl[0]) += bs->rx_prologue; - } - -- if (!bs->tx_buf) -- goto out; -- - if (likely(!bs->tx_spillover)) { - sg_dma_address(&tfr->tx_sg.sgl[0]) -= bs->tx_prologue; - sg_dma_len(&tfr->tx_sg.sgl[0]) += bs->tx_prologue; -@@ -590,84 +544,32 @@ static void bcm2835_spi_undo_prologue(st - sg_dma_address(&tfr->tx_sg.sgl[1]) -= 4; - sg_dma_len(&tfr->tx_sg.sgl[1]) += 4; - } --out: -- bs->tx_prologue = 0; - } - --/** -- * bcm2835_spi_dma_rx_done() - callback for DMA RX channel -- * @data: SPI master controller -- * -- * Used for bidirectional and RX-only transfers. -- */ --static void bcm2835_spi_dma_rx_done(void *data) -+static void bcm2835_spi_dma_done(void *data) - { - struct spi_controller *ctlr = data; - struct bcm2835_spi *bs = spi_controller_get_devdata(ctlr); - -- /* terminate tx-dma as we do not have an irq for it -+ /* reset fifo and HW */ -+ bcm2835_spi_reset_hw(ctlr); -+ -+ /* and terminate tx-dma as we do not have an irq for it - * because when the rx dma will terminate and this callback - * is called the tx-dma must have finished - can't get to this - * situation otherwise... - */ -- dmaengine_terminate_async(ctlr->dma_tx); -- bs->tx_dma_active = false; -- bs->rx_dma_active = false; -- bcm2835_spi_undo_prologue(bs); -- -- /* reset fifo and HW */ -- bcm2835_spi_reset_hw(bs); - -+ if (cmpxchg(&bs->dma_pending, true, false)) { -+ dmaengine_terminate_async(ctlr->dma_tx); -+ bcm2835_spi_undo_prologue(bs); -+ } - /* and mark as completed */; - spi_finalize_current_transfer(ctlr); - } - --/** -- * bcm2835_spi_dma_tx_done() - callback for DMA TX channel -- * @data: SPI master controller -- * -- * Used for TX-only transfers. -- */ --static void bcm2835_spi_dma_tx_done(void *data) --{ -- struct spi_controller *ctlr = data; -- struct bcm2835_spi *bs = spi_controller_get_devdata(ctlr); -- -- /* busy-wait for TX FIFO to empty */ -- while (!(bcm2835_rd(bs, BCM2835_SPI_CS) & BCM2835_SPI_CS_DONE)) -- bcm2835_wr(bs, BCM2835_SPI_CS, bs->slv->clear_rx_cs); -- -- bs->tx_dma_active = false; -- smp_wmb(); -- -- /* -- * In case of a very short transfer, RX DMA may not have been -- * issued yet. The onus is then on bcm2835_spi_transfer_one_dma() -- * to terminate it immediately after issuing. -- */ -- if (cmpxchg(&bs->rx_dma_active, true, false)) -- dmaengine_terminate_async(ctlr->dma_rx); -- -- bcm2835_spi_undo_prologue(bs); -- bcm2835_spi_reset_hw(bs); -- spi_finalize_current_transfer(ctlr); --} -- --/** -- * bcm2835_spi_prepare_sg() - prepare and submit DMA descriptor for sglist -- * @ctlr: SPI master controller -- * @tfr: SPI transfer -- * @bs: BCM2835 SPI controller -- * @slv: BCM2835 SPI slave -- * @is_tx: whether to submit DMA descriptor for TX or RX sglist -- * -- * Prepare and submit a DMA descriptor for the TX or RX sglist of @tfr. -- * Return 0 on success or a negative error number. -- */ - static int bcm2835_spi_prepare_sg(struct spi_controller *ctlr, - struct spi_transfer *tfr, -- struct bcm2835_spi *bs, -- struct bcm2835_spidev *slv, - bool is_tx) - { - struct dma_chan *chan; -@@ -684,7 +586,7 @@ static int bcm2835_spi_prepare_sg(struct - chan = ctlr->dma_tx; - nents = tfr->tx_sg.nents; - sgl = tfr->tx_sg.sgl; -- flags = tfr->rx_buf ? 0 : DMA_PREP_INTERRUPT; -+ flags = 0 /* no tx interrupt */; - } else { - dir = DMA_DEV_TO_MEM; - chan = ctlr->dma_rx; -@@ -697,17 +599,10 @@ static int bcm2835_spi_prepare_sg(struct - if (!desc) - return -EINVAL; - -- /* -- * Completion is signaled by the RX channel for bidirectional and -- * RX-only transfers; else by the TX channel for TX-only transfers. -- */ -+ /* set callback for rx */ - if (!is_tx) { -- desc->callback = bcm2835_spi_dma_rx_done; -- desc->callback_param = ctlr; -- } else if (!tfr->rx_buf) { -- desc->callback = bcm2835_spi_dma_tx_done; -+ desc->callback = bcm2835_spi_dma_done; - desc->callback_param = ctlr; -- bs->slv = slv; - } - - /* submit it to DMA-engine */ -@@ -716,60 +611,12 @@ static int bcm2835_spi_prepare_sg(struct - return dma_submit_error(cookie); - } - --/** -- * bcm2835_spi_transfer_one_dma() - perform SPI transfer using DMA engine -- * @ctlr: SPI master controller -- * @tfr: SPI transfer -- * @slv: BCM2835 SPI slave -- * @cs: CS register -- * -- * For *bidirectional* transfers (both tx_buf and rx_buf are non-%NULL), set up -- * the TX and RX DMA channel to copy between memory and FIFO register. -- * -- * For *TX-only* transfers (rx_buf is %NULL), copying the RX FIFO's contents to -- * memory is pointless. However not reading the RX FIFO isn't an option either -- * because transmission is halted once it's full. As a workaround, cyclically -- * clear the RX FIFO by setting the CLEAR_RX bit in the CS register. -- * -- * The CS register value is precalculated in bcm2835_spi_setup(). Normally -- * this is called only once, on slave registration. A DMA descriptor to write -- * this value is preallocated in bcm2835_dma_init(). All that's left to do -- * when performing a TX-only transfer is to submit this descriptor to the RX -- * DMA channel. Latency is thereby minimized. The descriptor does not -- * generate any interrupts while running. It must be terminated once the -- * TX DMA channel is done. -- * -- * Clearing the RX FIFO is paced by the DREQ signal. The signal is asserted -- * when the RX FIFO becomes half full, i.e. 32 bytes. (Tuneable with the DC -- * register.) Reading 32 bytes from the RX FIFO would normally require 8 bus -- * accesses, whereas clearing it requires only 1 bus access. So an 8-fold -- * reduction in bus traffic and thus energy consumption is achieved. -- * -- * For *RX-only* transfers (tx_buf is %NULL), fill the TX FIFO by cyclically -- * copying from the zero page. The DMA descriptor to do this is preallocated -- * in bcm2835_dma_init(). It must be terminated once the RX DMA channel is -- * done and can then be reused. -- * -- * The BCM2835 DMA driver autodetects when a transaction copies from the zero -- * page and utilizes the DMA controller's ability to synthesize zeroes instead -- * of copying them from memory. This reduces traffic on the memory bus. The -- * feature is not available on so-called "lite" channels, but normally TX DMA -- * is backed by a full-featured channel. -- * -- * Zero-filling the TX FIFO is paced by the DREQ signal. Unfortunately the -- * BCM2835 SPI controller continues to assert DREQ even after the DLEN register -- * has been counted down to zero (hardware erratum). Thus, when the transfer -- * has finished, the DMA engine zero-fills the TX FIFO until it is half full. -- * (Tuneable with the DC register.) So up to 9 gratuitous bus accesses are -- * performed at the end of an RX-only transfer. -- */ - static int bcm2835_spi_transfer_one_dma(struct spi_controller *ctlr, -+ struct spi_device *spi, - struct spi_transfer *tfr, -- struct bcm2835_spidev *slv, - u32 cs) - { - struct bcm2835_spi *bs = spi_controller_get_devdata(ctlr); -- dma_cookie_t cookie; - int ret; - - /* update usage statistics */ -@@ -782,15 +629,16 @@ static int bcm2835_spi_transfer_one_dma( - bcm2835_spi_transfer_prologue(ctlr, tfr, bs, cs); - - /* setup tx-DMA */ -- if (bs->tx_buf) { -- ret = bcm2835_spi_prepare_sg(ctlr, tfr, bs, slv, true); -- } else { -- cookie = dmaengine_submit(bs->fill_tx_desc); -- ret = dma_submit_error(cookie); -- } -+ ret = bcm2835_spi_prepare_sg(ctlr, tfr, true); - if (ret) - goto err_reset_hw; - -+ /* start TX early */ -+ dma_async_issue_pending(ctlr->dma_tx); -+ -+ /* mark as dma pending */ -+ bs->dma_pending = 1; -+ - /* set the DMA length */ - bcm2835_wr(bs, BCM2835_SPI_DLEN, bs->tx_len); - -@@ -798,49 +646,26 @@ static int bcm2835_spi_transfer_one_dma( - bcm2835_wr(bs, BCM2835_SPI_CS, - cs | BCM2835_SPI_CS_TA | BCM2835_SPI_CS_DMAEN); - -- bs->tx_dma_active = true; -- smp_wmb(); -- -- /* start TX early */ -- dma_async_issue_pending(ctlr->dma_tx); -- - /* setup rx-DMA late - to run transfers while - * mapping of the rx buffers still takes place - * this saves 10us or more. - */ -- if (bs->rx_buf) { -- ret = bcm2835_spi_prepare_sg(ctlr, tfr, bs, slv, false); -- } else { -- cookie = dmaengine_submit(slv->clear_rx_desc); -- ret = dma_submit_error(cookie); -- } -+ ret = bcm2835_spi_prepare_sg(ctlr, tfr, false); - if (ret) { - /* need to reset on errors */ - dmaengine_terminate_sync(ctlr->dma_tx); -- bs->tx_dma_active = false; -+ bs->dma_pending = false; - goto err_reset_hw; - } - - /* start rx dma late */ - dma_async_issue_pending(ctlr->dma_rx); -- bs->rx_dma_active = true; -- smp_mb(); -- -- /* -- * In case of a very short TX-only transfer, bcm2835_spi_dma_tx_done() -- * may run before RX DMA is issued. Terminate RX DMA if so. -- */ -- if (!bs->rx_buf && !bs->tx_dma_active && -- cmpxchg(&bs->rx_dma_active, true, false)) { -- dmaengine_terminate_async(ctlr->dma_rx); -- bcm2835_spi_reset_hw(bs); -- } - - /* wait for wakeup in framework */ - return 1; - - err_reset_hw: -- bcm2835_spi_reset_hw(bs); -+ bcm2835_spi_reset_hw(ctlr); - bcm2835_spi_undo_prologue(bs); - return ret; - } -@@ -857,21 +682,10 @@ static bool bcm2835_spi_can_dma(struct s - return true; - } - --static void bcm2835_dma_release(struct spi_controller *ctlr, -- struct bcm2835_spi *bs) -+static void bcm2835_dma_release(struct spi_controller *ctlr) - { - if (ctlr->dma_tx) { - dmaengine_terminate_sync(ctlr->dma_tx); -- -- if (bs->fill_tx_desc) -- dmaengine_desc_free(bs->fill_tx_desc); -- -- if (bs->fill_tx_addr) -- dma_unmap_page_attrs(ctlr->dma_tx->device->dev, -- bs->fill_tx_addr, sizeof(u32), -- DMA_TO_DEVICE, -- DMA_ATTR_SKIP_CPU_SYNC); -- - dma_release_channel(ctlr->dma_tx); - ctlr->dma_tx = NULL; - } -@@ -883,8 +697,7 @@ static void bcm2835_dma_release(struct s - } - } - --static int bcm2835_dma_init(struct spi_controller *ctlr, struct device *dev, -- struct bcm2835_spi *bs) -+static void bcm2835_dma_init(struct spi_controller *ctlr, struct device *dev) - { - struct dma_slave_config slave_config; - const __be32 *addr; -@@ -895,32 +708,23 @@ static int bcm2835_dma_init(struct spi_c - addr = of_get_address(ctlr->dev.of_node, 0, NULL, NULL); - if (!addr) { - dev_err(dev, "could not get DMA-register address - not using dma mode\n"); -- /* Fall back to interrupt mode */ -- return 0; -+ goto err; - } - dma_reg_base = be32_to_cpup(addr); - - /* get tx/rx dma */ -- ctlr->dma_tx = dma_request_chan(dev, "tx"); -- if (IS_ERR(ctlr->dma_tx)) { -+ ctlr->dma_tx = dma_request_slave_channel(dev, "tx"); -+ if (!ctlr->dma_tx) { - dev_err(dev, "no tx-dma configuration found - not using dma mode\n"); -- ret = PTR_ERR(ctlr->dma_tx); -- ctlr->dma_tx = NULL; - goto err; - } -- ctlr->dma_rx = dma_request_chan(dev, "rx"); -- if (IS_ERR(ctlr->dma_rx)) { -+ ctlr->dma_rx = dma_request_slave_channel(dev, "rx"); -+ if (!ctlr->dma_rx) { - dev_err(dev, "no rx-dma configuration found - not using dma mode\n"); -- ret = PTR_ERR(ctlr->dma_rx); -- ctlr->dma_rx = NULL; - goto err_release; - } - -- /* -- * The TX DMA channel either copies a transfer's TX buffer to the FIFO -- * or, in case of an RX-only transfer, cyclically copies from the zero -- * page to the FIFO using a preallocated, reusable descriptor. -- */ -+ /* configure DMAs */ - slave_config.dst_addr = (u32)(dma_reg_base + BCM2835_SPI_FIFO); - slave_config.dst_addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES; - -@@ -928,42 +732,8 @@ static int bcm2835_dma_init(struct spi_c - if (ret) - goto err_config; - -- bs->fill_tx_addr = dma_map_page_attrs(ctlr->dma_tx->device->dev, -- ZERO_PAGE(0), 0, sizeof(u32), -- DMA_TO_DEVICE, -- DMA_ATTR_SKIP_CPU_SYNC); -- if (dma_mapping_error(ctlr->dma_tx->device->dev, bs->fill_tx_addr)) { -- dev_err(dev, "cannot map zero page - not using DMA mode\n"); -- bs->fill_tx_addr = 0; -- ret = -ENOMEM; -- goto err_release; -- } -- -- bs->fill_tx_desc = dmaengine_prep_dma_cyclic(ctlr->dma_tx, -- bs->fill_tx_addr, -- sizeof(u32), 0, -- DMA_MEM_TO_DEV, 0); -- if (!bs->fill_tx_desc) { -- dev_err(dev, "cannot prepare fill_tx_desc - not using DMA mode\n"); -- ret = -ENOMEM; -- goto err_release; -- } -- -- ret = dmaengine_desc_set_reuse(bs->fill_tx_desc); -- if (ret) { -- dev_err(dev, "cannot reuse fill_tx_desc - not using DMA mode\n"); -- goto err_release; -- } -- -- /* -- * The RX DMA channel is used bidirectionally: It either reads the -- * RX FIFO or, in case of a TX-only transfer, cyclically writes a -- * precalculated value to the CS register to clear the RX FIFO. -- */ - slave_config.src_addr = (u32)(dma_reg_base + BCM2835_SPI_FIFO); - slave_config.src_addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES; -- slave_config.dst_addr = (u32)(dma_reg_base + BCM2835_SPI_CS); -- slave_config.dst_addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES; - - ret = dmaengine_slave_config(ctlr->dma_rx, &slave_config); - if (ret) -@@ -971,23 +741,18 @@ static int bcm2835_dma_init(struct spi_c - - /* all went well, so set can_dma */ - ctlr->can_dma = bcm2835_spi_can_dma; -+ /* need to do TX AND RX DMA, so we need dummy buffers */ -+ ctlr->flags = SPI_CONTROLLER_MUST_RX | SPI_CONTROLLER_MUST_TX; - -- return 0; -+ return; - - err_config: - dev_err(dev, "issue configuring dma: %d - not using DMA mode\n", - ret); - err_release: -- bcm2835_dma_release(ctlr, bs); -+ bcm2835_dma_release(ctlr); - err: -- /* -- * Only report error for deferred probing, otherwise fall back to -- * interrupt mode -- */ -- if (ret != -EPROBE_DEFER) -- ret = 0; -- -- return ret; -+ return; - } - - static int bcm2835_spi_transfer_one_poll(struct spi_controller *ctlr, -@@ -1040,7 +805,7 @@ static int bcm2835_spi_transfer_one_poll - } - - /* Transfer complete - reset SPI HW */ -- bcm2835_spi_reset_hw(bs); -+ bcm2835_spi_reset_hw(ctlr); - /* and return without waiting for completion */ - return 0; - } -@@ -1050,29 +815,19 @@ static int bcm2835_spi_transfer_one(stru - struct spi_transfer *tfr) - { - struct bcm2835_spi *bs = spi_controller_get_devdata(ctlr); -- struct bcm2835_spidev *slv = spi_get_ctldata(spi); -- unsigned long spi_hz, cdiv; -+ unsigned long spi_hz, clk_hz, cdiv, spi_used_hz; - unsigned long hz_per_byte, byte_limit; -- u32 cs = slv->prepare_cs; -- -- if (unlikely(!tfr->len)) { -- static int warned; -- -- if (!warned) -- dev_warn(&spi->dev, -- "zero-length SPI transfer ignored\n"); -- warned = 1; -- return 0; -- } -+ u32 cs = bcm2835_rd(bs, BCM2835_SPI_CS); - - /* set clock */ - spi_hz = tfr->speed_hz; -+ clk_hz = clk_get_rate(bs->clk); - -- if (spi_hz >= bs->clk_hz / 2) { -+ if (spi_hz >= clk_hz / 2) { - cdiv = 2; /* clk_hz/2 is the fastest we can go */ - } else if (spi_hz) { - /* CDIV must be a multiple of two */ -- cdiv = DIV_ROUND_UP(bs->clk_hz, spi_hz); -+ cdiv = DIV_ROUND_UP(clk_hz, spi_hz); - cdiv += (cdiv % 2); - - if (cdiv >= 65536) -@@ -1080,12 +835,23 @@ static int bcm2835_spi_transfer_one(stru - } else { - cdiv = 0; /* 0 is the slowest we can go */ - } -- tfr->effective_speed_hz = cdiv ? (bs->clk_hz / cdiv) : (bs->clk_hz / 65536); -+ spi_used_hz = cdiv ? (clk_hz / cdiv) : (clk_hz / 65536); - bcm2835_wr(bs, BCM2835_SPI_CLK, cdiv); - - /* handle all the 3-wire mode */ -- if (spi->mode & SPI_3WIRE && tfr->rx_buf) -+ if (spi->mode & SPI_3WIRE && tfr->rx_buf && -+ tfr->rx_buf != ctlr->dummy_rx) - cs |= BCM2835_SPI_CS_REN; -+ else -+ cs &= ~BCM2835_SPI_CS_REN; -+ -+ /* -+ * The driver always uses software-controlled GPIO Chip Select. -+ * Set the hardware-controlled native Chip Select to an invalid -+ * value to prevent it from interfering. -+ */ -+ cs |= BCM2835_SPI_CS_CS_10 | BCM2835_SPI_CS_CS_01; -+ - - /* set transmit buffers and length */ - bs->tx_buf = tfr->tx_buf; -@@ -1100,7 +866,7 @@ static int bcm2835_spi_transfer_one(stru - * per 300,000 Hz of bus clock. - */ - hz_per_byte = polling_limit_us ? (9 * 1000000) / polling_limit_us : 0; -- byte_limit = hz_per_byte ? tfr->effective_speed_hz / hz_per_byte : 1; -+ byte_limit = hz_per_byte ? spi_used_hz / hz_per_byte : 1; - - /* run in polling mode for short transfers */ - if (tfr->len < byte_limit) -@@ -1111,7 +877,7 @@ static int bcm2835_spi_transfer_one(stru - * this 1 idle clock cycle pattern but runs the spi clock without gaps - */ - if (ctlr->can_dma && bcm2835_spi_can_dma(ctlr, spi, tfr)) -- return bcm2835_spi_transfer_one_dma(ctlr, tfr, slv, cs); -+ return bcm2835_spi_transfer_one_dma(ctlr, spi, tfr, cs); - - /* run in interrupt-mode */ - return bcm2835_spi_transfer_one_irq(ctlr, spi, tfr, cs, true); -@@ -1122,7 +888,7 @@ static int bcm2835_spi_prepare_message(s - { - struct spi_device *spi = msg->spi; - struct bcm2835_spi *bs = spi_controller_get_devdata(ctlr); -- struct bcm2835_spidev *slv = spi_get_ctldata(spi); -+ u32 cs = bcm2835_rd(bs, BCM2835_SPI_CS); - int ret; - - if (ctlr->can_dma) { -@@ -1137,11 +903,14 @@ static int bcm2835_spi_prepare_message(s - return ret; - } - -- /* -- * Set up clock polarity before spi_transfer_one_message() asserts -- * chip select to avoid a gratuitous clock signal edge. -- */ -- bcm2835_wr(bs, BCM2835_SPI_CS, slv->prepare_cs); -+ cs &= ~(BCM2835_SPI_CS_CPOL | BCM2835_SPI_CS_CPHA); -+ -+ if (spi->mode & SPI_CPOL) -+ cs |= BCM2835_SPI_CS_CPOL; -+ if (spi->mode & SPI_CPHA) -+ cs |= BCM2835_SPI_CS_CPHA; -+ -+ bcm2835_wr(bs, BCM2835_SPI_CS, cs); - - return 0; - } -@@ -1152,18 +921,14 @@ static void bcm2835_spi_handle_err(struc - struct bcm2835_spi *bs = spi_controller_get_devdata(ctlr); - - /* if an error occurred and we have an active dma, then terminate */ -- if (ctlr->dma_tx) { -+ if (cmpxchg(&bs->dma_pending, true, false)) { - dmaengine_terminate_sync(ctlr->dma_tx); -- bs->tx_dma_active = false; -- } -- if (ctlr->dma_rx) { - dmaengine_terminate_sync(ctlr->dma_rx); -- bs->rx_dma_active = false; -+ bcm2835_spi_undo_prologue(bs); - } -- bcm2835_spi_undo_prologue(bs); - - /* and reset */ -- bcm2835_spi_reset_hw(bs); -+ bcm2835_spi_reset_hw(ctlr); - } - - static int chip_match_name(struct gpio_chip *chip, void *data) -@@ -1171,120 +936,17 @@ static int chip_match_name(struct gpio_c - return !strcmp(chip->label, data); - } - --static void bcm2835_spi_cleanup(struct spi_device *spi) --{ -- struct bcm2835_spidev *slv = spi_get_ctldata(spi); -- struct spi_controller *ctlr = spi->controller; -- -- if (slv->clear_rx_desc) -- dmaengine_desc_free(slv->clear_rx_desc); -- -- if (slv->clear_rx_addr) -- dma_unmap_single(ctlr->dma_rx->device->dev, -- slv->clear_rx_addr, -- sizeof(u32), -- DMA_TO_DEVICE); -- -- kfree(slv); --} -- --static int bcm2835_spi_setup_dma(struct spi_controller *ctlr, -- struct spi_device *spi, -- struct bcm2835_spi *bs, -- struct bcm2835_spidev *slv) --{ -- int ret; -- -- if (!ctlr->dma_rx) -- return 0; -- -- slv->clear_rx_addr = dma_map_single(ctlr->dma_rx->device->dev, -- &slv->clear_rx_cs, -- sizeof(u32), -- DMA_TO_DEVICE); -- if (dma_mapping_error(ctlr->dma_rx->device->dev, slv->clear_rx_addr)) { -- dev_err(&spi->dev, "cannot map clear_rx_cs\n"); -- slv->clear_rx_addr = 0; -- return -ENOMEM; -- } -- -- slv->clear_rx_desc = dmaengine_prep_dma_cyclic(ctlr->dma_rx, -- slv->clear_rx_addr, -- sizeof(u32), 0, -- DMA_MEM_TO_DEV, 0); -- if (!slv->clear_rx_desc) { -- dev_err(&spi->dev, "cannot prepare clear_rx_desc\n"); -- return -ENOMEM; -- } -- -- ret = dmaengine_desc_set_reuse(slv->clear_rx_desc); -- if (ret) { -- dev_err(&spi->dev, "cannot reuse clear_rx_desc\n"); -- return ret; -- } -- -- return 0; --} -- - static int bcm2835_spi_setup(struct spi_device *spi) - { -- struct spi_controller *ctlr = spi->controller; -- struct bcm2835_spi *bs = spi_controller_get_devdata(ctlr); -- struct bcm2835_spidev *slv = spi_get_ctldata(spi); -+ int err; - struct gpio_chip *chip; -- int ret; -- u32 cs; -- -- if (!slv) { -- slv = kzalloc(ALIGN(sizeof(*slv), dma_get_cache_alignment()), -- GFP_KERNEL); -- if (!slv) -- return -ENOMEM; -- -- spi_set_ctldata(spi, slv); -- -- ret = bcm2835_spi_setup_dma(ctlr, spi, bs, slv); -- if (ret) -- goto err_cleanup; -- } -- -- /* -- * Precalculate SPI slave's CS register value for ->prepare_message(): -- * The driver always uses software-controlled GPIO chip select, hence -- * set the hardware-controlled native chip select to an invalid value -- * to prevent it from interfering. -- */ -- cs = BCM2835_SPI_CS_CS_10 | BCM2835_SPI_CS_CS_01; -- if (spi->mode & SPI_CPOL) -- cs |= BCM2835_SPI_CS_CPOL; -- if (spi->mode & SPI_CPHA) -- cs |= BCM2835_SPI_CS_CPHA; -- slv->prepare_cs = cs; -- -- /* -- * Precalculate SPI slave's CS register value to clear RX FIFO -- * in case of a TX-only DMA transfer. -- */ -- if (ctlr->dma_rx) { -- slv->clear_rx_cs = cs | BCM2835_SPI_CS_TA | -- BCM2835_SPI_CS_DMAEN | -- BCM2835_SPI_CS_CLEAR_RX; -- dma_sync_single_for_device(ctlr->dma_rx->device->dev, -- slv->clear_rx_addr, -- sizeof(u32), -- DMA_TO_DEVICE); -- } - - /* - * sanity checking the native-chipselects - */ - if (spi->mode & SPI_NO_CS) - return 0; -- /* -- * The SPI core has successfully requested the CS GPIO line from the -- * device tree, so we are done. -- */ -- if (spi->cs_gpiod) -+ if (gpio_is_valid(spi->cs_gpio)) - return 0; - if (spi->chip_select > 1) { - /* error in the case of native CS requested with CS > 1 -@@ -1293,62 +955,53 @@ static int bcm2835_spi_setup(struct spi_ - */ - dev_err(&spi->dev, - "setup: only two native chip-selects are supported\n"); -- ret = -EINVAL; -- goto err_cleanup; -+ return -EINVAL; - } - -- /* -- * Translate native CS to GPIO -- * -- * FIXME: poking around in the gpiolib internals like this is -- * not very good practice. Find a way to locate the real problem -- * and fix it. Why is the GPIO descriptor in spi->cs_gpiod -- * sometimes not assigned correctly? Erroneous device trees? -- */ -+ /* now translate native cs to GPIO */ - - /* get the gpio chip for the base */ - chip = gpiochip_find("pinctrl-bcm2835", chip_match_name); - if (!chip) - return 0; - -- spi->cs_gpiod = gpiochip_request_own_desc(chip, 8 - spi->chip_select, -- DRV_NAME, -- GPIO_LOOKUP_FLAGS_DEFAULT, -- GPIOD_OUT_LOW); -- if (IS_ERR(spi->cs_gpiod)) { -- ret = PTR_ERR(spi->cs_gpiod); -- goto err_cleanup; -- } -+ /* and calculate the real CS */ -+ spi->cs_gpio = chip->base + 8 - spi->chip_select; - - /* and set up the "mode" and level */ -- dev_info(&spi->dev, "setting up native-CS%i to use GPIO\n", -- spi->chip_select); -+ dev_info(&spi->dev, "setting up native-CS%i as GPIO %i\n", -+ spi->chip_select, spi->cs_gpio); - -- return 0; -+ /* set up GPIO as output and pull to the correct level */ -+ err = gpio_direction_output(spi->cs_gpio, -+ (spi->mode & SPI_CS_HIGH) ? 0 : 1); -+ if (err) { -+ dev_err(&spi->dev, -+ "could not set CS%i gpio %i as output: %i", -+ spi->chip_select, spi->cs_gpio, err); -+ return err; -+ } - --err_cleanup: -- bcm2835_spi_cleanup(spi); -- return ret; -+ return 0; - } - - static int bcm2835_spi_probe(struct platform_device *pdev) - { - struct spi_controller *ctlr; - struct bcm2835_spi *bs; -+ struct resource *res; - int err; - -- ctlr = devm_spi_alloc_master(&pdev->dev, sizeof(*bs)); -+ ctlr = spi_alloc_master(&pdev->dev, sizeof(*bs)); - if (!ctlr) - return -ENOMEM; - - platform_set_drvdata(pdev, ctlr); - -- ctlr->use_gpio_descriptors = true; - ctlr->mode_bits = BCM2835_SPI_MODE_BITS; - ctlr->bits_per_word_mask = SPI_BPW_MASK(8); - ctlr->num_chipselect = 3; - ctlr->setup = bcm2835_spi_setup; -- ctlr->cleanup = bcm2835_spi_cleanup; - ctlr->transfer_one = bcm2835_spi_transfer_one; - ctlr->handle_err = bcm2835_spi_handle_err; - ctlr->prepare_message = bcm2835_spi_prepare_message; -@@ -1357,55 +1010,58 @@ static int bcm2835_spi_probe(struct plat - bs = spi_controller_get_devdata(ctlr); - bs->ctlr = ctlr; - -- bs->regs = devm_platform_ioremap_resource(pdev, 0); -- if (IS_ERR(bs->regs)) -- return PTR_ERR(bs->regs); -+ res = platform_get_resource(pdev, IORESOURCE_MEM, 0); -+ bs->regs = devm_ioremap_resource(&pdev->dev, res); -+ if (IS_ERR(bs->regs)) { -+ err = PTR_ERR(bs->regs); -+ goto out_controller_put; -+ } - - bs->clk = devm_clk_get(&pdev->dev, NULL); -- if (IS_ERR(bs->clk)) -- return dev_err_probe(&pdev->dev, PTR_ERR(bs->clk), -- "could not get clk\n"); -+ if (IS_ERR(bs->clk)) { -+ err = PTR_ERR(bs->clk); -+ dev_err(&pdev->dev, "could not get clk: %d\n", err); -+ goto out_controller_put; -+ } - - ctlr->max_speed_hz = clk_get_rate(bs->clk) / 2; - - bs->irq = platform_get_irq(pdev, 0); -- if (bs->irq <= 0) -- return bs->irq ? bs->irq : -ENODEV; -+ if (bs->irq <= 0) { -+ dev_err(&pdev->dev, "could not get IRQ: %d\n", bs->irq); -+ err = bs->irq ? bs->irq : -ENODEV; -+ goto out_controller_put; -+ } - - clk_prepare_enable(bs->clk); -- bs->clk_hz = clk_get_rate(bs->clk); -- -- err = bcm2835_dma_init(ctlr, &pdev->dev, bs); -- if (err) -- goto out_clk_disable; -+ bcm2835_dma_init(ctlr, &pdev->dev); - - /* initialise the hardware with the default polarities */ - bcm2835_wr(bs, BCM2835_SPI_CS, - BCM2835_SPI_CS_CLEAR_RX | BCM2835_SPI_CS_CLEAR_TX); - -- err = devm_request_irq(&pdev->dev, bs->irq, bcm2835_spi_interrupt, -- IRQF_SHARED, -- dev_name(&pdev->dev), bs); -+ err = devm_request_irq(&pdev->dev, bs->irq, bcm2835_spi_interrupt, 0, -+ dev_name(&pdev->dev), ctlr); - if (err) { - dev_err(&pdev->dev, "could not request IRQ: %d\n", err); -- goto out_dma_release; -+ goto out_clk_disable; - } - -- err = spi_register_controller(ctlr); -+ err = devm_spi_register_controller(&pdev->dev, ctlr); - if (err) { - dev_err(&pdev->dev, "could not register SPI controller: %d\n", - err); -- goto out_dma_release; -+ goto out_clk_disable; - } - - bcm2835_debugfs_create(bs, dev_name(&pdev->dev)); - - return 0; - --out_dma_release: -- bcm2835_dma_release(ctlr, bs); - out_clk_disable: - clk_disable_unprepare(bs->clk); -+out_controller_put: -+ spi_controller_put(ctlr); - return err; - } - -@@ -1416,26 +1072,15 @@ static int bcm2835_spi_remove(struct pla - - bcm2835_debugfs_remove(bs); - -- spi_unregister_controller(ctlr); -- -- bcm2835_dma_release(ctlr, bs); -- - /* Clear FIFOs, and disable the HW block */ - bcm2835_wr(bs, BCM2835_SPI_CS, - BCM2835_SPI_CS_CLEAR_RX | BCM2835_SPI_CS_CLEAR_TX); - - clk_disable_unprepare(bs->clk); - -- return 0; --} -- --static void bcm2835_spi_shutdown(struct platform_device *pdev) --{ -- int ret; -+ bcm2835_dma_release(ctlr); - -- ret = bcm2835_spi_remove(pdev); -- if (ret) -- dev_err(&pdev->dev, "failed to shutdown\n"); -+ return 0; - } - - static const struct of_device_id bcm2835_spi_match[] = { -@@ -1451,7 +1096,6 @@ static struct platform_driver bcm2835_sp - }, - .probe = bcm2835_spi_probe, - .remove = bcm2835_spi_remove, -- .shutdown = bcm2835_spi_shutdown, - }; - module_platform_driver(bcm2835_spi_driver); - From 8a59c96ce4f053cf78b672c6da708363a45fb830 Mon Sep 17 00:00:00 2001 From: Corey Wagehoft Date: Tue, 18 Nov 2025 16:38:23 -0700 Subject: [PATCH 34/37] Revert "test removing patch" This reverts commit 05a7f196dfecacc71c7aa7c0b1d6960b60100712. --- ...orse-spi-fix-spi-bcm2835-driver-v5.3.patch | 1139 +++++++++++++++++ 1 file changed, 1139 insertions(+) create mode 100644 target/linux/bcm27xx/patches-5.15/999-001-morse-spi-fix-spi-bcm2835-driver-v5.3.patch diff --git a/target/linux/bcm27xx/patches-5.15/999-001-morse-spi-fix-spi-bcm2835-driver-v5.3.patch b/target/linux/bcm27xx/patches-5.15/999-001-morse-spi-fix-spi-bcm2835-driver-v5.3.patch new file mode 100644 index 0000000000..8fab175274 --- /dev/null +++ b/target/linux/bcm27xx/patches-5.15/999-001-morse-spi-fix-spi-bcm2835-driver-v5.3.patch @@ -0,0 +1,1139 @@ +--- a/drivers/spi/spi-bcm2835.c ++++ b/drivers/spi/spi-bcm2835.c +@@ -25,9 +25,7 @@ + #include + #include + #include +-#include +-#include /* FIXME: using chip internals */ +-#include /* FIXME: using chip internals */ ++#include + #include + #include + +@@ -74,7 +72,7 @@ + #define DRV_NAME "spi-bcm2835" + + /* define polling limits */ +-static unsigned int polling_limit_us = 30; ++unsigned int polling_limit_us = 30; + module_param(polling_limit_us, uint, 0664); + MODULE_PARM_DESC(polling_limit_us, + "time in us to run a transfer in polling mode\n"); +@@ -83,10 +81,8 @@ MODULE_PARM_DESC(polling_limit_us, + * struct bcm2835_spi - BCM2835 SPI controller + * @regs: base address of register map + * @clk: core clock, divided to calculate serial clock +- * @clk_hz: core clock cached speed + * @irq: interrupt, signals TX FIFO empty or RX FIFO ¾ full + * @tfr: SPI transfer currently processed +- * @ctlr: SPI controller reverse lookup + * @tx_buf: pointer whence next transmitted byte is read + * @rx_buf: pointer where next received byte is written + * @tx_len: remaining bytes to transmit +@@ -96,6 +92,7 @@ MODULE_PARM_DESC(polling_limit_us, + * @rx_prologue: bytes received without DMA if first RX sglist entry's + * length is not a multiple of 4 (to overcome hardware limitation) + * @tx_spillover: whether @tx_prologue spills over to second TX sglist entry ++ * @dma_pending: whether a DMA transfer is in progress + * @debugfs_dir: the debugfs directory - neede to remove debugfs when + * unloading the module + * @count_transfer_polling: count of how often polling mode is used +@@ -105,19 +102,10 @@ MODULE_PARM_DESC(polling_limit_us, + * These are counted as well in @count_transfer_polling and + * @count_transfer_irq + * @count_transfer_dma: count how often dma mode is used +- * @slv: SPI slave currently selected +- * (used by bcm2835_spi_dma_tx_done() to write @clear_rx_cs) +- * @tx_dma_active: whether a TX DMA descriptor is in progress +- * @rx_dma_active: whether a RX DMA descriptor is in progress +- * (used by bcm2835_spi_dma_tx_done() to handle a race) +- * @fill_tx_desc: preallocated TX DMA descriptor used for RX-only transfers +- * (cyclically copies from zero page to TX FIFO) +- * @fill_tx_addr: bus address of zero page + */ + struct bcm2835_spi { + void __iomem *regs; + struct clk *clk; +- unsigned long clk_hz; + int irq; + struct spi_transfer *tfr; + struct spi_controller *ctlr; +@@ -128,35 +116,13 @@ struct bcm2835_spi { + int tx_prologue; + int rx_prologue; + unsigned int tx_spillover; ++ unsigned int dma_pending; + + struct dentry *debugfs_dir; + u64 count_transfer_polling; + u64 count_transfer_irq; + u64 count_transfer_irq_after_polling; + u64 count_transfer_dma; +- +- struct bcm2835_spidev *slv; +- unsigned int tx_dma_active; +- unsigned int rx_dma_active; +- struct dma_async_tx_descriptor *fill_tx_desc; +- dma_addr_t fill_tx_addr; +-}; +- +-/** +- * struct bcm2835_spidev - BCM2835 SPI slave +- * @prepare_cs: precalculated CS register value for ->prepare_message() +- * (uses slave-specific clock polarity and phase settings) +- * @clear_rx_desc: preallocated RX DMA descriptor used for TX-only transfers +- * (cyclically clears RX FIFO by writing @clear_rx_cs to CS register) +- * @clear_rx_addr: bus address of @clear_rx_cs +- * @clear_rx_cs: precalculated CS register value to clear RX FIFO +- * (uses slave-specific clock polarity and phase settings) +- */ +-struct bcm2835_spidev { +- u32 prepare_cs; +- struct dma_async_tx_descriptor *clear_rx_desc; +- dma_addr_t clear_rx_addr; +- u32 clear_rx_cs ____cacheline_aligned; + }; + + #if defined(CONFIG_DEBUG_FS) +@@ -200,12 +166,12 @@ static void bcm2835_debugfs_remove(struc + } + #endif /* CONFIG_DEBUG_FS */ + +-static inline u32 bcm2835_rd(struct bcm2835_spi *bs, unsigned int reg) ++static inline u32 bcm2835_rd(struct bcm2835_spi *bs, unsigned reg) + { + return readl(bs->regs + reg); + } + +-static inline void bcm2835_wr(struct bcm2835_spi *bs, unsigned int reg, u32 val) ++static inline void bcm2835_wr(struct bcm2835_spi *bs, unsigned reg, u32 val) + { + writel(val, bs->regs + reg); + } +@@ -252,13 +218,13 @@ static inline void bcm2835_rd_fifo_count + + bs->rx_len -= count; + +- do { ++ while (count > 0) { + val = bcm2835_rd(bs, BCM2835_SPI_FIFO); + len = min(count, 4); + memcpy(bs->rx_buf, &val, len); + bs->rx_buf += len; + count -= 4; +- } while (count > 0); ++ } + } + + /** +@@ -278,7 +244,7 @@ static inline void bcm2835_wr_fifo_count + + bs->tx_len -= count; + +- do { ++ while (count > 0) { + if (bs->tx_buf) { + len = min(count, 4); + memcpy(&val, bs->tx_buf, len); +@@ -288,7 +254,7 @@ static inline void bcm2835_wr_fifo_count + } + bcm2835_wr(bs, BCM2835_SPI_FIFO, val); + count -= 4; +- } while (count > 0); ++ } + } + + /** +@@ -317,11 +283,12 @@ static inline void bcm2835_rd_fifo_blind + count = min(count, bs->rx_len); + bs->rx_len -= count; + +- do { ++ while (count) { + val = bcm2835_rd(bs, BCM2835_SPI_FIFO); + if (bs->rx_buf) + *bs->rx_buf++ = val; +- } while (--count); ++ count--; ++ } + } + + /** +@@ -336,14 +303,16 @@ static inline void bcm2835_wr_fifo_blind + count = min(count, bs->tx_len); + bs->tx_len -= count; + +- do { ++ while (count) { + val = bs->tx_buf ? *bs->tx_buf++ : 0; + bcm2835_wr(bs, BCM2835_SPI_FIFO, val); +- } while (--count); ++ count--; ++ } + } + +-static void bcm2835_spi_reset_hw(struct bcm2835_spi *bs) ++static void bcm2835_spi_reset_hw(struct spi_controller *ctlr) + { ++ struct bcm2835_spi *bs = spi_controller_get_devdata(ctlr); + u32 cs = bcm2835_rd(bs, BCM2835_SPI_CS); + + /* Disable SPI interrupts and transfer */ +@@ -351,13 +320,6 @@ static void bcm2835_spi_reset_hw(struct + BCM2835_SPI_CS_INTD | + BCM2835_SPI_CS_DMAEN | + BCM2835_SPI_CS_TA); +- /* +- * Transmission sometimes breaks unless the DONE bit is written at the +- * end of every transfer. The spec says it's a RO bit. Either the +- * spec is wrong and the bit is actually of type RW1C, or it's a +- * hardware erratum. +- */ +- cs |= BCM2835_SPI_CS_DONE; + /* and reset RX/TX FIFOS */ + cs |= BCM2835_SPI_CS_CLEAR_RX | BCM2835_SPI_CS_CLEAR_TX; + +@@ -369,7 +331,8 @@ static void bcm2835_spi_reset_hw(struct + + static irqreturn_t bcm2835_spi_interrupt(int irq, void *dev_id) + { +- struct bcm2835_spi *bs = dev_id; ++ struct spi_controller *ctlr = dev_id; ++ struct bcm2835_spi *bs = spi_controller_get_devdata(ctlr); + u32 cs = bcm2835_rd(bs, BCM2835_SPI_CS); + + /* +@@ -395,7 +358,7 @@ static irqreturn_t bcm2835_spi_interrupt + + if (!bs->rx_len) { + /* Transfer complete - reset SPI HW */ +- bcm2835_spi_reset_hw(bs); ++ bcm2835_spi_reset_hw(ctlr); + /* wake up the framework */ + spi_finalize_current_transfer(bs->ctlr); + } +@@ -490,14 +453,14 @@ static void bcm2835_spi_transfer_prologu + bs->rx_prologue = 0; + bs->tx_spillover = false; + +- if (bs->tx_buf && !sg_is_last(&tfr->tx_sg.sgl[0])) ++ if (!sg_is_last(&tfr->tx_sg.sgl[0])) + bs->tx_prologue = sg_dma_len(&tfr->tx_sg.sgl[0]) & 3; + +- if (bs->rx_buf && !sg_is_last(&tfr->rx_sg.sgl[0])) { ++ if (!sg_is_last(&tfr->rx_sg.sgl[0])) { + bs->rx_prologue = sg_dma_len(&tfr->rx_sg.sgl[0]) & 3; + + if (bs->rx_prologue > bs->tx_prologue) { +- if (!bs->tx_buf || sg_is_last(&tfr->tx_sg.sgl[0])) { ++ if (sg_is_last(&tfr->tx_sg.sgl[0])) { + bs->tx_prologue = bs->rx_prologue; + } else { + bs->tx_prologue += 4; +@@ -519,9 +482,7 @@ static void bcm2835_spi_transfer_prologu + bcm2835_wr_fifo_count(bs, bs->rx_prologue); + bcm2835_wait_tx_fifo_empty(bs); + bcm2835_rd_fifo_count(bs, bs->rx_prologue); +- bcm2835_wr(bs, BCM2835_SPI_CS, cs | BCM2835_SPI_CS_CLEAR_RX +- | BCM2835_SPI_CS_CLEAR_TX +- | BCM2835_SPI_CS_DONE); ++ bcm2835_spi_reset_hw(ctlr); + + dma_sync_single_for_device(ctlr->dma_rx->device->dev, + sg_dma_address(&tfr->rx_sg.sgl[0]), +@@ -531,9 +492,6 @@ static void bcm2835_spi_transfer_prologu + sg_dma_len(&tfr->rx_sg.sgl[0]) -= bs->rx_prologue; + } + +- if (!bs->tx_buf) +- return; +- + /* + * Write remaining TX prologue. Adjust first entry in TX sglist. + * Also adjust second entry if prologue spills over to it. +@@ -545,8 +503,7 @@ static void bcm2835_spi_transfer_prologu + | BCM2835_SPI_CS_DMAEN); + bcm2835_wr_fifo_count(bs, tx_remaining); + bcm2835_wait_tx_fifo_empty(bs); +- bcm2835_wr(bs, BCM2835_SPI_CS, cs | BCM2835_SPI_CS_CLEAR_TX +- | BCM2835_SPI_CS_DONE); ++ bcm2835_wr(bs, BCM2835_SPI_CS, cs | BCM2835_SPI_CS_CLEAR_TX); + } + + if (likely(!bs->tx_spillover)) { +@@ -579,9 +536,6 @@ static void bcm2835_spi_undo_prologue(st + sg_dma_len(&tfr->rx_sg.sgl[0]) += bs->rx_prologue; + } + +- if (!bs->tx_buf) +- goto out; +- + if (likely(!bs->tx_spillover)) { + sg_dma_address(&tfr->tx_sg.sgl[0]) -= bs->tx_prologue; + sg_dma_len(&tfr->tx_sg.sgl[0]) += bs->tx_prologue; +@@ -590,84 +544,32 @@ static void bcm2835_spi_undo_prologue(st + sg_dma_address(&tfr->tx_sg.sgl[1]) -= 4; + sg_dma_len(&tfr->tx_sg.sgl[1]) += 4; + } +-out: +- bs->tx_prologue = 0; + } + +-/** +- * bcm2835_spi_dma_rx_done() - callback for DMA RX channel +- * @data: SPI master controller +- * +- * Used for bidirectional and RX-only transfers. +- */ +-static void bcm2835_spi_dma_rx_done(void *data) ++static void bcm2835_spi_dma_done(void *data) + { + struct spi_controller *ctlr = data; + struct bcm2835_spi *bs = spi_controller_get_devdata(ctlr); + +- /* terminate tx-dma as we do not have an irq for it ++ /* reset fifo and HW */ ++ bcm2835_spi_reset_hw(ctlr); ++ ++ /* and terminate tx-dma as we do not have an irq for it + * because when the rx dma will terminate and this callback + * is called the tx-dma must have finished - can't get to this + * situation otherwise... + */ +- dmaengine_terminate_async(ctlr->dma_tx); +- bs->tx_dma_active = false; +- bs->rx_dma_active = false; +- bcm2835_spi_undo_prologue(bs); +- +- /* reset fifo and HW */ +- bcm2835_spi_reset_hw(bs); + ++ if (cmpxchg(&bs->dma_pending, true, false)) { ++ dmaengine_terminate_async(ctlr->dma_tx); ++ bcm2835_spi_undo_prologue(bs); ++ } + /* and mark as completed */; + spi_finalize_current_transfer(ctlr); + } + +-/** +- * bcm2835_spi_dma_tx_done() - callback for DMA TX channel +- * @data: SPI master controller +- * +- * Used for TX-only transfers. +- */ +-static void bcm2835_spi_dma_tx_done(void *data) +-{ +- struct spi_controller *ctlr = data; +- struct bcm2835_spi *bs = spi_controller_get_devdata(ctlr); +- +- /* busy-wait for TX FIFO to empty */ +- while (!(bcm2835_rd(bs, BCM2835_SPI_CS) & BCM2835_SPI_CS_DONE)) +- bcm2835_wr(bs, BCM2835_SPI_CS, bs->slv->clear_rx_cs); +- +- bs->tx_dma_active = false; +- smp_wmb(); +- +- /* +- * In case of a very short transfer, RX DMA may not have been +- * issued yet. The onus is then on bcm2835_spi_transfer_one_dma() +- * to terminate it immediately after issuing. +- */ +- if (cmpxchg(&bs->rx_dma_active, true, false)) +- dmaengine_terminate_async(ctlr->dma_rx); +- +- bcm2835_spi_undo_prologue(bs); +- bcm2835_spi_reset_hw(bs); +- spi_finalize_current_transfer(ctlr); +-} +- +-/** +- * bcm2835_spi_prepare_sg() - prepare and submit DMA descriptor for sglist +- * @ctlr: SPI master controller +- * @tfr: SPI transfer +- * @bs: BCM2835 SPI controller +- * @slv: BCM2835 SPI slave +- * @is_tx: whether to submit DMA descriptor for TX or RX sglist +- * +- * Prepare and submit a DMA descriptor for the TX or RX sglist of @tfr. +- * Return 0 on success or a negative error number. +- */ + static int bcm2835_spi_prepare_sg(struct spi_controller *ctlr, + struct spi_transfer *tfr, +- struct bcm2835_spi *bs, +- struct bcm2835_spidev *slv, + bool is_tx) + { + struct dma_chan *chan; +@@ -684,7 +586,7 @@ static int bcm2835_spi_prepare_sg(struct + chan = ctlr->dma_tx; + nents = tfr->tx_sg.nents; + sgl = tfr->tx_sg.sgl; +- flags = tfr->rx_buf ? 0 : DMA_PREP_INTERRUPT; ++ flags = 0 /* no tx interrupt */; + } else { + dir = DMA_DEV_TO_MEM; + chan = ctlr->dma_rx; +@@ -697,17 +599,10 @@ static int bcm2835_spi_prepare_sg(struct + if (!desc) + return -EINVAL; + +- /* +- * Completion is signaled by the RX channel for bidirectional and +- * RX-only transfers; else by the TX channel for TX-only transfers. +- */ ++ /* set callback for rx */ + if (!is_tx) { +- desc->callback = bcm2835_spi_dma_rx_done; +- desc->callback_param = ctlr; +- } else if (!tfr->rx_buf) { +- desc->callback = bcm2835_spi_dma_tx_done; ++ desc->callback = bcm2835_spi_dma_done; + desc->callback_param = ctlr; +- bs->slv = slv; + } + + /* submit it to DMA-engine */ +@@ -716,60 +611,12 @@ static int bcm2835_spi_prepare_sg(struct + return dma_submit_error(cookie); + } + +-/** +- * bcm2835_spi_transfer_one_dma() - perform SPI transfer using DMA engine +- * @ctlr: SPI master controller +- * @tfr: SPI transfer +- * @slv: BCM2835 SPI slave +- * @cs: CS register +- * +- * For *bidirectional* transfers (both tx_buf and rx_buf are non-%NULL), set up +- * the TX and RX DMA channel to copy between memory and FIFO register. +- * +- * For *TX-only* transfers (rx_buf is %NULL), copying the RX FIFO's contents to +- * memory is pointless. However not reading the RX FIFO isn't an option either +- * because transmission is halted once it's full. As a workaround, cyclically +- * clear the RX FIFO by setting the CLEAR_RX bit in the CS register. +- * +- * The CS register value is precalculated in bcm2835_spi_setup(). Normally +- * this is called only once, on slave registration. A DMA descriptor to write +- * this value is preallocated in bcm2835_dma_init(). All that's left to do +- * when performing a TX-only transfer is to submit this descriptor to the RX +- * DMA channel. Latency is thereby minimized. The descriptor does not +- * generate any interrupts while running. It must be terminated once the +- * TX DMA channel is done. +- * +- * Clearing the RX FIFO is paced by the DREQ signal. The signal is asserted +- * when the RX FIFO becomes half full, i.e. 32 bytes. (Tuneable with the DC +- * register.) Reading 32 bytes from the RX FIFO would normally require 8 bus +- * accesses, whereas clearing it requires only 1 bus access. So an 8-fold +- * reduction in bus traffic and thus energy consumption is achieved. +- * +- * For *RX-only* transfers (tx_buf is %NULL), fill the TX FIFO by cyclically +- * copying from the zero page. The DMA descriptor to do this is preallocated +- * in bcm2835_dma_init(). It must be terminated once the RX DMA channel is +- * done and can then be reused. +- * +- * The BCM2835 DMA driver autodetects when a transaction copies from the zero +- * page and utilizes the DMA controller's ability to synthesize zeroes instead +- * of copying them from memory. This reduces traffic on the memory bus. The +- * feature is not available on so-called "lite" channels, but normally TX DMA +- * is backed by a full-featured channel. +- * +- * Zero-filling the TX FIFO is paced by the DREQ signal. Unfortunately the +- * BCM2835 SPI controller continues to assert DREQ even after the DLEN register +- * has been counted down to zero (hardware erratum). Thus, when the transfer +- * has finished, the DMA engine zero-fills the TX FIFO until it is half full. +- * (Tuneable with the DC register.) So up to 9 gratuitous bus accesses are +- * performed at the end of an RX-only transfer. +- */ + static int bcm2835_spi_transfer_one_dma(struct spi_controller *ctlr, ++ struct spi_device *spi, + struct spi_transfer *tfr, +- struct bcm2835_spidev *slv, + u32 cs) + { + struct bcm2835_spi *bs = spi_controller_get_devdata(ctlr); +- dma_cookie_t cookie; + int ret; + + /* update usage statistics */ +@@ -782,15 +629,16 @@ static int bcm2835_spi_transfer_one_dma( + bcm2835_spi_transfer_prologue(ctlr, tfr, bs, cs); + + /* setup tx-DMA */ +- if (bs->tx_buf) { +- ret = bcm2835_spi_prepare_sg(ctlr, tfr, bs, slv, true); +- } else { +- cookie = dmaengine_submit(bs->fill_tx_desc); +- ret = dma_submit_error(cookie); +- } ++ ret = bcm2835_spi_prepare_sg(ctlr, tfr, true); + if (ret) + goto err_reset_hw; + ++ /* start TX early */ ++ dma_async_issue_pending(ctlr->dma_tx); ++ ++ /* mark as dma pending */ ++ bs->dma_pending = 1; ++ + /* set the DMA length */ + bcm2835_wr(bs, BCM2835_SPI_DLEN, bs->tx_len); + +@@ -798,49 +646,26 @@ static int bcm2835_spi_transfer_one_dma( + bcm2835_wr(bs, BCM2835_SPI_CS, + cs | BCM2835_SPI_CS_TA | BCM2835_SPI_CS_DMAEN); + +- bs->tx_dma_active = true; +- smp_wmb(); +- +- /* start TX early */ +- dma_async_issue_pending(ctlr->dma_tx); +- + /* setup rx-DMA late - to run transfers while + * mapping of the rx buffers still takes place + * this saves 10us or more. + */ +- if (bs->rx_buf) { +- ret = bcm2835_spi_prepare_sg(ctlr, tfr, bs, slv, false); +- } else { +- cookie = dmaengine_submit(slv->clear_rx_desc); +- ret = dma_submit_error(cookie); +- } ++ ret = bcm2835_spi_prepare_sg(ctlr, tfr, false); + if (ret) { + /* need to reset on errors */ + dmaengine_terminate_sync(ctlr->dma_tx); +- bs->tx_dma_active = false; ++ bs->dma_pending = false; + goto err_reset_hw; + } + + /* start rx dma late */ + dma_async_issue_pending(ctlr->dma_rx); +- bs->rx_dma_active = true; +- smp_mb(); +- +- /* +- * In case of a very short TX-only transfer, bcm2835_spi_dma_tx_done() +- * may run before RX DMA is issued. Terminate RX DMA if so. +- */ +- if (!bs->rx_buf && !bs->tx_dma_active && +- cmpxchg(&bs->rx_dma_active, true, false)) { +- dmaengine_terminate_async(ctlr->dma_rx); +- bcm2835_spi_reset_hw(bs); +- } + + /* wait for wakeup in framework */ + return 1; + + err_reset_hw: +- bcm2835_spi_reset_hw(bs); ++ bcm2835_spi_reset_hw(ctlr); + bcm2835_spi_undo_prologue(bs); + return ret; + } +@@ -857,21 +682,10 @@ static bool bcm2835_spi_can_dma(struct s + return true; + } + +-static void bcm2835_dma_release(struct spi_controller *ctlr, +- struct bcm2835_spi *bs) ++static void bcm2835_dma_release(struct spi_controller *ctlr) + { + if (ctlr->dma_tx) { + dmaengine_terminate_sync(ctlr->dma_tx); +- +- if (bs->fill_tx_desc) +- dmaengine_desc_free(bs->fill_tx_desc); +- +- if (bs->fill_tx_addr) +- dma_unmap_page_attrs(ctlr->dma_tx->device->dev, +- bs->fill_tx_addr, sizeof(u32), +- DMA_TO_DEVICE, +- DMA_ATTR_SKIP_CPU_SYNC); +- + dma_release_channel(ctlr->dma_tx); + ctlr->dma_tx = NULL; + } +@@ -883,8 +697,7 @@ static void bcm2835_dma_release(struct s + } + } + +-static int bcm2835_dma_init(struct spi_controller *ctlr, struct device *dev, +- struct bcm2835_spi *bs) ++static void bcm2835_dma_init(struct spi_controller *ctlr, struct device *dev) + { + struct dma_slave_config slave_config; + const __be32 *addr; +@@ -895,32 +708,23 @@ static int bcm2835_dma_init(struct spi_c + addr = of_get_address(ctlr->dev.of_node, 0, NULL, NULL); + if (!addr) { + dev_err(dev, "could not get DMA-register address - not using dma mode\n"); +- /* Fall back to interrupt mode */ +- return 0; ++ goto err; + } + dma_reg_base = be32_to_cpup(addr); + + /* get tx/rx dma */ +- ctlr->dma_tx = dma_request_chan(dev, "tx"); +- if (IS_ERR(ctlr->dma_tx)) { ++ ctlr->dma_tx = dma_request_slave_channel(dev, "tx"); ++ if (!ctlr->dma_tx) { + dev_err(dev, "no tx-dma configuration found - not using dma mode\n"); +- ret = PTR_ERR(ctlr->dma_tx); +- ctlr->dma_tx = NULL; + goto err; + } +- ctlr->dma_rx = dma_request_chan(dev, "rx"); +- if (IS_ERR(ctlr->dma_rx)) { ++ ctlr->dma_rx = dma_request_slave_channel(dev, "rx"); ++ if (!ctlr->dma_rx) { + dev_err(dev, "no rx-dma configuration found - not using dma mode\n"); +- ret = PTR_ERR(ctlr->dma_rx); +- ctlr->dma_rx = NULL; + goto err_release; + } + +- /* +- * The TX DMA channel either copies a transfer's TX buffer to the FIFO +- * or, in case of an RX-only transfer, cyclically copies from the zero +- * page to the FIFO using a preallocated, reusable descriptor. +- */ ++ /* configure DMAs */ + slave_config.dst_addr = (u32)(dma_reg_base + BCM2835_SPI_FIFO); + slave_config.dst_addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES; + +@@ -928,42 +732,8 @@ static int bcm2835_dma_init(struct spi_c + if (ret) + goto err_config; + +- bs->fill_tx_addr = dma_map_page_attrs(ctlr->dma_tx->device->dev, +- ZERO_PAGE(0), 0, sizeof(u32), +- DMA_TO_DEVICE, +- DMA_ATTR_SKIP_CPU_SYNC); +- if (dma_mapping_error(ctlr->dma_tx->device->dev, bs->fill_tx_addr)) { +- dev_err(dev, "cannot map zero page - not using DMA mode\n"); +- bs->fill_tx_addr = 0; +- ret = -ENOMEM; +- goto err_release; +- } +- +- bs->fill_tx_desc = dmaengine_prep_dma_cyclic(ctlr->dma_tx, +- bs->fill_tx_addr, +- sizeof(u32), 0, +- DMA_MEM_TO_DEV, 0); +- if (!bs->fill_tx_desc) { +- dev_err(dev, "cannot prepare fill_tx_desc - not using DMA mode\n"); +- ret = -ENOMEM; +- goto err_release; +- } +- +- ret = dmaengine_desc_set_reuse(bs->fill_tx_desc); +- if (ret) { +- dev_err(dev, "cannot reuse fill_tx_desc - not using DMA mode\n"); +- goto err_release; +- } +- +- /* +- * The RX DMA channel is used bidirectionally: It either reads the +- * RX FIFO or, in case of a TX-only transfer, cyclically writes a +- * precalculated value to the CS register to clear the RX FIFO. +- */ + slave_config.src_addr = (u32)(dma_reg_base + BCM2835_SPI_FIFO); + slave_config.src_addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES; +- slave_config.dst_addr = (u32)(dma_reg_base + BCM2835_SPI_CS); +- slave_config.dst_addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES; + + ret = dmaengine_slave_config(ctlr->dma_rx, &slave_config); + if (ret) +@@ -971,23 +741,18 @@ static int bcm2835_dma_init(struct spi_c + + /* all went well, so set can_dma */ + ctlr->can_dma = bcm2835_spi_can_dma; ++ /* need to do TX AND RX DMA, so we need dummy buffers */ ++ ctlr->flags = SPI_CONTROLLER_MUST_RX | SPI_CONTROLLER_MUST_TX; + +- return 0; ++ return; + + err_config: + dev_err(dev, "issue configuring dma: %d - not using DMA mode\n", + ret); + err_release: +- bcm2835_dma_release(ctlr, bs); ++ bcm2835_dma_release(ctlr); + err: +- /* +- * Only report error for deferred probing, otherwise fall back to +- * interrupt mode +- */ +- if (ret != -EPROBE_DEFER) +- ret = 0; +- +- return ret; ++ return; + } + + static int bcm2835_spi_transfer_one_poll(struct spi_controller *ctlr, +@@ -1040,7 +805,7 @@ static int bcm2835_spi_transfer_one_poll + } + + /* Transfer complete - reset SPI HW */ +- bcm2835_spi_reset_hw(bs); ++ bcm2835_spi_reset_hw(ctlr); + /* and return without waiting for completion */ + return 0; + } +@@ -1050,29 +815,19 @@ static int bcm2835_spi_transfer_one(stru + struct spi_transfer *tfr) + { + struct bcm2835_spi *bs = spi_controller_get_devdata(ctlr); +- struct bcm2835_spidev *slv = spi_get_ctldata(spi); +- unsigned long spi_hz, cdiv; ++ unsigned long spi_hz, clk_hz, cdiv, spi_used_hz; + unsigned long hz_per_byte, byte_limit; +- u32 cs = slv->prepare_cs; +- +- if (unlikely(!tfr->len)) { +- static int warned; +- +- if (!warned) +- dev_warn(&spi->dev, +- "zero-length SPI transfer ignored\n"); +- warned = 1; +- return 0; +- } ++ u32 cs = bcm2835_rd(bs, BCM2835_SPI_CS); + + /* set clock */ + spi_hz = tfr->speed_hz; ++ clk_hz = clk_get_rate(bs->clk); + +- if (spi_hz >= bs->clk_hz / 2) { ++ if (spi_hz >= clk_hz / 2) { + cdiv = 2; /* clk_hz/2 is the fastest we can go */ + } else if (spi_hz) { + /* CDIV must be a multiple of two */ +- cdiv = DIV_ROUND_UP(bs->clk_hz, spi_hz); ++ cdiv = DIV_ROUND_UP(clk_hz, spi_hz); + cdiv += (cdiv % 2); + + if (cdiv >= 65536) +@@ -1080,12 +835,23 @@ static int bcm2835_spi_transfer_one(stru + } else { + cdiv = 0; /* 0 is the slowest we can go */ + } +- tfr->effective_speed_hz = cdiv ? (bs->clk_hz / cdiv) : (bs->clk_hz / 65536); ++ spi_used_hz = cdiv ? (clk_hz / cdiv) : (clk_hz / 65536); + bcm2835_wr(bs, BCM2835_SPI_CLK, cdiv); + + /* handle all the 3-wire mode */ +- if (spi->mode & SPI_3WIRE && tfr->rx_buf) ++ if (spi->mode & SPI_3WIRE && tfr->rx_buf && ++ tfr->rx_buf != ctlr->dummy_rx) + cs |= BCM2835_SPI_CS_REN; ++ else ++ cs &= ~BCM2835_SPI_CS_REN; ++ ++ /* ++ * The driver always uses software-controlled GPIO Chip Select. ++ * Set the hardware-controlled native Chip Select to an invalid ++ * value to prevent it from interfering. ++ */ ++ cs |= BCM2835_SPI_CS_CS_10 | BCM2835_SPI_CS_CS_01; ++ + + /* set transmit buffers and length */ + bs->tx_buf = tfr->tx_buf; +@@ -1100,7 +866,7 @@ static int bcm2835_spi_transfer_one(stru + * per 300,000 Hz of bus clock. + */ + hz_per_byte = polling_limit_us ? (9 * 1000000) / polling_limit_us : 0; +- byte_limit = hz_per_byte ? tfr->effective_speed_hz / hz_per_byte : 1; ++ byte_limit = hz_per_byte ? spi_used_hz / hz_per_byte : 1; + + /* run in polling mode for short transfers */ + if (tfr->len < byte_limit) +@@ -1111,7 +877,7 @@ static int bcm2835_spi_transfer_one(stru + * this 1 idle clock cycle pattern but runs the spi clock without gaps + */ + if (ctlr->can_dma && bcm2835_spi_can_dma(ctlr, spi, tfr)) +- return bcm2835_spi_transfer_one_dma(ctlr, tfr, slv, cs); ++ return bcm2835_spi_transfer_one_dma(ctlr, spi, tfr, cs); + + /* run in interrupt-mode */ + return bcm2835_spi_transfer_one_irq(ctlr, spi, tfr, cs, true); +@@ -1122,7 +888,7 @@ static int bcm2835_spi_prepare_message(s + { + struct spi_device *spi = msg->spi; + struct bcm2835_spi *bs = spi_controller_get_devdata(ctlr); +- struct bcm2835_spidev *slv = spi_get_ctldata(spi); ++ u32 cs = bcm2835_rd(bs, BCM2835_SPI_CS); + int ret; + + if (ctlr->can_dma) { +@@ -1137,11 +903,14 @@ static int bcm2835_spi_prepare_message(s + return ret; + } + +- /* +- * Set up clock polarity before spi_transfer_one_message() asserts +- * chip select to avoid a gratuitous clock signal edge. +- */ +- bcm2835_wr(bs, BCM2835_SPI_CS, slv->prepare_cs); ++ cs &= ~(BCM2835_SPI_CS_CPOL | BCM2835_SPI_CS_CPHA); ++ ++ if (spi->mode & SPI_CPOL) ++ cs |= BCM2835_SPI_CS_CPOL; ++ if (spi->mode & SPI_CPHA) ++ cs |= BCM2835_SPI_CS_CPHA; ++ ++ bcm2835_wr(bs, BCM2835_SPI_CS, cs); + + return 0; + } +@@ -1152,18 +921,14 @@ static void bcm2835_spi_handle_err(struc + struct bcm2835_spi *bs = spi_controller_get_devdata(ctlr); + + /* if an error occurred and we have an active dma, then terminate */ +- if (ctlr->dma_tx) { ++ if (cmpxchg(&bs->dma_pending, true, false)) { + dmaengine_terminate_sync(ctlr->dma_tx); +- bs->tx_dma_active = false; +- } +- if (ctlr->dma_rx) { + dmaengine_terminate_sync(ctlr->dma_rx); +- bs->rx_dma_active = false; ++ bcm2835_spi_undo_prologue(bs); + } +- bcm2835_spi_undo_prologue(bs); + + /* and reset */ +- bcm2835_spi_reset_hw(bs); ++ bcm2835_spi_reset_hw(ctlr); + } + + static int chip_match_name(struct gpio_chip *chip, void *data) +@@ -1171,120 +936,17 @@ static int chip_match_name(struct gpio_c + return !strcmp(chip->label, data); + } + +-static void bcm2835_spi_cleanup(struct spi_device *spi) +-{ +- struct bcm2835_spidev *slv = spi_get_ctldata(spi); +- struct spi_controller *ctlr = spi->controller; +- +- if (slv->clear_rx_desc) +- dmaengine_desc_free(slv->clear_rx_desc); +- +- if (slv->clear_rx_addr) +- dma_unmap_single(ctlr->dma_rx->device->dev, +- slv->clear_rx_addr, +- sizeof(u32), +- DMA_TO_DEVICE); +- +- kfree(slv); +-} +- +-static int bcm2835_spi_setup_dma(struct spi_controller *ctlr, +- struct spi_device *spi, +- struct bcm2835_spi *bs, +- struct bcm2835_spidev *slv) +-{ +- int ret; +- +- if (!ctlr->dma_rx) +- return 0; +- +- slv->clear_rx_addr = dma_map_single(ctlr->dma_rx->device->dev, +- &slv->clear_rx_cs, +- sizeof(u32), +- DMA_TO_DEVICE); +- if (dma_mapping_error(ctlr->dma_rx->device->dev, slv->clear_rx_addr)) { +- dev_err(&spi->dev, "cannot map clear_rx_cs\n"); +- slv->clear_rx_addr = 0; +- return -ENOMEM; +- } +- +- slv->clear_rx_desc = dmaengine_prep_dma_cyclic(ctlr->dma_rx, +- slv->clear_rx_addr, +- sizeof(u32), 0, +- DMA_MEM_TO_DEV, 0); +- if (!slv->clear_rx_desc) { +- dev_err(&spi->dev, "cannot prepare clear_rx_desc\n"); +- return -ENOMEM; +- } +- +- ret = dmaengine_desc_set_reuse(slv->clear_rx_desc); +- if (ret) { +- dev_err(&spi->dev, "cannot reuse clear_rx_desc\n"); +- return ret; +- } +- +- return 0; +-} +- + static int bcm2835_spi_setup(struct spi_device *spi) + { +- struct spi_controller *ctlr = spi->controller; +- struct bcm2835_spi *bs = spi_controller_get_devdata(ctlr); +- struct bcm2835_spidev *slv = spi_get_ctldata(spi); ++ int err; + struct gpio_chip *chip; +- int ret; +- u32 cs; +- +- if (!slv) { +- slv = kzalloc(ALIGN(sizeof(*slv), dma_get_cache_alignment()), +- GFP_KERNEL); +- if (!slv) +- return -ENOMEM; +- +- spi_set_ctldata(spi, slv); +- +- ret = bcm2835_spi_setup_dma(ctlr, spi, bs, slv); +- if (ret) +- goto err_cleanup; +- } +- +- /* +- * Precalculate SPI slave's CS register value for ->prepare_message(): +- * The driver always uses software-controlled GPIO chip select, hence +- * set the hardware-controlled native chip select to an invalid value +- * to prevent it from interfering. +- */ +- cs = BCM2835_SPI_CS_CS_10 | BCM2835_SPI_CS_CS_01; +- if (spi->mode & SPI_CPOL) +- cs |= BCM2835_SPI_CS_CPOL; +- if (spi->mode & SPI_CPHA) +- cs |= BCM2835_SPI_CS_CPHA; +- slv->prepare_cs = cs; +- +- /* +- * Precalculate SPI slave's CS register value to clear RX FIFO +- * in case of a TX-only DMA transfer. +- */ +- if (ctlr->dma_rx) { +- slv->clear_rx_cs = cs | BCM2835_SPI_CS_TA | +- BCM2835_SPI_CS_DMAEN | +- BCM2835_SPI_CS_CLEAR_RX; +- dma_sync_single_for_device(ctlr->dma_rx->device->dev, +- slv->clear_rx_addr, +- sizeof(u32), +- DMA_TO_DEVICE); +- } + + /* + * sanity checking the native-chipselects + */ + if (spi->mode & SPI_NO_CS) + return 0; +- /* +- * The SPI core has successfully requested the CS GPIO line from the +- * device tree, so we are done. +- */ +- if (spi->cs_gpiod) ++ if (gpio_is_valid(spi->cs_gpio)) + return 0; + if (spi->chip_select > 1) { + /* error in the case of native CS requested with CS > 1 +@@ -1293,62 +955,53 @@ static int bcm2835_spi_setup(struct spi_ + */ + dev_err(&spi->dev, + "setup: only two native chip-selects are supported\n"); +- ret = -EINVAL; +- goto err_cleanup; ++ return -EINVAL; + } + +- /* +- * Translate native CS to GPIO +- * +- * FIXME: poking around in the gpiolib internals like this is +- * not very good practice. Find a way to locate the real problem +- * and fix it. Why is the GPIO descriptor in spi->cs_gpiod +- * sometimes not assigned correctly? Erroneous device trees? +- */ ++ /* now translate native cs to GPIO */ + + /* get the gpio chip for the base */ + chip = gpiochip_find("pinctrl-bcm2835", chip_match_name); + if (!chip) + return 0; + +- spi->cs_gpiod = gpiochip_request_own_desc(chip, 8 - spi->chip_select, +- DRV_NAME, +- GPIO_LOOKUP_FLAGS_DEFAULT, +- GPIOD_OUT_LOW); +- if (IS_ERR(spi->cs_gpiod)) { +- ret = PTR_ERR(spi->cs_gpiod); +- goto err_cleanup; +- } ++ /* and calculate the real CS */ ++ spi->cs_gpio = chip->base + 8 - spi->chip_select; + + /* and set up the "mode" and level */ +- dev_info(&spi->dev, "setting up native-CS%i to use GPIO\n", +- spi->chip_select); ++ dev_info(&spi->dev, "setting up native-CS%i as GPIO %i\n", ++ spi->chip_select, spi->cs_gpio); + +- return 0; ++ /* set up GPIO as output and pull to the correct level */ ++ err = gpio_direction_output(spi->cs_gpio, ++ (spi->mode & SPI_CS_HIGH) ? 0 : 1); ++ if (err) { ++ dev_err(&spi->dev, ++ "could not set CS%i gpio %i as output: %i", ++ spi->chip_select, spi->cs_gpio, err); ++ return err; ++ } + +-err_cleanup: +- bcm2835_spi_cleanup(spi); +- return ret; ++ return 0; + } + + static int bcm2835_spi_probe(struct platform_device *pdev) + { + struct spi_controller *ctlr; + struct bcm2835_spi *bs; ++ struct resource *res; + int err; + +- ctlr = devm_spi_alloc_master(&pdev->dev, sizeof(*bs)); ++ ctlr = spi_alloc_master(&pdev->dev, sizeof(*bs)); + if (!ctlr) + return -ENOMEM; + + platform_set_drvdata(pdev, ctlr); + +- ctlr->use_gpio_descriptors = true; + ctlr->mode_bits = BCM2835_SPI_MODE_BITS; + ctlr->bits_per_word_mask = SPI_BPW_MASK(8); + ctlr->num_chipselect = 3; + ctlr->setup = bcm2835_spi_setup; +- ctlr->cleanup = bcm2835_spi_cleanup; + ctlr->transfer_one = bcm2835_spi_transfer_one; + ctlr->handle_err = bcm2835_spi_handle_err; + ctlr->prepare_message = bcm2835_spi_prepare_message; +@@ -1357,55 +1010,58 @@ static int bcm2835_spi_probe(struct plat + bs = spi_controller_get_devdata(ctlr); + bs->ctlr = ctlr; + +- bs->regs = devm_platform_ioremap_resource(pdev, 0); +- if (IS_ERR(bs->regs)) +- return PTR_ERR(bs->regs); ++ res = platform_get_resource(pdev, IORESOURCE_MEM, 0); ++ bs->regs = devm_ioremap_resource(&pdev->dev, res); ++ if (IS_ERR(bs->regs)) { ++ err = PTR_ERR(bs->regs); ++ goto out_controller_put; ++ } + + bs->clk = devm_clk_get(&pdev->dev, NULL); +- if (IS_ERR(bs->clk)) +- return dev_err_probe(&pdev->dev, PTR_ERR(bs->clk), +- "could not get clk\n"); ++ if (IS_ERR(bs->clk)) { ++ err = PTR_ERR(bs->clk); ++ dev_err(&pdev->dev, "could not get clk: %d\n", err); ++ goto out_controller_put; ++ } + + ctlr->max_speed_hz = clk_get_rate(bs->clk) / 2; + + bs->irq = platform_get_irq(pdev, 0); +- if (bs->irq <= 0) +- return bs->irq ? bs->irq : -ENODEV; ++ if (bs->irq <= 0) { ++ dev_err(&pdev->dev, "could not get IRQ: %d\n", bs->irq); ++ err = bs->irq ? bs->irq : -ENODEV; ++ goto out_controller_put; ++ } + + clk_prepare_enable(bs->clk); +- bs->clk_hz = clk_get_rate(bs->clk); +- +- err = bcm2835_dma_init(ctlr, &pdev->dev, bs); +- if (err) +- goto out_clk_disable; ++ bcm2835_dma_init(ctlr, &pdev->dev); + + /* initialise the hardware with the default polarities */ + bcm2835_wr(bs, BCM2835_SPI_CS, + BCM2835_SPI_CS_CLEAR_RX | BCM2835_SPI_CS_CLEAR_TX); + +- err = devm_request_irq(&pdev->dev, bs->irq, bcm2835_spi_interrupt, +- IRQF_SHARED, +- dev_name(&pdev->dev), bs); ++ err = devm_request_irq(&pdev->dev, bs->irq, bcm2835_spi_interrupt, 0, ++ dev_name(&pdev->dev), ctlr); + if (err) { + dev_err(&pdev->dev, "could not request IRQ: %d\n", err); +- goto out_dma_release; ++ goto out_clk_disable; + } + +- err = spi_register_controller(ctlr); ++ err = devm_spi_register_controller(&pdev->dev, ctlr); + if (err) { + dev_err(&pdev->dev, "could not register SPI controller: %d\n", + err); +- goto out_dma_release; ++ goto out_clk_disable; + } + + bcm2835_debugfs_create(bs, dev_name(&pdev->dev)); + + return 0; + +-out_dma_release: +- bcm2835_dma_release(ctlr, bs); + out_clk_disable: + clk_disable_unprepare(bs->clk); ++out_controller_put: ++ spi_controller_put(ctlr); + return err; + } + +@@ -1416,26 +1072,15 @@ static int bcm2835_spi_remove(struct pla + + bcm2835_debugfs_remove(bs); + +- spi_unregister_controller(ctlr); +- +- bcm2835_dma_release(ctlr, bs); +- + /* Clear FIFOs, and disable the HW block */ + bcm2835_wr(bs, BCM2835_SPI_CS, + BCM2835_SPI_CS_CLEAR_RX | BCM2835_SPI_CS_CLEAR_TX); + + clk_disable_unprepare(bs->clk); + +- return 0; +-} +- +-static void bcm2835_spi_shutdown(struct platform_device *pdev) +-{ +- int ret; ++ bcm2835_dma_release(ctlr); + +- ret = bcm2835_spi_remove(pdev); +- if (ret) +- dev_err(&pdev->dev, "failed to shutdown\n"); ++ return 0; + } + + static const struct of_device_id bcm2835_spi_match[] = { +@@ -1451,7 +1096,6 @@ static struct platform_driver bcm2835_sp + }, + .probe = bcm2835_spi_probe, + .remove = bcm2835_spi_remove, +- .shutdown = bcm2835_spi_shutdown, + }; + module_platform_driver(bcm2835_spi_driver); + From 451086528d19e7f38a34dabe9119d23af158852b Mon Sep 17 00:00:00 2001 From: Corey Wagehoft Date: Tue, 18 Nov 2025 18:59:31 -0700 Subject: [PATCH 35/37] feat: add BCF for Alfa AHM26108D --- files/lib/firmware/morse/bcf_mf04151.bin | Bin 0 -> 1117 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 files/lib/firmware/morse/bcf_mf04151.bin diff --git a/files/lib/firmware/morse/bcf_mf04151.bin b/files/lib/firmware/morse/bcf_mf04151.bin new file mode 100644 index 0000000000000000000000000000000000000000..aff6fc48136ebe8883b0209f000af6750bf4cc13 GIT binary patch literal 1117 zcmZ{iO-LJ25XUER)S#sriD(anK!w_aaT7Owq97rPUqOr_=pi+3qJkRTL=jOMsE6L` zUFe~=LN6_z#Dn0)TaN{AlA{N2mXgk2eNSDw12g&0%x~Y$o6U##_>jlrA!S~=A(fd@ zJbY-F6r>7jrI*rGef5m`trUSCe71t9ceD3Igr+hgT?un2eV-wW$3|Pi7O6sVMffQOmQtzP#Rpxg==?kH!fVS zgDbmmaR*n+|DSKt!8N&X^A7Hf3zv0p?JnG=gX?qQ_MUJeX;?UX8)a&@pQNBPdI{m` z6!f$g$}i^&c3~k+p>%G+wo;3^_3X+Lh3w3dm0L><&S)7M)H4299ZBfw=%kioQ(7kG zv`h|bIg?Z`v@-cc(OWC4R%$zA)Ah->%d4L;pHIdtU}VPNULKd|;rA%WWtc13*ANI) zaUekC<3_26ct@haL5blzGQ!QGJGfq=$*mHjcim2I5Z%Rp%jI%6mn8P^FNyt(r40r{)jSXD*i(jF!f}!sdN6^^8+q%5p%y2Z^nKq1!X$2!jN4O^%`3D@`jj{j$ literal 0 HcmV?d00001 From 0a9a6d7668a6a3974de025fff40823f6bf103ed7 Mon Sep 17 00:00:00 2001 From: Corey Wagehoft Date: Wed, 19 Nov 2025 15:36:31 -0700 Subject: [PATCH 36/37] chore: force MAC80211_MESH on --- target/linux/bcm27xx/bcm2711/config-5.15 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/target/linux/bcm27xx/bcm2711/config-5.15 b/target/linux/bcm27xx/bcm2711/config-5.15 index 9b20f77f9b..4b61f646c0 100644 --- a/target/linux/bcm27xx/bcm2711/config-5.15 +++ b/target/linux/bcm27xx/bcm2711/config-5.15 @@ -482,3 +482,5 @@ CONFIG_SPI_BITBANG=y CONFIG_SPI_DYNAMIC=y CONFIG_SPI_GPIO=y CONFIG_SPI_MASTER=y + +CONFIG_MAC80211_MESH=y From 249917f8504203c1b2e49f563d431ac9bcf78ab3 Mon Sep 17 00:00:00 2001 From: Corey Wagehoft Date: Wed, 19 Nov 2025 16:40:48 -0700 Subject: [PATCH 37/37] chore: update feed commit --- feeds.conf.default | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/feeds.conf.default b/feeds.conf.default index 1e1f04c232..01ec16c9d4 100644 --- a/feeds.conf.default +++ b/feeds.conf.default @@ -1,4 +1,4 @@ -src-git openmanet https://github.com/OpenMANET/packages^9ac92ccac2b84a24e436d8a1e7ab44b05c47a7e8 +src-git openmanet https://github.com/OpenMANET/packages^c5f00c47a479ac6c4234955de640a8666f7a7cfb src-git packages https://github.com/openwrt/packages.git^b5ed85f6e94aa08de1433272dc007550f4a28201 src-git routing https://github.com/openwrt/routing.git^e351d1e623e9ef2ab78f28cb1ce8d271d28c902d src-git telephony https://github.com/openwrt/telephony.git^98c8a5aa4624312ed758e2e2b6d4039050a1649d