-
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
Open
skirmess
wants to merge
4
commits into
openwrt:master
Choose a base branch
from
skirmess:add-corosync-qdevice
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Add corosync qdevice #29269
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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.9 | ||
| PKG_RELEASE:=1 | ||
|
|
||
| PKG_SOURCE:=libqb-$(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 <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 | ||
|
|
||
| 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)) | ||
39 changes: 39 additions & 0 deletions
39
libs/libqb/patches/0001-configure-remove-libxml2-dependency.patch
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| --- 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]) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| --- 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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:=corosync-qdevice-$(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 <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 | ||
| 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 | ||
|
skirmess marked this conversation as resolved.
|
||
| $(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 | ||
|
skirmess marked this conversation as resolved.
|
||
| fi | ||
| endef | ||
|
|
||
| $(eval $(call BuildPackage,corosync-qdevice)) | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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 | ||
|
skirmess marked this conversation as resolved.
|
||
| procd_set_param respawn | ||
| procd_close_instance | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| --- 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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| --- 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" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,76 @@ | ||
| # 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:=corosync-$(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 <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 | ||
| $(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)) |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.