Skip to content

Add corosync qdevice - #29269

Open
skirmess wants to merge 4 commits into
openwrt:masterfrom
skirmess:add-corosync-qdevice
Open

Add corosync qdevice#29269
skirmess wants to merge 4 commits into
openwrt:masterfrom
skirmess:add-corosync-qdevice

Conversation

@skirmess

@skirmess skirmess commented Apr 28, 2026

Copy link
Copy Markdown

📦 Package Details

Maintainer: @skirmess, @sshaikh

Description:
Adds 4 new packages providing Corosync cluster infrastructure and the
corosync-qnetd quorum device daemon. These allow a 2-node Proxmox VE
(or other Corosync-based) cluster to maintain quorum when one node fails.

Packages added (in dependency order):

  • libs/libqb – high-performance IPC/logging library
  • net/kronosnet – network transport layer for Corosync (+ crypto subpackages)
  • net/corosync – cluster engine split into libcorosync + corosync
  • net/corosync-qdevice – quorum device daemon (corosync-qnetd)

🧪 Run Testing Details

  • OpenWrt Version: 25.12.2
  • OpenWrt Target/Subtarget: ath79/nand
  • OpenWrt Device: GL.iNet GL-AR300M16 (MIPS 24Kc)

✅ Formalities

  • I have reviewed the CONTRIBUTING.md file for detailed contributing guidelines.

If your PR contains a patch:

  • It can be applied using git am
  • It has been refreshed to avoid offsets, fuzzes, etc., using
    make package/<your-package>/refresh V=s
  • It is structured in a way that it is potentially upstreamable

@BKPepe
BKPepe requested a review from Copilot April 28, 2026 21:11

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Adds new OpenWrt feed packages and supporting patches to provide Corosync clustering components (libqb, kronosnet, corosync) and the corosync-qnetd quorum device daemon for maintaining quorum in 2-node clusters.

Changes:

  • Introduce new packages: libs/libqb, net/kronosnet (+ crypto backend subpackages), net/corosync (split libcorosync + corosync), and net/corosync-qdevice.
  • Add OpenWrt-specific patches to corosync-qdevice certutil scripts (bash shebang + CA/noise-file handling).
  • Add an init script and a post-install hook to initialize the qnetd NSS DB.

Reviewed changes

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

Show a summary per file
File Description
libs/libqb/Makefile New libqb package definition and install/dev-install rules.
net/kronosnet/Makefile New kronosnet package definition with crypto backend subpackages and install rules.
net/corosync/Makefile New corosync packaging split into libcorosync and corosync, with install/dev-install rules.
net/corosync-qdevice/Makefile New corosync-qdevice package, init installation, and postinst initialization of NSS DB.
net/corosync-qdevice/files/corosync-qdevice.init New procd init script to run corosync-qnetd.
net/corosync-qdevice/patches/0001-bash-path.patch Forces bash shebang for upstream certutil scripts.
net/corosync-qdevice/patches/0002-initialize-ca.patch OpenWrt adaptations: skip chown, adjust noise generation and hashing.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread net/corosync-qdevice/files/corosync-qdevice.init
Comment thread net/corosync-qdevice/Makefile Outdated
Comment thread net/corosync/Makefile Outdated
Comment thread net/corosync-qdevice/Makefile
Comment thread net/corosync-qdevice/Makefile Outdated
Comment thread libs/libqb/Makefile
Comment thread libs/libqb/Makefile Outdated
@skirmess
skirmess force-pushed the add-corosync-qdevice branch 2 times, most recently from 397ccd1 to b071be8 Compare April 29, 2026 09:41
@skirmess
skirmess marked this pull request as draft April 29, 2026 09:57
@skirmess
skirmess force-pushed the add-corosync-qdevice branch from b071be8 to 8fa0a14 Compare April 29, 2026 10:14
@skirmess
skirmess marked this pull request as ready for review April 29, 2026 10:16
Comment thread net/corosync-qdevice/Makefile Outdated
Comment thread net/corosync-qdevice/Makefile Outdated
@skirmess
skirmess force-pushed the add-corosync-qdevice branch 2 times, most recently from 95ba6ad to 4920e20 Compare May 6, 2026 18:55
@GeorgeSapkin
GeorgeSapkin force-pushed the add-corosync-qdevice branch from 4920e20 to d78e2fa Compare May 7, 2026 16:03
Comment thread net/corosync-qdevice/Makefile Outdated
Comment thread net/corosync/Makefile Outdated
Comment thread net/kronosnet/Makefile Outdated
Comment thread net/kronosnet/Makefile Outdated
Comment thread net/corosync-qdevice/patches/0002-initialize-ca.patch Outdated

@BKPepe BKPepe left a comment

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.

In an ideal world, I would love for these patches to be in a state where they can be upstreamed, and it would be even better if they were actually merged upstream. After all, it would save a lot of work in OpenWrt, as we wouldn't have to rebase them every time due to offsets, changes, and so on. The patches definitely need to have some kind of header—someone created them, after all. And looking at two of the patches, removing libxml2 and doxygen2man can certainly be handled better in the upstream project rather than just deleting lines downstream.

@skirmess
skirmess force-pushed the add-corosync-qdevice branch from d78e2fa to 90f9a50 Compare May 8, 2026 06:49
@skirmess

skirmess commented May 8, 2026

Copy link
Copy Markdown
Author

Create PR 515 for libqb which would add a --disable-man option and PR 40 for corosync-qdevice for the bash path.

@skirmess
skirmess force-pushed the add-corosync-qdevice branch from 90f9a50 to c2a3d89 Compare May 9, 2026 14:47
@skirmess

skirmess commented May 9, 2026

Copy link
Copy Markdown
Author

Fixed the SONAME symlink issue: changed $(INSTALL_DATA) to $(CP) in the Package/*/install sections for libqb, kronosnet, and libcorosync. $(INSTALL_DATA) uses install -m 644 which dereferences symlinks, so the SONAME symlinks (e.g. libqb.so.100 -> libqb.so.100.3.2) were installed as regular files instead of symlinks.

@skirmess
skirmess force-pushed the add-corosync-qdevice branch from c2a3d89 to 8cd2191 Compare May 10, 2026 06:59
@skirmess

Copy link
Copy Markdown
Author

Added test.sh scripts to all four packages to fix the version check warnings. For corosync, corosync -v is used since it prints the version and exits cleanly. For corosync-qdevice, corosync-qnetd -v is used. For library-only packages (libqb, libcorosync, kronosnet), the test verifies that the .so files are present.


case "$1" in
corosync-qdevice)
corosync-qnetd -v 2>&1 | grep -F "$2"

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.

This is done by the generic tests already. Was this not working?

@skirmess skirmess May 10, 2026

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.

This is the error from CI:

corosync-qdevice: No executables in the package provided version 3.0.4
corosync-qdevice: Generic tests failed

But only libqb and corosync-qdevice had a failure. I've removed the two test.sh files that weren't needed.

@skirmess
skirmess force-pushed the add-corosync-qdevice branch from 8cd2191 to 28357be Compare May 10, 2026 12:55
@skirmess

Copy link
Copy Markdown
Author

The --disable-man option was merged into libqb (ClusterLabs/libqb#515), but there is no ETA for a new release. Whenever they release it we can update the package and remove a patches.

The PR for corosync-qdevice (corosync/corosync-qdevice#40) has seen no activity. Last commit to the repo was 2 month ago, I don't expect this to be included soon.

I've added two test.sh scripts with the hope that this solves the false reports from the CI system.

I think I've implemented all the changes BKPepe and GeorgeSapkin asked for.

@skirmess
skirmess requested a review from BKPepe May 16, 2026 16:06
@skirmess
skirmess requested a review from BKPepe May 21, 2026 20:18
@mundschenk-at

mundschenk-at commented May 22, 2026

Copy link
Copy Markdown

@skirmess I tried building the packages using a custom feed, but libqb fails in the configure stage:

...
configure: Enabling inter-library dependencies:
checking for GNU date... no
checking for BSD date... no
checking for date type... unknown
configure: error: date utility unable to convert epoch to UTC

Edit: Looks like an Ubuntu 25.10 issue with the new rust-based coreutils. sudo apt-get remove coreutils-from-uutils --allow-remove-essential allowed the compilation to continue. I'm not sure if it's an actual missing feature or just a detection issue.

@mundschenk-at

Copy link
Copy Markdown

After fixing the compilation issue, I can report that the package runs fine, but I think it might need a dependency on coreutils-sha1sum for corosync-qdevice-net-certutil (the sha1sum applet for busybox is not compiled in by default, at least on my BPI-R4).

@skirmess
skirmess force-pushed the add-corosync-qdevice branch from ae058ab to 143b87e Compare May 23, 2026 11:03
@skirmess

Copy link
Copy Markdown
Author

Good point — sha1sum is not compiled into Busybox by default. Switched to sha256sum, which is available in Busybox by default on OpenWrt, so no additional dependency on coreutils-sha1sum is needed.

Since we already have a patch that modifies that line anyway (to remove ps -elf, date; w and chown --reference= for Busybox compatibility), the change adds no extra patch complexity.

@skirmess
skirmess force-pushed the add-corosync-qdevice branch from 143b87e to 77a4a39 Compare May 23, 2026 18:30
@skirmess

Copy link
Copy Markdown
Author

Removed two debugging utilities that are not useful on embedded routers:

  • qb-blackbox from libs/libqb: reads binary blackbox log files written by libqb — a developer debugging tool with no use case on an OpenWrt device
  • corosync-blackbox from net/corosync: same purpose, reads Corosync blackbox logs

Both packages remain functional for their intended purpose (library/cluster engine). Removing these binaries also fixes the CI failures caused by executables that do not support version output.

@skirmess

skirmess commented Jul 1, 2026

Copy link
Copy Markdown
Author

Fixed commit message prefixes — changed from path-based prefixes (e.g. libs/libqb:, net/kronosnet:) to package name prefixes (libqb:, kronosnet:, etc.) as required.

Copilot AI left a comment

Copy link
Copy Markdown

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 10 out of 10 changed files in this pull request and generated 6 comments.

Comment thread libs/libqb/Makefile Outdated
$(INSTALL_DIR) $(1)/usr/include/qb
$(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/include/qb/* $(1)/usr/include/qb
$(INSTALL_DIR) $(1)/usr/lib
$(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/lib*.so* $(1)/usr/lib/
Comment thread net/corosync/Makefile Outdated
$(INSTALL_DIR) $(1)/usr/include/corosync
$(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/include/corosync/* $(1)/usr/include/corosync/
$(INSTALL_DIR) $(1)/usr/lib
$(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/lib*.so* $(1)/usr/lib/
Comment thread net/kronosnet/Makefile Outdated
$(INSTALL_DIR) $(1)/usr/include/
$(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/include/* $(1)/usr/include/
$(INSTALL_DIR) $(1)/usr/lib
$(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/lib*.so* $(1)/usr/lib/
Comment thread net/kronosnet/Makefile Outdated
$(INSTALL_DIR) $(1)/usr/lib/pkgconfig
$(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/*.pc $(1)/usr/lib/pkgconfig
$(INSTALL_DIR) $(1)/usr/lib/kronosnet
$(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/kronosnet/*.so* $(1)/usr/lib/kronosnet
Comment on lines +7 to +8
SERVICE_DAEMONIZE=1
SERVICE_WRITE_PID=1
- chown --reference=: GNU coreutils only, not available in Busybox
- ps -elf: GNU ps flags, not supported by Busybox
- w: not available on OpenWrt
- sha1sum: not compiled into Busybox by default; use sha256sum which is
@skirmess
skirmess force-pushed the add-corosync-qdevice branch from 8d801b8 to 0efe0ea Compare July 1, 2026 17:53
@skirmess

skirmess commented Jul 1, 2026

Copy link
Copy Markdown
Author

Thanks for the review, Copilot. Addressed the following:

  • libs/libqb, net/corosync, net/kronosnet: Switched $(INSTALL_DATA) to $(CP) for shared object files in Build/InstallDev to preserve symlinks/modes, matching the convention used by the vast majority of library packages in this feed.
  • net/corosync-qdevice/files/corosync-qdevice.init: Removed SERVICE_DAEMONIZE/SERVICE_WRITE_PID — these are rc.common-style variables that have no effect with USE_PROCD=1 and aren't used by other procd-based init scripts in this repo.
  • net/corosync-qdevice/patches/0002-initialize-ca.patch: Completed the truncated commit message sentence.

The following suggestions were not applied, since verifying them against the actual build showed they don't apply to our configuration or would break it:

  • /usr/bin/corosync-qnetd/usr/sbin/corosync-qnetd: Upstream's configure.ac defaults --enable-install-qnetd-in-sbin to no, and we don't override it, so corosync-qnetd and corosync-qnetd-certutil are actually installed into /usr/bin in our build. Changing the init script/postinst to /usr/sbin would break the service.
  • lib*.so*lib*.so.* in net/corosync/Makefile's Build/InstallDev: This would drop the unversioned .so symlinks from staging, which corosync-qdevice needs at link time (-lcfg, -lvotequorum, etc. via pkg-config). Verified this by rebuilding the full dependency chain (libqb → kronosnet → corosync → corosync-qdevice) with the current glob — it links fine.
  • pkgconfig install path /usr/share/pkgconfig for corosync-qdevice: matches where upstream itself installs the .pc file, and OpenWrt's PKG_CONFIG_PATH already includes both usr/lib/pkgconfig and usr/share/pkgconfig (see include/package.mk), so it's discoverable either way.
  • Alpine apk commands in the package description: the current description doesn't contain any apk references, so this looks like it was reviewing a stale diff.
  • libqb Build/InstallDev installing arbitrary binaries: the current Build/InstallDev for libqb doesn't install any binaries at all, just headers/libs/pkgconfig.

All four packages were rebuilt from scratch in the SDK to confirm nothing broke.

@skirmess

Copy link
Copy Markdown
Author

Updated dependencies to their latest upstream releases (rebased into the existing commits since this PR hasn't been merged yet, rather than adding new commits):

  • libqb 2.0.9 → 2.0.10: PR utils/zoneifo: Moved from old packages with updates #515 (--disable-man) is now merged upstream, so the custom 0001-configure-add-disable-man-option.patch has been removed entirely — CONFIGURE_ARGS += --disable-man now uses the native configure option. 2.0.10 also includes a few IPC hardening fixes (credential length validation, integer overflow fix, NULL checks after strdup).

  • kronosnet 1.33 → 1.35: Fixes three CVEs (CVE-2026-15811, CVE-2026-15812, CVE-2026-15813 — the last one a heap buffer overflow in defragmentation handling, though only exploitable with unencrypted traffic which isn't a supported configuration). Note: 1.34 introduced an optional Wireshark dissector that requires wireshark >= 4.6.0 via pkg-config by default; added --disable-wireshark-dissector to CONFIGURE_ARGS since Wireshark isn't available in OpenWrt and isn't needed at runtime — without this flag the build fails at configure time.

corosync and corosync-qdevice have no new upstream releases, so those two commits are unchanged.

Rebuilt the full dependency chain (libqb → kronosnet → corosync → corosync-qdevice) from scratch in the SDK to confirm everything still links and builds correctly with the updated versions.

@openwrt-ai openwrt-ai left a comment

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.

Commit checks

  • 85023e1 "corosync-qdevice: add corosync-qdevice 3.0.4" — the message lists the patches as "two patches for musl/busybox compatibility: fix bash shebang path". 0001-configure-add-with-bash-option.patch does not fix a shebang path: it adds a --with-bash=PATH configure option so the target path can be set during cross-compilation (upstream-reviewed by Jan Friesse), and the actual selection happens via CONFIGURE_ARGS += --with-bash=/bin/bash, which the message doesn't mention. Worth rewording so the message matches what the patch and the Makefile do.

Reviewed 4 commits. Other findings are inline.


Generated by Claude Code

Comment thread libs/libqb/test.sh Outdated

case "$1" in
libqb)
ls /usr/lib/libqb.so.* > /dev/null

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.

This won't silence the generic version check that motivated adding it. Per CONTRIBUTING.md, "Test scripts", test.sh runs in addition to the generic tests; the file that overrides version detection is test-version.sh ("When this script is present, the generic version detection is skipped entirely"). libqb ships no executable, so the generic probe still runs against it.

The in-tree pattern for a shared-library-only package is libs/expat/test-version.sh — a case "$PKG_NAME" with exit 0 for the library package and exit 1 for unknown ones. Note this mechanism landed on master after this branch was cut (the branch's own copy of CONTRIBUTING.md doesn't mention it), so a rebase is probably worth doing before renaming.

Same applies to net/corosync-qdevice/test.sh. Also, net/corosync and net/kronosnet ship neither test.sh nor test-version.sh, even though libcorosync and kronosnet are library-only in exactly the same way as libqb — that contradicts the PR comment stating test scripts were added to all four packages.


Generated by Claude Code

Comment on lines +43 to +50
define Build/InstallDev
$(INSTALL_DIR) $(1)/usr/share/pkgconfig
$(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/pkgconfig/corosync-qdevice.pc $(1)/usr/share/pkgconfig
$(INSTALL_DIR) $(1)/usr/bin
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/* $(1)/usr/bin
$(INSTALL_DIR) $(1)/usr/sbin
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/* $(1)/usr/sbin
endef

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.

Build/InstallDev copies target runtime binaries (and the shell scripts in usr/bin) into the staging dir. Nothing links against corosync-qdevice — it's a leaf package — so the staging tree only ever needs the .pc file at most. This is the same change you already made for net/corosync after review feedback ("Removed the binary install from Build/InstallDev").

Suggested change
define Build/InstallDev
$(INSTALL_DIR) $(1)/usr/share/pkgconfig
$(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/pkgconfig/corosync-qdevice.pc $(1)/usr/share/pkgconfig
$(INSTALL_DIR) $(1)/usr/bin
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/* $(1)/usr/bin
$(INSTALL_DIR) $(1)/usr/sbin
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/* $(1)/usr/sbin
endef
define Build/InstallDev
$(INSTALL_DIR) $(1)/usr/share/pkgconfig
$(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/pkgconfig/corosync-qdevice.pc $(1)/usr/share/pkgconfig
endef

Generated by Claude Code

Comment thread net/corosync-qdevice/Makefile Outdated
Comment on lines +53 to +56
$(INSTALL_DIR) $(1)/usr/bin
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/* $(1)/usr/bin
$(INSTALL_DIR) $(1)/usr/sbin
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/* $(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.

Wildcard installs mean the shipped file list silently changes on every version bump, and here they also pull in the corosync-qdevice client daemon and its tools, which the package TITLE/description ("corosync-qnetd daemon") and the init script don't cover. net/corosync/Makefile in this same PR enumerates each binary explicitly (lines 65-72) after the reviewers asked for it; please do the same here so it's visible which binaries this package actually ships.


Generated by Claude Code

Comment on lines +61 to +66
define Package/corosync-qdevice/postinst
#!/bin/sh
if [ -z "$${IPKG_INSTROOT}" ] && ! [ -f "/etc/corosync/qnetd/nssdb/cert9.db" ]; then
/usr/bin/corosync-qnetd-certutil -i
fi
endef

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.

The NSS DB is only ever created when the package is installed on a running system. When corosync-qdevice is baked into an image (ImageBuilder / make image), postinst runs with IPKG_INSTROOT set, the branch is skipped, and nothing re-runs it on first boot — so /etc/corosync/qnetd/nssdb/cert9.db never exists and corosync-qnetd fails to start. Certificate generation also can't sensibly happen in the build root anyway.

Two options that cover both install paths: install an /etc/uci-defaults/ script that does the same check on first boot, or do the check in start_service() in the init script before launching the daemon.

Separately, the script's exit status is corosync-qnetd-certutil's, so a certutil failure leaves the package in an unconfigured state; an explicit exit 0 (or || true) is the usual guard.


Generated by Claude Code

Comment on lines +21 to +22
+ # All files owned by root on OpenWrt
+ return

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.

An unconditional return at the top leaves the whole original function body as unreachable dead code, which is exactly the shape that makes a patch un-upstreamable — and upstreamability was the explicit request in the earlier review. Deleting the body outright, or guarding it (command -v chown >/dev/null / a configure-time knob), states the intent without leaving dead lines behind.

Also, this patch has no Signed-off-by: line, while 0001-configure-add-with-bash-option.patch does.


Generated by Claude Code

echo "Creating new noise file $noise_file"

- (ps -elf; date; w) | sha1sum | (read sha_sum rest; echo $sha_sum) > "$noise_file"
+ (ps w; date) | sha256sum | (read sha_sum rest; echo $sha_sum) > "$noise_file"

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.

ps w isn't a safe assumption on OpenWrt: BusyBox's w option comes from FEATURE_PS_WIDE, which depends on ... && !BUSYBOX_CONFIG_DESKTOP. In a build with BUSYBOX_CONFIG_DESKTOP=y, ps rejects w and the noise file degenerates to sha256sum of date output alone — a fully predictable NSS seed for the qnetd CA key.

/dev/urandom is always present on OpenWrt and sidesteps the BusyBox feature dependency entirely, while keeping the patch a one-liner:

Suggested change
+ (ps w; date) | sha256sum | (read sha_sum rest; echo $sha_sum) > "$noise_file"
+ dd if=/dev/urandom bs=1024 count=1 2>/dev/null | sha256sum | (read sha_sum rest; echo $sha_sum) > "$noise_file"

If you take this, the ps -elf / w bullets in the patch header need updating too.


Generated by Claude Code

Comment thread net/kronosnet/Makefile Outdated
Comment on lines +23 to +24
SECTION:=net
CATEGORY:=Network

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: Package/kronosnet/install only ships lib*.so.*, so this is a pure library package, yet it lands under Network while libcorosync — equally library-only — is SECTION:=libs / CATEGORY:=Libraries in net/corosync/Makefile in this same PR. Same question for the nine kronosnet-compress-* / kronosnet-crypto-* plugin subpackages, which are dlopened .sos under /usr/lib/kronosnet/. Is the Network placement deliberate (upstream naming / discoverability), or should these follow libcorosync?


Generated by Claude Code

Comment thread net/corosync-qdevice/Makefile Outdated
PKG_FIXUP:=autoreconf
PKG_INSTALL:=1

PKG_BUILD_DEPENDS:=nss corosync

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: redundant — Package/corosync-qdevice already has DEPENDS:=+libcorosync +libnss ..., which gives the build-order dependency. This is the same reasoning you used to drop PKG_BUILD_DEPENDS from net/kronosnet/Makefile after review feedback. net/corosync/Makefile:16 (PKG_BUILD_DEPENDS:=libqb kronosnet, covered by libcorosync's DEPENDS:=+kronosnet +libqb) has the same leftover.


Generated by Claude Code

skirmess added 4 commits July 27, 2026 18:43
libqb provides high-performance, reusable features for client/server
architecture, including IPC, logging, and ringbuffer. Used by Corosync
and other cluster software.

Man page generation (and its libxml2 dependency) is disabled via
--disable-man, which is not needed at runtime.

Link: https://github.com/ClusterLabs/libqb
Signed-off-by: Sven Kirmess <sven.kirmess@kzone.ch>
kronosnet (knet) is a network abstraction layer designed for High
Availability use cases. It provides multipoint-to-multipoint
communication with link aggregation, redundancy, and optional
compression/encryption. Used as the transport layer by Corosync.

The wireshark dissector introduced in 1.34 is disabled via
--disable-wireshark-dissector, since wireshark is not available in
OpenWrt and not needed at runtime.

Compression and crypto backends are split into separate packages:
- kronosnet-compress-lz4, lz4hc, zlib, lzo2, lzma, bzip2, zstd
- kronosnet-crypto-nss: Mozilla NSS backend
- kronosnet-crypto-openssl: OpenSSL backend

Link: https://github.com/kronosnet/kronosnet
Signed-off-by: Sven Kirmess <sven.kirmess@kzone.ch>
Corosync provides cluster infrastructure including reliable messaging,
membership, and quorum.

Split into two packages:
- libcorosync: shared libraries only
- corosync: daemon and management tools, depends on libcorosync

Link: https://corosync.github.io/corosync/
Signed-off-by: Sven Kirmess <sven.kirmess@kzone.ch>
corosync-qnetd is a daemon providing an external quorum vote for
Corosync clusters, allowing a 2-node cluster to maintain quorum when
one node fails. Commonly used with Proxmox VE clusters.

Only the qnetd server side is built (--disable-qdevices); the qdevice
client side is meant to run on the cluster nodes, not on the qnetd
host.

Includes two patches for musl/busybox compatibility:
- add a --with-bash=PATH configure option, since AC_PATH_PROG picks up
  the build host's bash instead of the target's during cross-compilation
- fix corosync-qnetd-certutil for busybox (chown, sha256sum, urandom)

Link: https://github.com/corosync/corosync-qdevice
Signed-off-by: Sven Kirmess <sven.kirmess@kzone.ch>
@skirmess
skirmess force-pushed the add-corosync-qdevice branch from 85023e1 to ba3385b Compare July 27, 2026 19:15
@skirmess

Copy link
Copy Markdown
Author

Thanks for the thorough review. Addressed all of it:

  • Commit message accuracy: reworded the corosync-qdevice commit message — the --with-bash patch was mischaracterized as a shebang-path fix; it actually adds a --with-bash=PATH configure option.

  • libs/libqb/test.shtest-version.sh: confirmed against the current CONTRIBUTING.md that test.sh runs in addition to generic tests and does not override them — only test-version.sh does that. Since libqb ships no executable, switched to test-version.sh following the libs/expat pattern (exit 0 for the library package).

  • net/corosync-qdevice scope: added --disable-qdevices to CONFIGURE_ARGS so the qdevice client (corosync-qdevice, corosync-qdevice-tool, corosync-qdevice-net-certutil) is no longer built at all — this package is qnetd-server-only, matching its title/description. Package/install now lists only corosync-qnetd, corosync-qnetd-tool, and corosync-qnetd-certutil explicitly instead of a wildcard. Build/InstallDev now only installs the .pc file, since nothing links against this leaf package (same change already applied to net/corosync after earlier feedback).

  • NSS DB on baked images: added an /etc/uci-defaults/corosync-qdevice script that performs the same first-run CA init check on first boot, covering the ImageBuilder/IPKG_INSTROOT case that postinst skips. Also guarded the postinst call with || true so a certutil failure no longer leaves the package unconfigured.

  • patches/0002-initialize-ca.patch: removed the dead code left behind by the unconditional early return (the function body is now just a no-op comment), replaced the ps -elf/w-based entropy source with /dev/urandom (verified that ps w's required BusyBox feature, FEATURE_PS_WIDE, is disabled when BUSYBOX_CONFIG_DESKTOP=y, which would have silently degraded the noise file to a predictable date-only seed), and added a Signed-off-by line.

  • Redundant PKG_BUILD_DEPENDS: removed from net/corosync and net/corosync-qdevice, same reasoning as the earlier net/kronosnet cleanup — already covered by the subpackage DEPENDS chain (libcorosync+kronosnet +libqb, corosync-qdevice+libcorosync).

  • net/kronosnet SECTION/CATEGORY: changed from net/Network to libs/Libraries for consistency with libcorosync, which is an equally library-only package.

One thing this review caught that's worth calling out: while checking the PKG_BUILD_DEPENDS removal, a clean from-scratch build (all four packages purged, then building only corosync-qdevice and letting the dependency graph pull everything in) failed — kronosnet's configure does PKG_CHECK_MODULES([libqb], [libqb]) for header-only use (confirmed libknet.so doesn't link against libqb at runtime via readelf -d), but net/kronosnet/Makefile never declared this anywhere after an earlier review round removed its PKG_BUILD_DEPENDS entirely. This only ever worked before because of the manual build order in our own docs, not because the dependency was actually declared correctly. Restored PKG_BUILD_DEPENDS:=libqb for kronosnet (build-time only, not DEPENDS, since there's no runtime linkage) and verified with the same from-scratch dependency-graph build that it now resolves correctly on its own.

@openwrt-ai openwrt-ai left a comment

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.

Reviewed the 4 rebased commits (diff against 85023e1b, the head of my last review). Commit messages match their contents this round — the corosync-qdevice message now describes the --with-bash=PATH configure option correctly, and the --disable-qdevices / /dev/urandom changes are reflected. Both net/corosync-qdevice patches apply to the 3.0.4 tarball cleanly with no fuzz or offset. Findings are inline.


Generated by Claude Code

CATEGORY:=Network
TITLE:=Corosync QNetd - quorum device daemon
URL:=https://github.com/corosync/corosync-qdevice
DEPENDS:=+libcorosync +libnss +nss-utils +bash

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.

With --disable-qdevices now set, the only things built are corosync-qnetd, corosync-qnetd-tool and the corosync-qnetd-certutil shell script — and none of them link against corosync. In the 3.0.4 tarball, qdevices/Makefile.am:86-87 has corosync_qnetd_CFLAGS/LDADD = $(nss_CFLAGS)/$(nss_LIBS) plus libsystemd only, corosync_qnetd_tool has no LDADD at all, and the cmap/votequorum/corosync_common pkg-config variables are referenced exclusively by corosync_qdevice_CFLAGS/LDADD (Makefile.am:157-160), which is now inside the disabled BUILD_QDEVICES conditional. None of the qnetd sources include corosync/* or qb/* headers either.

So +libcorosync looks like it now only pulls libcorosync → kronosnet → libqb → libnl onto the device at runtime for nothing, which matches the commit message ("the qdevice client side is meant to run on the cluster nodes, not on the qnetd host").

Note this can't just be deleted: configure.ac:100-102 still does PKG_CHECK_MODULES for libcorosync_common/libcmap/libvotequorum unconditionally, so the corosync headers are still needed at build time — dropping it from DEPENDS means bringing back PKG_BUILD_DEPENDS:=corosync, which this commit removes. Is the runtime dependency intentional?


Generated by Claude Code

Comment on lines +59 to +64
define Package/corosync-qdevice/postinst
#!/bin/sh
if [ -z "$${IPKG_INSTROOT}" ] && [ ! -f "/etc/corosync/qnetd/nssdb/cert9.db" ]; then
/usr/bin/corosync-qnetd-certutil -i || true
fi
endef

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: with the uci-defaults script added, this block is now unreachable in practice. default_postinst executes the package's /etc/uci-defaults/ entries (and rms them) before it sources postinst-pkg — see functions.sh:384-398, wired up by package-pack.mk:546-547. So on a live install the uci-defaults script has already created cert9.db by the time this runs, and on a baked image the IPKG_INSTROOT guard skips it anyway. The uci-defaults script covers both paths on its own; keeping two copies of the same check just means two places to update.


Generated by Claude Code


case "$1" in
corosync-qdevice)
corosync-qnetd -v 2>&1 | grep -F "$2"

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.

This one still has the problem you fixed for libs/libqb: test.sh runs in addition to the generic tests, it doesn't replace them — only test-version.sh makes "the generic version detection … skipped entirely".

The generic probe is exactly what failed for this package in the CI run you linked earlier (corosync-qdevice: No executables in the package provided version 3.0.4 / Generic tests failed), and nothing since then changes that: corosync-qnetd only accepts the short flag — getopt(argc, argv, "46dfhvc:l:m:p:S:s:") in qdevices/corosync-qnetd.c, no long_options table — so a generic --version/-V probe still comes back empty, and -h/unknown options print usage without the version string. corosync-qnetd-tool and corosync-qnetd-certutil don't report a version at all.

Renaming this to test-version.sh and switching to the env-var interface (case "$PKG_NAME" / grep -F "$PKG_VERSION" instead of $1/$2) is what actually silences the generic check.


Generated by Claude Code

# shellcheck shell=busybox

case "$PKG_NAME" in
libqb)

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: parity — if libqb needs this because it ships no executable, the same is true of libcorosync (net/corosync/Makefile, Package/libcorosync/install ships only lib*.so.*), kronosnet, and the nine kronosnet-compress-* / kronosnet-crypto-* plugin subpackages, none of which have a test.sh or test-version.sh in this PR. Is the generic check known to pass for those (e.g. it skips packages with zero executables, which would make this file unnecessary too), or were they just not hit in CI yet?


Generated by Claude Code

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants