Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wfb-ng: Add wfb-ng package #24974

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 49 additions & 0 deletions net/wfb-ng/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
include $(TOPDIR)/rules.mk

PKG_NAME:=wfb-ng
PKG_VERSION:=24.9.3
BKPepe marked this conversation as resolved.
Show resolved Hide resolved
PKG_RELEASE:=1
PKG_LICENSE:=GPL-3.0-only
PKG_LICENSE_FILES:=LICENSE
svpcom marked this conversation as resolved.
Show resolved Hide resolved

PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://github.com/svpcom/wfb-ng.git
PKG_SOURCE_VERSION:=wfb-ng-24.09-openwrt-preview
BKPepe marked this conversation as resolved.
Show resolved Hide resolved
PKG_MIRROR_HASH:=afa8bd06d3119e3fa8edc10d4a205e8b9ad21d0157e151aecba4dc24329a0d76

PKG_BUILD_PARALLEL:=1
PKG_MAINTAINER:=Vasily Evseenko <[email protected]>
svpcom marked this conversation as resolved.
Show resolved Hide resolved

include $(INCLUDE_DIR)/package.mk

define Build/Compile
$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR)/$(MAKE_PATH) \
$(MAKE_FLAGS) \
VERSION=$(PKG_VERSION) COMMIT=$(PKG_SOURCE_VERSION) \
all_bin
endef
svpcom marked this conversation as resolved.
Show resolved Hide resolved

define Package/wfb-ng
SECTION:=net
CATEGORY:=Network
DEPENDS:=+libpcap +libsodium +libstdcpp
TITLE:=Long-range packet radio link using raw WiFi
URL:=https://github.com/svpcom/wfb-ng
SUBMENU:=Wireless
svpcom marked this conversation as resolved.
Show resolved Hide resolved
endef

define Package/wfb-ng/description
The next generation of long-range packet radio link using raw WiFi
This is a base version that have only binaries and can act as cluster node,
standalone receiver or transmitter without diversity.
endef

define Package/wfb-ng/install
$(INSTALL_DIR) $(1)/usr/bin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/wfb_rx $(1)/usr/bin/
$(INSTALL_BIN) $(PKG_BUILD_DIR)/wfb_tx $(1)/usr/bin/
$(INSTALL_DIR) $(1)/etc/init.d
$(INSTALL_BIN) ./files/wfb-ng.init $(1)/etc/init.d/wfb-ng
endef

$(eval $(call BuildPackage,wfb-ng))
26 changes: 26 additions & 0 deletions net/wfb-ng/files/wfb-ng.init
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/bin/sh /etc/rc.common

START=99
STOP=10

USE_PROCD=1
NAME=wfb-ng
BKPepe marked this conversation as resolved.
Show resolved Hide resolved

SYSUPGRADE_CONF="/etc/sysupgrade.conf"
WFB_INIT="/usr/sbin/wfb-ng.sh"

if [ -f $SYSUPGRADE_CONF ] && [ -x $WFB_INIT ] && ! grep -q $WFB_INIT $SYSUPGRADE_CONF
then
echo $WFB_INIT >> $SYSUPGRADE_CONF
fi
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure, what you would like to achieve with this one? You want to persist init file through sysupgrade? Do you know how the sysupgrade works?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/usr/sbin/wfb-ng.sh is a custom init script, generated by user. I want to persist it during sysupgrade

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Definitely, this should not be here. Usually there is section conffiles, but in that case, the file is mentioned in the Makefile.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How to add /usr/sbin/wfb-ng.sh to /etc/sysupgrade.conf in the Makefile? I've tried to search this in other openwrt packages, but found only the way above in net/p910nd/files/p910nd.hotplug

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

define a conffiles recipe.

FYI:

define Package/alist/conffiles
/etc/alist/
/etc/config/alist
endef

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@1715173329 fixed. Thanks!

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The question is if this is going to work, though. Needs to be tested for files, which are not included/presented in the Makefile.

Copy link
Author

@svpcom svpcom Sep 23, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@BKPepe Alredy done. Package was built successfully

Copy link
Author

@svpcom svpcom Sep 23, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also i've checked it on real hardware (TP-Link CPE510v3).


start_service() {
if [ -x $WFB_INIT ]; then
procd_open_instance wfb-ng
procd_set_param command $WFB_INIT
procd_set_param respawn
procd_set_param stdout 1
procd_set_param stderr 1
procd_close_instance
fi
}
Loading