Skip to content
Open
Changes from all commits
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
54 changes: 54 additions & 0 deletions net/opengnb/Makefile

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

nit: This Makefile is committed with executable mode 100755. Package Makefiles in this tree are non-executable (100644) β€” 1446 of them are 644 and only 3 are 755. Please reset the mode:

chmod 644 net/opengnb/Makefile

then amend the commit.


Generated by Claude Code

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

done.

Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
#
# Copyright 2026 Charles Chan <hollidgelongsun157@gmail.com>
#
# This is free software, licensed under the GNU General Public License v3.0-or-later
# See /LICENSE for more information.
#

include $(TOPDIR)/rules.mk

PKG_NAME:=opengnb
PKG_VERSION:=1.6.8
PKG_RELEASE:=1

PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://github.com/opengnb/opengnb/releases/download/$(PKG_VERSION)/
PKG_HASH:=4c6a603080efa79457b889e43e87c1a3a070e7cf7cd7621d1a106a06a161f829

PKG_MAINTAINER:=Charles Chan <hollidgelongsun157@gmail.com>
PKG_LICENSE:=GPL-3.0-or-later
PKG_LICENSE_FILES:=LICENSE

include $(INCLUDE_DIR)/package.mk

define Package/opengnb
SECTION:=net
CATEGORY:=Network
SUBMENU:=VPN
TITLE:=OpenGNB - P2P Decentralized Virtual Network
URL:=https://github.com/opengnb/opengnb
DEPENDS:=+kmod-tun +libpthread +zlib
endef

define Package/opengnb/description
OpenGNB is an open source P2P decentralized Software Defined Virtual Network
with extreme intranet penetration capability.
endef

define Build/Compile
$(MAKE) -C $(PKG_BUILD_DIR) \
$(TARGET_CONFIGURE_OPTS) \
CFLAGS="$(TARGET_CFLAGS) $(TARGET_CPPFLAGS)" \

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

All four installed binaries embed a compile timestamp, which makes the package non-reproducible β€” the same source built twice yields different binaries. src/gnb_version.h in the 1.6.7 tarball has:

#ifndef GNB_SKIP_BUILD_TIME
#define GNB_BUILD_STRING  "Build Time ["__DATE__","__TIME__"]"
#else
#define GNB_BUILD_STRING  "Build Time [Hidden]"
#endif

and GNB_BUILD_STRING is referenced from src/cli/gnb.c, gnb_ctl.c, gnb_crypto.c and gnb_es.c, so every one of them is affected. Upstream already provides the opt-out, so defining it here is the whole fix. Feed packages handle build stamps the same way β€” see net/ratched/Makefile:17 (-DBUILD_TIMESTAMP_UTC="\"unknown\"") and net/socat/Makefile:83 (BUILD_DATE=$(SOURCE_DATE_EPOCH)).

Suggested change
CFLAGS="$(TARGET_CFLAGS) $(TARGET_CPPFLAGS)" \
CFLAGS="$(TARGET_CFLAGS) $(TARGET_CPPFLAGS) -DGNB_SKIP_BUILD_TIME" \

Generated by Claude Code

LDFLAGS="$(TARGET_LDFLAGS)" \
-f Makefile.openwrt
endef

define Package/opengnb/install
$(INSTALL_DIR) $(1)/usr/sbin

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

nit / question: gnb is a long-running daemon, but the package installs only the four binaries β€” there is no /etc/init.d/opengnb and no /etc/config/opengnb, so nothing starts the VPN at boot and there is no UCI surface to configure it. The feed's convention for daemons is a procd init script (#!/bin/sh /etc/rc.common, USE_PROCD=1, start_service()), with any shipped config registered in define Package/opengnb/conffiles.

I can't tell from the diff whether this is deliberate. Worth noting the 1.6.7 tarball ships only a systemd unit (scripts/opengnb@.service) and a examples/node_config_example tree, so there is nothing to install verbatim β€” an init script would have to be written for this package. Is that planned as a follow-up, or is manual invocation the intent for the initial submission?


Generated by Claude Code

$(INSTALL_BIN) $(PKG_BUILD_DIR)/gnb $(1)/usr/sbin/
$(INSTALL_BIN) $(PKG_BUILD_DIR)/gnb_ctl $(1)/usr/sbin/
$(INSTALL_BIN) $(PKG_BUILD_DIR)/gnb_crypto $(1)/usr/sbin/
$(INSTALL_BIN) $(PKG_BUILD_DIR)/gnb_es $(1)/usr/sbin/
endef

$(eval $(call BuildPackage,opengnb))