From aee5a5d31cc4db81c31472af54998c7d55a31504 Mon Sep 17 00:00:00 2001 From: Sven Kirmess Date: Wed, 29 Apr 2026 11:39:30 +0200 Subject: [PATCH 1/4] libs/libqb: add libqb 2.0.9 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 --- libs/libqb/Makefile | 51 +++++++++++++++++++ ...-configure-remove-libxml2-dependency.patch | 48 +++++++++++++++++ .../0002-makefile-remove-doxygen2man.patch | 19 +++++++ 3 files changed, 118 insertions(+) create mode 100644 libs/libqb/Makefile create mode 100644 libs/libqb/patches/0001-configure-remove-libxml2-dependency.patch create mode 100644 libs/libqb/patches/0002-makefile-remove-doxygen2man.patch diff --git a/libs/libqb/Makefile b/libs/libqb/Makefile new file mode 100644 index 00000000000000..9703177ac1d496 --- /dev/null +++ b/libs/libqb/Makefile @@ -0,0 +1,51 @@ +# Copyright (C) 2025-2026 S Shaikh +# Copyright (C) 2026 Sven Kirmess + +include $(TOPDIR)/rules.mk + +PKG_NAME:=libqb +PKG_VERSION:=2.0.9 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz +PKG_SOURCE_URL:=https://github.com/ClusterLabs/libqb/releases/download/v$(PKG_VERSION)/ +PKG_HASH:=61a83753199c86a47a69f615778e81b56ac0a58d07751230444e76500b6b210b +PKG_FIXUP:=autoreconf +PKG_INSTALL:=1 + +PKG_MAINTAINER:=S Shaikh , Sven Kirmess +PKG_LICENSE:=LGPL-2.1-or-later +PKG_LICENSE_FILES:=COPYING + +include $(INCLUDE_DIR)/package.mk + +define Package/libqb + SECTION:=libs + CATEGORY:=Libraries + TITLE:=High performance client server reusable library + URL:=https://github.com/ClusterLabs/libqb +endef + +define Package/libqb/description + libqb provides high-performance, reusable features for client/server + architecture, including IPC, logging, and ringbuffer. Used by Corosync + and other cluster software. +endef + +define Build/InstallDev + $(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/ + $(INSTALL_DIR) $(1)/usr/lib/pkgconfig + $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/*.pc $(1)/usr/lib/pkgconfig +endef + +define Package/libqb/install + $(INSTALL_DIR) $(1)/usr/lib + $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/lib*.so.* $(1)/usr/lib/ + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/qb-blackbox $(1)/usr/sbin/ +endef + +$(eval $(call BuildPackage,libqb)) diff --git a/libs/libqb/patches/0001-configure-remove-libxml2-dependency.patch b/libs/libqb/patches/0001-configure-remove-libxml2-dependency.patch new file mode 100644 index 00000000000000..2545b406a2d228 --- /dev/null +++ b/libs/libqb/patches/0001-configure-remove-libxml2-dependency.patch @@ -0,0 +1,48 @@ +From: Sven Kirmess +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 +@@ -177,23 +177,12 @@ if test x"$have_glib" = xyes; then + AC_DEFINE_UNQUOTED([HAVE_GLIB], [1], [We have glib]) + fi + +-# For building doxygen2man and man pages +-PKG_CHECK_MODULES([libxml], [libxml-2.0]) +- +-# if we are not cross-compiling, we can use the locally built +-# version of doxygen2man, otherwise we can look for +-# a locally installed version. If neither are usable, then +-# don“t build the man pages +-if test "x$cross_compiling" = "xno"; then +- AM_CONDITIONAL([BUILD_MAN], [true]) +- DOXYGEN2MAN="\$(abs_builddir)/../doxygen2man/doxygen2man" ++# Build man pages using local doxygen2man (avoids need for libxml2 at runtime) ++AC_CHECK_PROGS([DOXYGEN2MAN], [doxygen2man]) ++if test "x$DOXYGEN2MAN" = "x"; then ++ AM_CONDITIONAL([BUILD_MAN], [false]) + else +- AC_CHECK_PROGS([DOXYGEN2MAN], [doxygen2man]) +- if test "x$DOXYGEN2MAN" = "x"; then +- AM_CONDITIONAL([BUILD_MAN], [false]) +- else +- AM_CONDITIONAL([BUILD_MAN], [true]) +- fi ++ AM_CONDITIONAL([BUILD_MAN], [true]) + fi + AC_SUBST(DOXYGEN2MAN) + +@@ -861,7 +850,6 @@ AC_CONFIG_FILES([Makefile + tests/Makefile + tests/test.conf + examples/Makefile +- doxygen2man/Makefile + docs/Makefile + docs/man.dox + lib/qblog_script.la:lib/qblog_script.la.in]) diff --git a/libs/libqb/patches/0002-makefile-remove-doxygen2man.patch b/libs/libqb/patches/0002-makefile-remove-doxygen2man.patch new file mode 100644 index 00000000000000..84b9060d8af7f2 --- /dev/null +++ b/libs/libqb/patches/0002-makefile-remove-doxygen2man.patch @@ -0,0 +1,19 @@ +From: Sven Kirmess +Date: Fri, 8 May 2026 00:00:00 +0200 +Subject: [PATCH] Makefile.am: remove doxygen2man from SUBDIRS + +doxygen2man is a host tool used only for generating man pages and is +not needed when cross-compiling. Remove it from SUBDIRS to avoid build +failures in cross-compile environments. + +--- a/Makefile.am ++++ b/Makefile.am +@@ -39,7 +39,7 @@ ACLOCAL_AMFLAGS = -I m4 + + dist_doc_DATA = COPYING INSTALL README.markdown + +-SUBDIRS = include lib doxygen2man docs tools examples ++SUBDIRS = include lib docs tools examples + + if ENABLE_TESTS + SUBDIRS += tests From 43d2f297f3d893013bf6ed2922c1bfe580ca75cd Mon Sep 17 00:00:00 2001 From: Sven Kirmess Date: Wed, 29 Apr 2026 11:39:37 +0200 Subject: [PATCH 2/4] net/kronosnet: add kronosnet 1.33 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 --- net/kronosnet/Makefile | 225 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 225 insertions(+) create mode 100644 net/kronosnet/Makefile diff --git a/net/kronosnet/Makefile b/net/kronosnet/Makefile new file mode 100644 index 00000000000000..416cbaff95f6ed --- /dev/null +++ b/net/kronosnet/Makefile @@ -0,0 +1,225 @@ +# Copyright (C) 2025-2026 S Shaikh +# Copyright (C) 2026 Sven Kirmess + +include $(TOPDIR)/rules.mk + +PKG_NAME:=kronosnet +PKG_VERSION:=1.33 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz +PKG_SOURCE_URL:=https://github.com/kronosnet/kronosnet/releases/download/v$(PKG_VERSION)/ +PKG_HASH:=7c386a8aaaa3aece727eec3e1a51217a97f4af36cca28c8ea2fb2280b09edd6e +PKG_FIXUP:=autoreconf +PKG_INSTALL:=1 + +PKG_BUILD_DEPENDS:=zstd liblz4 lzo xz bzip2 nss openssl libqb libnl + +PKG_MAINTAINER:=S Shaikh , Sven Kirmess +PKG_LICENSE:=LGPL-2.1-or-later +PKG_LICENSE_FILES:=COPYING.libraries + +include $(INCLUDE_DIR)/package.mk + +define Package/kronosnet + SECTION:=net + CATEGORY:=Network + TITLE:=kronosnet - multipoint-to-multipoint network link aggregation + URL:=https://github.com/kronosnet/kronosnet + DEPENDS:=+libnl +endef + +define Package/kronosnet/description + 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. +endef + +define Package/kronosnet-compress-lz4 + SECTION:=net + CATEGORY:=Network + TITLE:=kronosnet LZ4 compression backend + URL:=https://github.com/kronosnet/kronosnet + DEPENDS:=+kronosnet +liblz4 +endef + +define Package/kronosnet-compress-lz4/description + LZ4 compression backend plugin for kronosnet. +endef + +define Package/kronosnet-compress-lz4hc + SECTION:=net + CATEGORY:=Network + TITLE:=kronosnet LZ4HC compression backend + URL:=https://github.com/kronosnet/kronosnet + DEPENDS:=+kronosnet +liblz4 +endef + +define Package/kronosnet-compress-lz4hc/description + LZ4HC compression backend plugin for kronosnet. +endef + +define Package/kronosnet-compress-zlib + SECTION:=net + CATEGORY:=Network + TITLE:=kronosnet zlib compression backend + URL:=https://github.com/kronosnet/kronosnet + DEPENDS:=+kronosnet +zlib +endef + +define Package/kronosnet-compress-zlib/description + zlib compression backend plugin for kronosnet. +endef + +define Package/kronosnet-compress-lzo2 + SECTION:=net + CATEGORY:=Network + TITLE:=kronosnet LZO compression backend + URL:=https://github.com/kronosnet/kronosnet + DEPENDS:=+kronosnet +liblzo +endef + +define Package/kronosnet-compress-lzo2/description + LZO compression backend plugin for kronosnet. +endef + +define Package/kronosnet-compress-lzma + SECTION:=net + CATEGORY:=Network + TITLE:=kronosnet LZMA compression backend + URL:=https://github.com/kronosnet/kronosnet + DEPENDS:=+kronosnet +liblzma +endef + +define Package/kronosnet-compress-lzma/description + LZMA compression backend plugin for kronosnet. +endef + +define Package/kronosnet-compress-bzip2 + SECTION:=net + CATEGORY:=Network + TITLE:=kronosnet bzip2 compression backend + URL:=https://github.com/kronosnet/kronosnet + DEPENDS:=+kronosnet +bzip2 +endef + +define Package/kronosnet-compress-bzip2/description + bzip2 compression backend plugin for kronosnet. +endef + +define Package/kronosnet-compress-zstd + SECTION:=net + CATEGORY:=Network + TITLE:=kronosnet Zstandard compression backend + URL:=https://github.com/kronosnet/kronosnet + DEPENDS:=+kronosnet +libzstd +endef + +define Package/kronosnet-compress-zstd/description + Zstandard compression backend plugin for kronosnet. +endef + +define Package/kronosnet-crypto-nss + SECTION:=net + CATEGORY:=Network + TITLE:=kronosnet NSS crypto backend + URL:=https://github.com/kronosnet/kronosnet + DEPENDS:=+kronosnet +libnss +nspr +endef + +define Package/kronosnet-crypto-nss/description + NSS crypto backend plugin for kronosnet. Required for encrypted + Corosync cluster communication using Mozilla NSS. +endef + +define Package/kronosnet-crypto-openssl + SECTION:=net + CATEGORY:=Network + TITLE:=kronosnet OpenSSL crypto backend + URL:=https://github.com/kronosnet/kronosnet + DEPENDS:=+kronosnet +libopenssl +endef + +define Package/kronosnet-crypto-openssl/description + OpenSSL crypto backend plugin for kronosnet. Required for encrypted + Corosync cluster communication using OpenSSL. +endef + +CONFIGURE_ARGS += \ + --disable-man \ + --disable-hardening \ + --enable-crypto-nss \ + --enable-crypto-openssl + +define Build/InstallDev + $(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/ + $(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 +endef + +define Package/kronosnet/install + $(INSTALL_DIR) $(1)/usr/lib + $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/lib*.so.* $(1)/usr/lib/ +endef + +define Package/kronosnet-compress-lz4/install + $(INSTALL_DIR) $(1)/usr/lib/kronosnet + $(CP) $(PKG_INSTALL_DIR)/usr/lib/kronosnet/compress_lz4.so $(1)/usr/lib/kronosnet/ +endef + +define Package/kronosnet-compress-lz4hc/install + $(INSTALL_DIR) $(1)/usr/lib/kronosnet + $(CP) $(PKG_INSTALL_DIR)/usr/lib/kronosnet/compress_lz4hc.so $(1)/usr/lib/kronosnet/ +endef + +define Package/kronosnet-compress-zlib/install + $(INSTALL_DIR) $(1)/usr/lib/kronosnet + $(CP) $(PKG_INSTALL_DIR)/usr/lib/kronosnet/compress_zlib.so $(1)/usr/lib/kronosnet/ +endef + +define Package/kronosnet-compress-lzo2/install + $(INSTALL_DIR) $(1)/usr/lib/kronosnet + $(CP) $(PKG_INSTALL_DIR)/usr/lib/kronosnet/compress_lzo2.so $(1)/usr/lib/kronosnet/ +endef + +define Package/kronosnet-compress-lzma/install + $(INSTALL_DIR) $(1)/usr/lib/kronosnet + $(CP) $(PKG_INSTALL_DIR)/usr/lib/kronosnet/compress_lzma.so $(1)/usr/lib/kronosnet/ +endef + +define Package/kronosnet-compress-bzip2/install + $(INSTALL_DIR) $(1)/usr/lib/kronosnet + $(CP) $(PKG_INSTALL_DIR)/usr/lib/kronosnet/compress_bzip2.so $(1)/usr/lib/kronosnet/ +endef + +define Package/kronosnet-compress-zstd/install + $(INSTALL_DIR) $(1)/usr/lib/kronosnet + $(CP) $(PKG_INSTALL_DIR)/usr/lib/kronosnet/compress_zstd.so $(1)/usr/lib/kronosnet/ +endef + +define Package/kronosnet-crypto-nss/install + $(INSTALL_DIR) $(1)/usr/lib/kronosnet + $(CP) $(PKG_INSTALL_DIR)/usr/lib/kronosnet/crypto_nss.so $(1)/usr/lib/kronosnet/ +endef + +define Package/kronosnet-crypto-openssl/install + $(INSTALL_DIR) $(1)/usr/lib/kronosnet + $(CP) $(PKG_INSTALL_DIR)/usr/lib/kronosnet/crypto_openssl.so $(1)/usr/lib/kronosnet/ +endef + +$(eval $(call BuildPackage,kronosnet)) +$(eval $(call BuildPackage,kronosnet-compress-lz4)) +$(eval $(call BuildPackage,kronosnet-compress-lz4hc)) +$(eval $(call BuildPackage,kronosnet-compress-zlib)) +$(eval $(call BuildPackage,kronosnet-compress-lzo2)) +$(eval $(call BuildPackage,kronosnet-compress-lzma)) +$(eval $(call BuildPackage,kronosnet-compress-bzip2)) +$(eval $(call BuildPackage,kronosnet-compress-zstd)) +$(eval $(call BuildPackage,kronosnet-crypto-nss)) +$(eval $(call BuildPackage,kronosnet-crypto-openssl)) From 787aea24e075089f87d910f3049800885722421d Mon Sep 17 00:00:00 2001 From: Sven Kirmess Date: Wed, 29 Apr 2026 11:40:39 +0200 Subject: [PATCH 3/4] net/corosync: add corosync 3.1.10 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 --- net/corosync/Makefile | 76 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 76 insertions(+) create mode 100644 net/corosync/Makefile diff --git a/net/corosync/Makefile b/net/corosync/Makefile new file mode 100644 index 00000000000000..4b126574124d55 --- /dev/null +++ b/net/corosync/Makefile @@ -0,0 +1,76 @@ +# Copyright (C) 2025-2026 S Shaikh +# Copyright (C) 2026 Sven Kirmess + +include $(TOPDIR)/rules.mk + +PKG_NAME:=corosync +PKG_VERSION:=3.1.10 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=https://github.com/corosync/corosync/releases/download/v$(PKG_VERSION)/ +PKG_HASH:=be361c827f99b215b3bd3fa2fb071c03dac6831c2a351963d938caef62604bc8 +PKG_FIXUP:=autoreconf +PKG_INSTALL:=1 + +PKG_BUILD_DEPENDS:=libqb kronosnet + +PKG_MAINTAINER:=S Shaikh , Sven Kirmess +PKG_LICENSE:=BSD-3-Clause +PKG_LICENSE_FILES:=LICENSE + +include $(INCLUDE_DIR)/package.mk + +define Package/libcorosync + SECTION:=libs + CATEGORY:=Libraries + TITLE:=Corosync cluster libraries + URL:=https://corosync.github.io/corosync/ + DEPENDS:=+kronosnet +libqb +endef + +define Package/libcorosync/description + Shared libraries for Corosync cluster engine, including libcorosync_common, + libcfg, libcmap, libcpg, libquorum, libsam, and libvotequorum. +endef + +define Package/corosync + SECTION:=net + CATEGORY:=Network + TITLE:=Corosync cluster engine + URL:=https://corosync.github.io/corosync/ + DEPENDS:=+libcorosync +endef + +define Package/corosync/description + Corosync cluster engine daemon and management tools, providing reliable + messaging, membership, and quorum for high-availability clusters. +endef + +define Build/InstallDev + $(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/ + $(INSTALL_DIR) $(1)/usr/lib/pkgconfig + $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/*.pc $(1)/usr/lib/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 Package/libcorosync/install + $(INSTALL_DIR) $(1)/usr/lib + $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/lib*.so.* $(1)/usr/lib/ +endef + +define Package/corosync/install + $(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 + +$(eval $(call BuildPackage,libcorosync)) +$(eval $(call BuildPackage,corosync)) From 90f9a50a944a18535a13185cf8e67869a70223b9 Mon Sep 17 00:00:00 2001 From: Sven Kirmess Date: Wed, 29 Apr 2026 12:09:51 +0200 Subject: [PATCH 4/4] net/corosync-qdevice: add corosync-qdevice 3.0.4 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 --- net/corosync-qdevice/Makefile | 66 +++++++++++++++++++ .../files/corosync-qdevice.init | 15 +++++ .../patches/0001-bash-path.patch | 24 +++++++ .../patches/0002-initialize-ca.patch | 31 +++++++++ 4 files changed, 136 insertions(+) create mode 100644 net/corosync-qdevice/Makefile create mode 100644 net/corosync-qdevice/files/corosync-qdevice.init create mode 100644 net/corosync-qdevice/patches/0001-bash-path.patch create mode 100644 net/corosync-qdevice/patches/0002-initialize-ca.patch diff --git a/net/corosync-qdevice/Makefile b/net/corosync-qdevice/Makefile new file mode 100644 index 00000000000000..ccfbaa3e1f2751 --- /dev/null +++ b/net/corosync-qdevice/Makefile @@ -0,0 +1,66 @@ +# Copyright (C) 2025-2026 S Shaikh +# Copyright (C) 2026 Sven Kirmess + +include $(TOPDIR)/rules.mk + +PKG_NAME:=corosync-qdevice +PKG_VERSION:=3.0.4 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=https://github.com/corosync/corosync-qdevice/releases/download/v$(PKG_VERSION)/ +PKG_HASH:=c2821329ed1efd6bf8f82e2878f75ca66889439d27c788785fd0ccc972ac307c +PKG_FIXUP:=autoreconf +PKG_INSTALL:=1 + +PKG_BUILD_DEPENDS:=nss corosync + +PKG_MAINTAINER:=S Shaikh , Sven Kirmess +PKG_LICENSE:=BSD-3-Clause +PKG_LICENSE_FILES:=LICENSE + +include $(INCLUDE_DIR)/package.mk + +define Package/corosync-qdevice + SECTION:=net + CATEGORY:=Network + TITLE:=Corosync QNetd - quorum device daemon + URL:=https://github.com/corosync/corosync-qdevice + DEPENDS:=+libcorosync +libnss +nss-utils +bash +endef + +define Package/corosync-qdevice/description + corosync-qnetd daemon providing an additional vote to Corosync/Proxmox + clusters, allowing a 2-node cluster to maintain quorum when one node fails. + + NOTE: Proxmox VE users need openssh-sftp-server installed on this + OpenWrt device before running 'pvecm qdevice setup' on the Proxmox node. + It can be removed afterwards. +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 + $(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 Package/corosync-qdevice/install + $(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 + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/corosync-qdevice.init $(1)/etc/init.d/corosync-qdevice +endef + +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 + +$(eval $(call BuildPackage,corosync-qdevice)) diff --git a/net/corosync-qdevice/files/corosync-qdevice.init b/net/corosync-qdevice/files/corosync-qdevice.init new file mode 100644 index 00000000000000..c079805fac25a8 --- /dev/null +++ b/net/corosync-qdevice/files/corosync-qdevice.init @@ -0,0 +1,15 @@ +#!/bin/sh /etc/rc.common + +START=99 +STOP=99 +USE_PROCD=1 + +SERVICE_DAEMONIZE=1 +SERVICE_WRITE_PID=1 + +start_service() { + procd_open_instance + procd_set_param command /usr/bin/corosync-qnetd -f + procd_set_param respawn + procd_close_instance +} diff --git a/net/corosync-qdevice/patches/0001-bash-path.patch b/net/corosync-qdevice/patches/0001-bash-path.patch new file mode 100644 index 00000000000000..3ef0f89a615e68 --- /dev/null +++ b/net/corosync-qdevice/patches/0001-bash-path.patch @@ -0,0 +1,24 @@ +From: Sven Kirmess +Date: Fri, 8 May 2026 00:00:00 +0200 +Subject: [PATCH] fix bash shebang path for cross-compilation + +@BASHPATH@ is substituted with the build host's bash path during +configure, which differs from the target system path. Replace with +a fixed #!/bin/bash shebang that works correctly on the target. + +--- a/qdevices/corosync-qdevice-net-certutil.sh ++++ b/qdevices/corosync-qdevice-net-certutil.sh +@@ -1,4 +1,4 @@ +-#!@BASHPATH@ ++#!/bin/bash + + # + # Copyright (c) 2015-2018 Red Hat, Inc. +--- a/qdevices/corosync-qnetd-certutil.sh ++++ b/qdevices/corosync-qnetd-certutil.sh +@@ -1,4 +1,4 @@ +-#!@BASHPATH@ ++#!/bin/bash + + # + # Copyright (c) 2015-2018 Red Hat, Inc. diff --git a/net/corosync-qdevice/patches/0002-initialize-ca.patch b/net/corosync-qdevice/patches/0002-initialize-ca.patch new file mode 100644 index 00000000000000..03e4ce420cc8b4 --- /dev/null +++ b/net/corosync-qdevice/patches/0002-initialize-ca.patch @@ -0,0 +1,31 @@ +From: Sven Kirmess +Date: Fri, 8 May 2026 00:00:00 +0200 +Subject: [PATCH] fix CA initialization for musl/busybox compatibility + +Several GNU-specific tools and options are unavailable in OpenWrt's +busybox environment: +- chown --reference= is a GNU coreutils extension, not in busybox +- ps -elf uses GNU ps flags, busybox ps only supports a subset +- w is not available on OpenWrt +- sha1sum replaced with sha256sum for stronger hashing + +--- a/qdevices/corosync-qnetd-certutil.sh ++++ b/qdevices/corosync-qnetd-certutil.sh +@@ -62,6 +62,8 @@ usage() { + } + + chown_ref_cfgdir() { ++ # All files owned by root on OpenWrt ++ return + if [ "$UID" == "0" ];then + chown --reference="$CONFIG_DIR" "$@" 2>/dev/null || chown "$(stat -f "%u:%g" "$CONFIG_DIR")" "$@" 2>/dev/null || return $? + fi +@@ -83,7 +85,7 @@ create_new_noise_file() { + if [ ! -e "$noise_file" ];then + 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" + + chown_ref_cfgdir "$noise_file" + chmod "$(get_perm)" "$noise_file"