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
Copy link
Copy Markdown

@skirmess skirmess commented Apr 28, 2026

📦 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
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

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
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
Copy link
Copy Markdown
Member

@BKPepe BKPepe left a comment

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
Copy link
Copy Markdown
Author

skirmess commented May 8, 2026

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
Copy link
Copy Markdown
Author

skirmess commented May 9, 2026

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?

Copy link
Copy Markdown
Author

@skirmess skirmess May 10, 2026

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
Comment on lines +1 to +11
From: Sven Kirmess <sven.kirmess@kzone.ch>
Date: Fri, 8 May 2026 00:00:00 +0200
Subject: [PATCH] configure: remove libxml2 build dependency

libxml2 is only needed by the doxygen2man tool to generate man pages.
When cross-compiling, doxygen2man is not built from source, so libxml2
is not required. Remove the PKG_CHECK_MODULES call to eliminate libxml2
as a build dependency.

--- a/configure.ac
+++ b/configure.ac
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 please use the latest version of this patch from ClusterLabs/libqb#515 ? Just append .patch to the end of the URL.

Comment thread net/kronosnet/Makefile Outdated
PKG_FIXUP:=autoreconf
PKG_INSTALL:=1

PKG_BUILD_DEPENDS:=zstd liblz4 lzo xz bzip2 nss openssl libqb libnl
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.

Do you need to explicitly specify this if it is already in depends?

Comment thread net/corosync/Makefile Outdated
Comment on lines +70 to +72
$(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
Member

Choose a reason for hiding this comment

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

Do we really need to copy everything? We're losing control over what actually ends up in the package.

skirmess added 3 commits May 21, 2026 20:04
libqb provides high-performance, reusable features for client/server
architecture, including IPC, logging, and ringbuffer. Used by Corosync
and other cluster software.

Includes patches to remove libxml2 dependency, which was only required
for doxygen2man man page generation and 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.

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>
@skirmess skirmess force-pushed the add-corosync-qdevice branch 2 times, most recently from 901a012 to c3b2aab Compare May 21, 2026 20:03
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.

Includes two patches for musl/busybox compatibility:
- fix bash shebang path
- fix corosync-qnetd-certutil for busybox (ps, sha256sum, chown)

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 c3b2aab to ae058ab Compare May 21, 2026 20:14
@skirmess
Copy link
Copy Markdown
Author

Addressed all review feedback:

  • libs/libqb: Replaced the two OpenWrt-specific patches with the upstream patch from configure: add --disable-man option ClusterLabs/libqb#515 (now merged). Added CONFIGURE_ARGS += --disable-man to the Makefile.

  • net/kronosnet: Removed PKG_BUILD_DEPENDS — all needed packages are already listed in the subpackage DEPENDS.

  • net/corosync: Explicitly listed all binaries in Package/corosync/install instead of using *. Removed the binary install from Build/InstallDev — dependent packages only need headers, libraries, and .pc files from the staging directory.

  • net/corosync-qdevice: Replaced 0001-bash-path.patch with the upstream patch from configure: add --with-bash option for cross-compilation corosync/corosync-qdevice#40 (accepted). Added CONFIGURE_ARGS += --with-bash=/bin/bash to the Makefile. Fixed the patch header and restored sha1sum (the sha256sum change was unnecessary since sha1sum is available on OpenWrt).

@skirmess skirmess requested a review from BKPepe May 21, 2026 20:18
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.

5 participants