Skip to content

oonf-olsrd2: reinstate and update to OONF master#1176

Open
parasew wants to merge 1 commit into
openwrt:masterfrom
parasew:reinstate-oonf-olsrd2
Open

oonf-olsrd2: reinstate and update to OONF master#1176
parasew wants to merge 1 commit into
openwrt:masterfrom
parasew:reinstate-oonf-olsrd2

Conversation

@parasew
Copy link
Copy Markdown

@parasew parasew commented Jun 4, 2026

Summary

Reinstates oonf-olsrd2 (and its oonf-init-scripts dependency), which were removed in #1145. The two issues that motivated the removal are both fixed in current OONF master, and I've verified a clean build.

Why this is safe now

The removal in #1145 cited three problems. Status of each:

What this PR changes

  • Bumps the source pin from the stale 2022-08-25 commit to master b2164126e12340f19ea33070e1e11eb469a051e5 (2025-12-04), with a refreshed PKG_MIRROR_HASH.
  • Bumps PKG_RELEASE.
  • Drops 100-enable-lan-import-plugin.patch. Upstream has absorbed it: add_subdirectory(lan_import) is already present in src/olsrv2/CMakeLists.txt, so the patch no longer applies and is redundant.

No source code changes and no plugin-list changes were needed.

Verification

Clean build and PKG_MIRROR_HASH verification with the OpenWrt x86-64
gcc-14.3.0_musl SDK (snapshots). x86-64 is 64-bit musl, the same ABI condition that triggered the original -Wint-conversion failure, so the build exercises the relevant code path. No -Wint-conversion and no CMake minimum-version error.

Scope

This PR covers oonf-olsrd2 only. The DLEP packages (oonf-dlep-radio,
oonf-dlep-proxy) were the actual subjects of OLSR/OONF#71 and remain removed; they can follow in a separate PR once each is build-tested individually.

@XDjackieXD noted intent to re-add the packages in #1145.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@BKPepe
Copy link
Copy Markdown
Member

BKPepe commented Jun 5, 2026

Given that the package was removed nearly a year ago and we want to add it back, it basically needs a complete rebirth at this point. We should approach it and review it from scratch to ensure it’s clean and makes sense. If we don’t do it now, it’ll never happen.

I was hoping to convince Copilot to take a look at it, but apparently, it’s a no. :) We’ll see, maybe it’ll get moving. As a next step, I suggest we set up a quick review of the original requirements so we don't bring back any old technical debt.

Comment thread oonf-init-scripts/Makefile Outdated
Comment thread oonf-init-scripts/Makefile Outdated
define Package/oonf-init-scripts
SECTION:=net
CATEGORY:=Network
MAINTAINER:=Henning Rogge <hrogge@gmail.com>
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Does anyone know if this maintainer is still active?

Copy link
Copy Markdown
Author

@parasew parasew Jun 5, 2026

Choose a reason for hiding this comment

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

I can't confirm whether Henning is still active on the packaging side. To avoid these going unmaintained again, I'm willing to take over maintenance of oonf-olsrd2 and oonf-init-scripts and have set PKG_MAINTAINER accordingly. I've also emailed Henning directly as a courtesy in case he'd like to stay on. I have several OpenWrt devices and will run olsrd2 on real hardware, not just the cross-compile and QEMU validation I did for this PR.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

As far as I remember he does not maintain the package anymore. But maybe he responds.

Comment thread oonf-init-scripts/Makefile Outdated
Comment thread oonf-init-scripts/Makefile Outdated
Comment thread oonf-init-scripts/Makefile Outdated
Comment thread oonf-olsrd2/Makefile Outdated
Comment thread oonf-olsrd2/Makefile Outdated
Comment on lines +78 to +81
$(INSTALL_BIN) -D $(PKG_BUILD_DIR)/olsrd2_static $(1)/usr/sbin/olsrd2
$(INSTALL_BIN) -D ./files/olsrd2.init $(1)/etc/init.d/olsrd2
$(INSTALL_BIN) -D ./files/olsrd2.hotplug $(1)/etc/hotplug.d/iface/50-olsrd2
$(INSTALL_DATA) -D ./files/olsrd2.uci $(1)/etc/config/olsrd2
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Could you clarify the purpose of the -d parameter here?

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.

-D (uppercase) is the coreutils install create-leading-directories flag. I've switched to the idiomatic form: an explicit $(INSTALL_DIR) for the target dirs followed by plain $(INSTALL_BIN)/$(INSTALL_DATA)/$(INSTALL_CONF) without -D.

Comment thread oonf-olsrd2/Makefile Outdated
Comment thread oonf-olsrd2/Makefile
Comment on lines +71 to +73
define Build/Install
$(INSTALL_BIN) -D $(PKG_BUILD_DIR)/$(MAKE_PATH)/olsrd2_static $(PKG_INSTALL_DIR)/usr/sbin/olsrd2;
endef
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Why do we need this?

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.

I tried removing this (along with CMAKE_INSTALL), but it breaks the build: without it, os_vif_linux.c (pulled in by the lan_import plugin) fails to compile with a "redefinition of struct ethhdr" error under the musl toolchain. So the cmake install handling is load-bearing here, not dead code, and I've kept it. I haven't traced the exact mechanism by which CMAKE_INSTALL affects that compile, but it's empirically required for a clean build across the CI architectures.

Comment thread oonf-olsrd2/test-version.sh Outdated
Comment on lines +7 to +11
# PKG_VERSION is a synthetic <date>~<short-commit> string built from
# PKG_SOURCE_DATE/PKG_SOURCE_VERSION. olsrd2 reports the OONF library
# version via -v/--version (see src/libcore/oonf_main.c), which does not
# contain that synthetic string, so the generic version check cannot
# match. Skip it explicitly.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Im not entirely comfortable with this comment. Why does our versioning diverge from upstream, and how should we verify it? The logic here basically means: we have generic version testing, upstream provides one version, downstream has a different one, and because they don't match, we just completely bypass the generic CI/CD checks. That doesn't seem like the right approach, does it?

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.

You're right that bypassing the check was wrong. The version diverges only because there's no upstream release tag to track, so this follows OpenWrt's standard ~ snapshot convention for the pinned master commit. But the build injects that commit via -D OONF_LIB_GIT, and olsrd2 reports it in its -v output. So I replaced the skip with a real check that verifies the binary reports the pinned commit. Validated in QEMU: olsrd2 -v prints "Git commit: b2164126e12340...", which the check matches.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 9 out of 9 changed files in this pull request and generated 7 comments.

Comment thread oonf-olsrd2/Makefile
Comment on lines +33 to +46
CMAKE_OPTIONS+=-D CMAKE_BUILD_TYPE:String=$(BUILD_TYPE) \
-D OONF_NO_WERROR:Bool=true \
-D OONF_LOGGING_LEVEL:String=debug \
-D OONF_NO_TESTING:Bool=true \
-D UCI:Bool=true \
-D OONF_APP_DEFAULT_CFG_HANDLER:String=uci \
-D OONF_STATIC_PLUGINS:String="class;callback;clock;duplicate_set;layer2;packet_socket;rfc5444;socket;stream_socket;telnet;timer;viewer;os_clock;os_fd;os_interface;os_routing;os_system;nhdp;olsrv2;ff_dat_metric;neighbor_probing;nl80211_listener;link_config;layer2info;systeminfo;cfg_uciloader;cfg_compact;nhdpinfo;olsrv2info;netjsoninfo;${CMAKE_OPTIONAL_PLUGINS}" \
-D OONF_LIB_GIT:String=$(PKG_SOURCE_VERSION) \
-D VERSION_SUB_TAG:String=$(PKG_SOURCE_DATE) \
-D INSTALL_LIB_DIR:Path=lib/oonf \
-D INSTALL_INCLUDE_DIR:Path=include/oonf \
-D INSTALL_CMAKE_DIR:Path=lib/oonf \
-D CMAKE_PREFIX_PATH=$(STAGING_DIR)/usr \
-D CMAKE_GENERATOR=Ninja
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.

cmake accepts both -DVAR=value and -D VAR=value; the space form is documented and used elsewhere in the feed. The package builds cleanly across all CI architectures as-is, so this isn't an error. Left the spacing unchanged.

Comment thread oonf-olsrd2/Makefile
Comment thread oonf-init-scripts/Makefile
Comment on lines +55 to +63
case "$( uci -q get "${DAEMON}.@[${i}].ignore" )" in
1|on|true|enabled|yes)
oonf_log "removing/ignore section '$section'"
uci -q -c /var/run delete "${DAEMON}_dev.@[${j}]"
i=$(( i + 1 ))

continue
;;
esac
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.

Good catch, real bug. ${j} was never defined, and as you noted deleting mid-loop shifts the anonymous section indexes. Note Copilot's suggested fix (dropping the delete) would silently disable the ignore feature, so I didn't take it. Instead I collect the ignored indexes during the loop and delete them afterwards in descending order, which removes the section without disturbing the others. Validated in QEMU with a three-section config where the middle section is ignored: that section is removed from /var/run/olsrd2_dev and the surrounding sections stay intact and correctly named.

Comment thread oonf-init-scripts/files/oonf_init.sh Outdated
uci export ${DAEMON} >"/var/run/${DAEMON}_dev"

while section="$( uci -q -c /etc/config get "${DAEMON}.@[${i}]" )"; do {
echo "section: ${section}"
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.

Removed the debug echo.

Comment thread oonf-init-scripts/files/oonf_init.sh Outdated
for single_interface in ${interface}; do {
device_name="$( oonf_get_layer3_device "${single_interface}" )"

echo "Interface: ${single_interface} = ${device_name}"
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.

Removed the debug echo.

Comment on lines +122 to +128
running()
{
# check if we have a pidfile and then check if that pid still exists.
# since we don't use -e this has to be explicitly returned. exit would stop the process.
test -e "/tmp/run/olsrd2.pid" && test -e "/proc/$(cat "/tmp/run/olsrd2.pid")" && return 0
return 1
}
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.

Fixed. running() now uses /var/run/${DAEMON}.pid instead of the hardcoded olsrd2 path, consistent with oonf_reread_config elsewhere in the script.

@parasew
Copy link
Copy Markdown
Author

parasew commented Jun 5, 2026

Agreed, let's treat it as a fresh package rather than a revert. I'll go through both Makefiles against current conventions and push a cleaned version. For the requirements review: the default plugin set is driven by Config.in (lan_import, route_modifier, mpr, etc. as compile-time options folded into the single static binary), oonf-init-scripts ships two sourced shell helpers to /lib/functions/, and oonf-olsrd2 carries the procd init + hotplug + a default UCI config. Happy to align on what the default-enabled plugin set should be before I resubmit, so we don't bring back anything stale.

Reverts the olsrd2 portion of the oonf-* removal in 58070aa. The two
issues that motivated removal are fixed in current OONF master:

- GCC 14 -Wint-conversion in os_system_linux.c: master uses designated
  initializers for struct msghdr. The fix existed on develop and landed
  on master in the 2025-12 develop->master merge.
- CMake 4.x: root CMakeLists.txt now sets cmake_minimum_required 3.10.

Bumps the source pin from the stale 2022-08-25 commit to master
b2164126 (2025-12-04), bumps PKG_RELEASE, and drops
100-enable-lan-import-plugin.patch, which upstream has absorbed
(lan_import is now in src/olsrv2/CMakeLists.txt).

Verified: clean build and hash verification with the OpenWrt x86-64
gcc-14.3.0_musl SDK.

Signed-off-by: Matthias Tarasiewicz <mt@riat.at>
@parasew parasew force-pushed the reinstate-oonf-olsrd2 branch from d308f19 to e2f7443 Compare June 5, 2026 20:33
@parasew
Copy link
Copy Markdown
Author

parasew commented Jun 5, 2026

Pushed a cleaned-up version treating this as a fresh package per your suggestion, rather than a revert. Summary of changes: dropped the PKG_BUILD_DIR override, kernel.mk include, redundant VERSION lines, and the oonf-git/template indirection; added SPDX headers, PKG_MAINTAINER, PKG_LICENSE; switched URLs to https; fixed install macros (INSTALL_DIR + INSTALL_CONF for the config file); reset PKG_RELEASE to 1; added dependencies. Replaced the test-version.sh skip with a real check. Fixed several pre-existing bugs in oonf_init.sh that Copilot caught. I built and validated everything in QEMU on the x86-64 snapshot target: the package installs, jshn resolves as a dependency, olsrd2 reports the pinned commit, and the ignore-section logic works correctly. Details in the per-line replies.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants