-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Add corosync qdevice #29269
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Add corosync qdevice #29269
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,51 @@ | ||
| # Copyright (C) 2025-2026 S Shaikh <sshaikh@hotmail.com> | ||
| # Copyright (C) 2026 Sven Kirmess <sven.kirmess@kzone.ch> | ||
|
|
||
| include $(TOPDIR)/rules.mk | ||
|
|
||
| PKG_NAME:=libqb | ||
| PKG_VERSION:=2.0.10 | ||
| 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:=326a69fb5b2ee4479f0db4f98d10d670ad0798b5ded8c4cfd585b765fd8941e8 | ||
| PKG_FIXUP:=autoreconf | ||
| PKG_INSTALL:=1 | ||
|
|
||
| PKG_MAINTAINER:=S Shaikh <sshaikh@hotmail.com>, Sven Kirmess <sven.kirmess@kzone.ch> | ||
| 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 | ||
|
|
||
| CONFIGURE_ARGS += --disable-man | ||
|
|
||
| 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 | ||
| $(CP) $(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 | ||
| $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib*.so.* $(1)/usr/lib/ | ||
| endef | ||
|
|
||
| $(eval $(call BuildPackage,libqb)) | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| #!/bin/sh | ||
|
|
||
| # shellcheck shell=busybox | ||
|
|
||
| case "$PKG_NAME" in | ||
| libqb) | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: parity — if Generated by Claude Code |
||
| # Shared libraries, no executable to check | ||
| exit 0 | ||
| ;; | ||
|
|
||
| *) | ||
| echo "Untested package: $PKG_NAME" >&2 | ||
| exit 1 | ||
| ;; | ||
| esac | ||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,66 @@ | ||||||||||||||||||||||||||
| # Copyright (C) 2025-2026 S Shaikh <sshaikh@hotmail.com> | ||||||||||||||||||||||||||
| # Copyright (C) 2026 Sven Kirmess <sven.kirmess@kzone.ch> | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| 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_MAINTAINER:=S Shaikh <sshaikh@hotmail.com>, Sven Kirmess <sven.kirmess@kzone.ch> | ||||||||||||||||||||||||||
| 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 | ||||||||||||||||||||||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. With So Note this can't just be deleted: Generated by Claude Code |
||||||||||||||||||||||||||
| 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 | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| CONFIGURE_ARGS += \ | ||||||||||||||||||||||||||
| --with-bash=/bin/bash \ | ||||||||||||||||||||||||||
| --disable-qdevices | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| define Build/InstallDev | ||||||||||||||||||||||||||
| $(INSTALL_DIR) $(1)/usr/share/pkgconfig | ||||||||||||||||||||||||||
| $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/pkgconfig/corosync-qdevice.pc $(1)/usr/share/pkgconfig | ||||||||||||||||||||||||||
|
skirmess marked this conversation as resolved.
|
||||||||||||||||||||||||||
| endef | ||||||||||||||||||||||||||
|
Comment on lines
+43
to
+46
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Generated by Claude Code |
||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| define Package/corosync-qdevice/install | ||||||||||||||||||||||||||
| $(INSTALL_DIR) $(1)/usr/bin | ||||||||||||||||||||||||||
| $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/corosync-qnetd $(1)/usr/bin/ | ||||||||||||||||||||||||||
| $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/corosync-qnetd-tool $(1)/usr/bin/ | ||||||||||||||||||||||||||
| $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/corosync-qnetd-certutil $(1)/usr/bin/ | ||||||||||||||||||||||||||
| $(INSTALL_DIR) $(1)/etc/init.d | ||||||||||||||||||||||||||
| $(INSTALL_BIN) ./files/corosync-qdevice.init $(1)/etc/init.d/corosync-qdevice | ||||||||||||||||||||||||||
| $(INSTALL_DIR) $(1)/etc/uci-defaults | ||||||||||||||||||||||||||
| $(INSTALL_DATA) ./files/corosync-qdevice.uci-defaults $(1)/etc/uci-defaults/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 || true | ||||||||||||||||||||||||||
| fi | ||||||||||||||||||||||||||
| endef | ||||||||||||||||||||||||||
|
Comment on lines
+59
to
+64
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 / Two options that cover both install paths: install an Separately, the script's exit status is Generated by Claude Code
Comment on lines
+59
to
+64
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. Generated by Claude Code |
||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| $(eval $(call BuildPackage,corosync-qdevice)) | ||||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| #!/bin/sh /etc/rc.common | ||
|
|
||
| START=99 | ||
| STOP=99 | ||
| USE_PROCD=1 | ||
|
|
||
| start_service() { | ||
| procd_open_instance | ||
| procd_set_param command /usr/bin/corosync-qnetd -f | ||
|
skirmess marked this conversation as resolved.
|
||
| procd_set_param respawn | ||
| procd_close_instance | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| #!/bin/sh | ||
|
|
||
| [ -f /etc/corosync/qnetd/nssdb/cert9.db ] || /usr/bin/corosync-qnetd-certutil -i | ||
|
|
||
| exit 0 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| From 9946ee9e065dbcaddc3b5a0b33859a25569b1526 Mon Sep 17 00:00:00 2001 | ||
| From: Sven Kirmess <sven.kirmess@kzone.ch> | ||
| Date: Fri, 8 May 2026 10:17:15 +0200 | ||
| Subject: [PATCH] configure: add --with-bash option | ||
|
|
||
| ... for cross-compilation | ||
|
|
||
| AC_PATH_PROG finds bash on the build host, which differs from the | ||
| target system path in cross-compilation environments. Add | ||
| --with-bash=PATH to allow explicitly specifying the bash path on | ||
| the target system. | ||
|
|
||
| When not specified, the existing auto-detection behaviour is | ||
| unchanged. | ||
|
|
||
| Signed-off-by: Sven Kirmess <sven.kirmess@kzone.ch> | ||
| Reviewed-by: Jan Friesse <jfriesse@redhat.com> | ||
| --- | ||
| configure.ac | 6 +++++- | ||
| 1 file changed, 5 insertions(+), 1 deletion(-) | ||
|
|
||
| --- a/configure.ac | ||
| +++ b/configure.ac | ||
| @@ -79,7 +79,11 @@ AC_PROG_LN_S | ||
| AC_PROG_INSTALL | ||
| AC_PROG_MAKE_SET | ||
| PKG_PROG_PKG_CONFIG | ||
| -AC_PATH_PROG([BASHPATH], [bash]) | ||
| +AC_ARG_WITH([bash], | ||
| + [AS_HELP_STRING([--with-bash=PATH], | ||
| + [path to bash on the target system @<:@default=auto-detect@:>@])], | ||
| + [BASHPATH="$withval"], | ||
| + [AC_PATH_PROG([BASHPATH], [bash])]) | ||
| AC_CHECK_PROGS([GROFF], [groff]) | ||
|
|
||
| # Checks for typedefs. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| From 2d1989d27da618a40e6340c7c9ffe8708f1cc067 Mon Sep 17 00:00:00 2001 | ||
| From: Sven Kirmess <sven.kirmess@kzone.ch> | ||
| Date: Fri, 8 May 2026 00:00:00 +0200 | ||
| Subject: [PATCH] fix CA initialization for musl/busybox compatibility | ||
|
|
||
| - chown --reference=: GNU coreutils only, not available in Busybox; the | ||
| target directory is always owned by root on OpenWrt, so this is a no-op | ||
| - ps -elf / w: GNU ps flags and the w command are not available on | ||
| Busybox/OpenWrt; seed the noise file from /dev/urandom instead | ||
| - sha1sum: not compiled into Busybox by default; use sha256sum which is | ||
| available in Busybox by default instead | ||
|
|
||
| Signed-off-by: Sven Kirmess <sven.kirmess@kzone.ch> | ||
| --- | ||
| qdevices/corosync-qnetd-certutil.sh | 6 ++---- | ||
| 1 file changed, 2 insertions(+), 4 deletions(-) | ||
|
|
||
| --- a/qdevices/corosync-qnetd-certutil.sh | ||
| +++ b/qdevices/corosync-qnetd-certutil.sh | ||
| @@ -62,9 +62,7 @@ usage() { | ||
| } | ||
|
|
||
| chown_ref_cfgdir() { | ||
| - if [ "$UID" == "0" ];then | ||
| - chown --reference="$CONFIG_DIR" "$@" 2>/dev/null || chown "$(stat -f "%u:%g" "$CONFIG_DIR")" "$@" 2>/dev/null || return $? | ||
| - fi | ||
| + : # All files owned by root on OpenWrt, nothing to do | ||
| } | ||
|
|
||
| # get_perm [directory] | ||
| @@ -83,7 +81,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" | ||
| + dd if=/dev/urandom bs=1024 count=1 2>/dev/null | sha256sum | (read sha_sum rest; echo $sha_sum) > "$noise_file" | ||
|
|
||
| chown_ref_cfgdir "$noise_file" | ||
| chmod "$(get_perm)" "$noise_file" |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| #!/bin/sh | ||
|
|
||
| case "$1" in | ||
| corosync-qdevice) | ||
| corosync-qnetd -v 2>&1 | grep -F "$2" | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is done by the generic tests already. Was this not working?
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is the error from CI: But only libqb and corosync-qdevice had a failure. I've removed the two test.sh files that weren't needed.
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This one still has the problem you fixed for The generic probe is exactly what failed for this package in the CI run you linked earlier ( Renaming this to Generated by Claude Code |
||
| ;; | ||
| esac | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,74 @@ | ||
| # Copyright (C) 2025-2026 S Shaikh <sshaikh@hotmail.com> | ||
| # Copyright (C) 2026 Sven Kirmess <sven.kirmess@kzone.ch> | ||
|
|
||
| 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_MAINTAINER:=S Shaikh <sshaikh@hotmail.com>, Sven Kirmess <sven.kirmess@kzone.ch> | ||
| 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 | ||
| $(CP) $(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/libcorosync/install | ||
| $(INSTALL_DIR) $(1)/usr/lib | ||
| $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib*.so.* $(1)/usr/lib/ | ||
| endef | ||
|
|
||
| define Package/corosync/install | ||
| $(INSTALL_DIR) $(1)/usr/sbin | ||
| $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/corosync $(1)/usr/sbin/ | ||
| $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/corosync-cfgtool $(1)/usr/sbin/ | ||
| $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/corosync-cmapctl $(1)/usr/sbin/ | ||
| $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/corosync-cpgtool $(1)/usr/sbin/ | ||
| $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/corosync-keygen $(1)/usr/sbin/ | ||
| $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/corosync-notifyd $(1)/usr/sbin/ | ||
| $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/corosync-quorumtool $(1)/usr/sbin/ | ||
| endef | ||
|
|
||
| $(eval $(call BuildPackage,libcorosync)) | ||
| $(eval $(call BuildPackage,corosync)) |
Uh oh!
There was an error while loading. Please reload this page.