Subject: [alpine-aports] [PATCH 0/3] DRBD cluster suite update

From: Roland Kammerer <[email-masked]>
Date: Tue, 29 Dec 2015 16:07:33 +0100

Hi Alpine developers,

I'm one of the DRBD developers and I came across Apline Linux because I need a
lot of lightweight VMs for DRBD cluster/kernel development.

What I did:
- Update drbd-utils to the latest version. They nowadays compile fine without
a patch for musl libc. AFAIR we got a patch for that which I merged somewhere
around 8.9.4.

- Add a drbd9 kernel module. Is directly build-depending on linux-grsec-dev
okay? Or is there a concept of meta-packages like "linux-dev"?

- Add a python program for managing multi-node DRBD9 clusters. While it is a
client/server application, it does not contain an init-script by intention.
The server should get DBus activated. DBus is also a dependency of that
package, but is there a way to start/add the DBus service at install time? Is
this even desired?  For now, the user has to start/rc-update dbus manually. Is
that okay?

I tested the combination of the three packages in simple 2 node cluster setup
(separated VM from my build machine) and it worked as expected.

Besides that, I already merged back some of the patches currently required to
our internal repo (e.g., busybox mv patches), so we can get rid of them in the
next release. This is currently only in our internal repo and not visible in
the public git repos.

Regards, rck

Roland Kammerer (3):
  main/drbd-utils: upgrade to 8.9.5
  testing/drbd9: new aport
  testing/py-drbdmanage: new aport

 main/drbd-utils/APKBUILD                        | 12 ++----
 main/drbd-utils/bits_per_long.patch             | 22 ----------
 testing/drbd9/APKBUILD                          | 45 +++++++++++++++++++
 testing/drbd9/busybox-mv.patch                  |  8 ++++
 testing/py-drbdmanage/APKBUILD                  | 57 +++++++++++++++++++++++++
 testing/py-drbdmanage/path.patch                | 11 +++++
 testing/py-drbdmanage/rm-systemd-and-bash.patch | 15 +++++++
 7 files changed, 140 insertions(+), 30 deletions(-)
 delete mode 100644 main/drbd-utils/bits_per_long.patch
 create mode 100644 testing/drbd9/APKBUILD
 create mode 100644 testing/drbd9/busybox-mv.patch
 create mode 100644 testing/py-drbdmanage/APKBUILD
 create mode 100644 testing/py-drbdmanage/path.patch
 create mode 100644 testing/py-drbdmanage/rm-systemd-and-bash.patch

-- 
2.6.4

---
Unsubscribe:  [email-masked]
Help:         [email-masked]
---

---

From: Roland Kammerer <[email-masked]>
Date: Tue, 29 Dec 2015 16:07:34 +0100

- Upgrade to new upstream version.
- Remove musl specific bits_per_long patch, fixed upstream.
---
 main/drbd-utils/APKBUILD            | 12 ++++--------
 main/drbd-utils/bits_per_long.patch | 22 ----------------------
 2 files changed, 4 insertions(+), 30 deletions(-)
 delete mode 100644 main/drbd-utils/bits_per_long.patch

diff --git a/main/drbd-utils/APKBUILD b/main/drbd-utils/APKBUILD
index 252b159..f8b3243 100644
--- a/main/drbd-utils/APKBUILD
+++ b/main/drbd-utils/APKBUILD
@@ -1,7 +1,7 @@
 # Contributor: Leonardo Arena <[email-masked]>
 # Maintainer: Natanael Copa <[email-masked]>
 pkgname=drbd-utils
-pkgver=8.9.4
+pkgver=8.9.5
 pkgrel=0
 pkgdesc="Network-based RAID 1"
 url="http://www.drbd.org"
@@ -15,7 +15,6 @@ provides="drbd"
 subpackages="$pkgname-doc $pkgname-pacemaker"
 source="http://oss.linbit.com/drbd/drbd-utils-$pkgver.tar.gz
 	busybox-mv.patch
-	bits_per_long.patch
 	drbd.initd"

@@ -62,15 +61,12 @@ pacemaker() {
 	mv "$pkgdir"/usr/lib/ocf "$subpkgdir"/usr/lib
 }
 
-md5sums="8671f86d366288ea082ac1b4571eaa4d  drbd-utils-8.9.4.tar.gz
+md5sums="197b56c27df329d42c54efda56634e09  drbd-utils-8.9.5.tar.gz
 9bc7ecc7e6b336782f6a09c3366bf590  busybox-mv.patch
-504756f76c96c02439d39d73c6965cb5  bits_per_long.patch
 37a3e196fab9b4f568f79b3bfdee3081  drbd.initd"
-sha256sums="38929279d1bf549fd1ade4ce6773a6fe209db51bbb0efe7bf6d2b7871ba0afbc  drbd-utils-8.9.4.tar.gz
+sha256sums="2ca852d250df15089cdfe63c1bfb0aa9203bdf82c3cfd54b86108cc7135aeccd  drbd-utils-8.9.5.tar.gz
 ea7e76b4deb327c13b2efce7ed3b5a03440de3c721eb0565fd64bf99d34e6b24  busybox-mv.patch
-f6864221863adb6398f1278c0139dfaad05d9a049740b691c85a520c1b0cd10e  bits_per_long.patch
 9ea7427be45fc184cb4a74b6a7b0d688859d38c7a35a96c6c586dedaf4ce30df  drbd.initd"
-sha512sums="4a662921d8c823f3dfce5d0bfb58441231441929fd70447aad9b40f1d84aa9b82a93d034ef6db34b352902519042218000338927a1dfec46953bdb602d205a3b  drbd-utils-8.9.4.tar.gz
+sha512sums="3e391a42effa6906beac5a4eade24df23782f1f2717c7e49b4e70b84ca22890cd51e75d8fe5bed43324e33452d8fd1d6db3fd98bea12baf93cba49e9179ec0e2  drbd-utils-8.9.5.tar.gz
 22da5e241a6e33868ad91edb44ca51381a05909151a2e3f945efff1568903d415b77689231a6df5ff9c1e4b095d6a8bb82fc725336d65fb191036c7e97b2e3bb  busybox-mv.patch
-6d54d89c3f85ae8b1e49e05a6fcc7d88bd504c8e2614923c282c48bd6fa6fcbf704ee5c51d3ea809ba9cc5e1cc377da55ffe68d065a27f68e7ee15b6fe7d9d37  bits_per_long.patch
 bb465e32273aaba0b86ae681bc94c58bb51f542221f51ced197e22b316ce1bc9a0b4fe1f43af07ef13b3f0946466a43218f0a2ab7f4210adbb00174a503b64d7  drbd.initd"
diff --git a/main/drbd-utils/bits_per_long.patch b/main/drbd-utils/bits_per_long.patch
deleted file mode 100644
index f6b580e..0000000
--- a/main/drbd-utils/bits_per_long.patch
+++ /dev/null
@@ -1,22 +0,0 @@
-diff --git a/user/shared/drbd_endian.h b/user/shared/drbd_endian.h
-index 69f7145..515c942 100644
---- a/user/shared/drbd_endian.h
-+++ b/user/shared/drbd_endian.h
-@@ -13,12 +13,17 @@
- 
- #include <stdint.h>
- #include <endian.h>
-+#include <limits.h>
- 
- #ifndef BITS_PER_LONG
- # if defined(__SIZEOF_LONG__)
- #  define BITS_PER_LONG (__SIZEOF_LONG__ * 8)
- # elif defined(__WORDSIZE)
- #  define BITS_PER_LONG __WORDSIZE
-+# elif ULONG_MAX == 0xffffffffffffffff
-+#  define BITS_PER_LONG 64
-+# elif ULONG_MAX == 0xffffffff
-+#  define BITS_PER_LONG 32
- # else /* wtf is wrong with your libc headers? */
- #  error "neither BITS_PER_LONG, __SIZEOF_LONG__, nor __WORDSIZE defined"
- # endif
-- 
2.6.4

---

---

From: Natanael Copa <[email-masked]>
Date: Tue, 5 Jan 2016 13:25:22 +0100

On Tue, 29 Dec 2015 16:07:34 +0100

> - Remove musl specific bits_per_long patch, fixed upstream.

For some reason the permissions of /sbin/drbdsetup got different on my
x86_64 dev box and on on x86 dev box + the build servers:

ncdev-edge-musl-x86:~/aports$ ls -l /sbin/drbdsetup 
-rwsr-x---    1 root     haclient    132324 Jan  5 12:01 /sbin/drbdsetup

ncdev-edge-x86_64:~/aports$ ls -l /sbin/drbdsetup 
-rwxr-xr-x    1 root     root        144856 Jan  5 10:43 /sbin/drbdsetup

Which is correct?

-nc

---

---

From: Roland Kammerer <[email-masked]>
Date: Tue, 5 Jan 2016 14:03:26 +0100

> -rwxr-xr-x    1 root     root        144856 Jan  5 10:43 /sbin/drbdsetup

There is some magic in the Makefiles along these lines:

if getent group haclient > /dev/null 2> /dev/null ; then
install -g haclient -m 4750 drbdsetup

So on one of your boxes the group "haclient" exists, on the other it does not.

"haclient" is a pacemaker thing and some part of pacemaker possibly wants
to call programs from drbd-utils (e.g., if a DRBD resource is managed by
pacemaker).

DRBD works fine without pacemaker, but for pacemaker integration the
variant where the binaries belong to group "haclient" seems a bit more
favorable.

Regards, rck

---

---

From: Roland Kammerer <[email-masked]>
Date: Tue, 29 Dec 2015 16:07:36 +0100

http://www.drbd.org
DRBD9 Cluster Management Tool
---
 testing/py-drbdmanage/APKBUILD                  | 57 +++++++++++++++++++++++++
 testing/py-drbdmanage/path.patch                | 11 +++++
 testing/py-drbdmanage/rm-systemd-and-bash.patch | 15 +++++++
 3 files changed, 83 insertions(+)
 create mode 100644 testing/py-drbdmanage/APKBUILD
 create mode 100644 testing/py-drbdmanage/path.patch
 create mode 100644 testing/py-drbdmanage/rm-systemd-and-bash.patch

diff --git a/testing/py-drbdmanage/APKBUILD b/testing/py-drbdmanage/APKBUILD
new file mode 100644
index 0000000..03e61e2
--- /dev/null
+++ b/testing/py-drbdmanage/APKBUILD
@@ -0,0 +1,57 @@
+# Contributor: Roland Kammerer <[email-masked]>
+# Maintainer: Roland Kammerer <[email-masked]>
+_usname=drbdmanage
+pkgname=py-$_usname
+pkgver=0.90
+pkgrel=0
+pkgdesc="DRBD9 Cluster Management Tool"
+url="http://www.drbd.org"
+arch="noarch"
+license="GPL"
+depends="python py-gobject dbus py-dbus lvm2"
+depends_dev=""
+makedepends="python-dev libxslt help2man py-gobject drbd-utils"
+install=""
+subpackages="$pkgname-doc"
+source="http://oss.linbit.com/$_usname/$_usname-$pkgver.tar.gz
+        rm-systemd-and-bash.patch
+	path.patch"
+
+_builddir=$srcdir/$_usname-$pkgver
+prepare() {
+	local i
+	cd "$_builddir"
+	for i in $source; do
+		case $i in
+		*.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;;
+		esac
+	done
+}
+
+build() {
+	cd "$_builddir"
+	python setup.py build_man || return 1
+	python setup.py build || return 1
+}
+
+package() {
+	cd "$_builddir"
+	python setup.py install --prefix=/usr --root="$pkgdir" || return 1
+}
+
+doc() {
+	# Man pages
+	mkdir -p "$subpkgdir"/usr/share/man || return 1
+	mv "$pkgdir"/usr/share/man "$subpkgdir"/usr/share/ || return 1
+}
+
+
+md5sums="fc4bee4c909c23d5114fd15b15c11422  drbdmanage-0.90.tar.gz
+24c95b3312a4ee69e7225bdb0e19b4ed  rm-systemd-and-bash.patch
+1b42bc4f74bd15d9ebba45d37ba81ab6  path.patch"
+sha256sums="7041128052beb2615e447d579f678fe52ed54182ee1e1f72237f4bb2bdbb86be  drbdmanage-0.90.tar.gz
+14bc5ac238ccd56794f24f21ed5bbe2d957edb725b4cb0889d1f539e4c187e23  rm-systemd-and-bash.patch
+3ac85bdf5b2bdaaef7728c42e465de6f7a6b80828e02163337b5d4b9df1b5145  path.patch"
+sha512sums="ef26beebf3f9acdfd4d63981429afeb29ce25d0be803887914029d870193ff00582fb741ce9e6005f2f4e5202231fdd67c5751f495d574e4bb6eef605a73b1b6  drbdmanage-0.90.tar.gz
+ca8108c2a46b6cac54bc0b811547107329d34f58462075010d5af7c7b0c3cdbf58061e80057b54f095f0dedde54b3b8cb99b5b0aab21960e7c0d47b01528037e  rm-systemd-and-bash.patch
+f8a6c0c667333355e684a593dd1eec233e5a83943b1e911cd32b3c7fbf22047ddc9638e9a3c022c7c7a11ce1de55e6f39654bab8564eb5356d3b596552c79b67  path.patch"
diff --git a/testing/py-drbdmanage/path.patch b/testing/py-drbdmanage/path.patch
new file mode 100644
index 0000000..4868bf9
--- /dev/null
+++ b/testing/py-drbdmanage/path.patch
@@ -0,0 +1,11 @@
+--- a/drbdmanage/server.py
++++ b/drbdmanage/server.py
+@@ -165,7 +165,7 @@
+         KEY_MIN_PORT_NR    : str(DEFAULT_MIN_PORT_NR),
+         KEY_MAX_PORT_NR    : str(DEFAULT_MAX_PORT_NR),
+         KEY_MAX_FAIL_COUNT : str(DEFAULT_MAX_FAIL_COUNT),
+-        KEY_DRBDADM_PATH   : "/usr/sbin",
++        KEY_DRBDADM_PATH   : "/sbin",
+         KEY_EXTEND_PATH    : "/sbin:/usr/sbin:/bin:/usr/bin",
+         KEY_DRBD_CONFPATH  : "/var/lib/drbd.d",
+         KEY_DRBDCTRL_VG    : DEFAULT_VG,
diff --git a/testing/py-drbdmanage/rm-systemd-and-bash.patch b/testing/py-drbdmanage/rm-systemd-and-bash.patch
new file mode 100644
index 0000000..0041a62
--- /dev/null
+++ b/testing/py-drbdmanage/rm-systemd-and-bash.patch
@@ -0,0 +1,15 @@
+--- a/setup.py
++++ b/setup.py
+@@ -166,11 +166,8 @@
+                   ("/etc/dbus-1/system.d", ["conf/org.drbd.drbdmanaged.conf"]),
+                   ("/usr/share/dbus-1/system-services",
+                    ["conf/org.drbd.drbdmanaged.service"]),
+-                  ("/lib/systemd/system/", ["conf/drbdmanaged.service",
+-                                            "conf/drbdmanaged.socket"]),
+                   ("/var/lib/drbd.d", []),
+-                  ("/var/lib/drbdmanage", []),
+-                  ("/etc/bash_completion.d", ["scripts/bash_completion/drbdmanage"])]
++                  ("/var/lib/drbdmanage", [])]
+ 
+     # Don't overwrite existing file
+     if not os.path.isfile("/etc/drbdmanaged.cfg"):
-- 
2.6.4

---

---

From: Natanael Copa <[email-masked]>
Date: Tue, 5 Jan 2016 13:12:10 +0100

On Tue, 29 Dec 2015 16:07:36 +0100

> +++ b/testing/py-drbdmanage/APKBUILD

on a second though, i think we want rename this package to drbdmanage.
It is a tool more than a python library.

-nc

---

---

From: Roland Kammerer <[email-masked]>
Date: Tue, 5 Jan 2016 14:05:06 +0100

> It is a tool more than a python library.

Totally makes sense, was not sure about the naming conventions...

Regards rck

---

---

From: Roland Kammerer <[email-masked]>
Date: Tue, 5 Jan 2016 12:02:05 +0100

>   testing/py-drbdmanage: new aport

Hi,

it is now a week that passed and I wanted to ask if there is any
progress or feedback on what needs to be done?

Regards, rck

---

---

From: Natanael Copa <[email-masked]>
Date: Tue, 5 Jan 2016 12:58:11 +0100

Hi,

sorry for late response.

On Tue, 29 Dec 2015 16:07:33 +0100

> lot of lightweight VMs for DRBD cluster/kernel development.

Awesome!

> a patch for musl libc. AFAIR we got a patch for that which I merged somewhere

ack
 
> okay? Or is there a concept of meta-packages like "linux-dev"?

This is correct. We have different kernels with different patches and
different configurations (linux-grsec, linux-virtgrsec, linux-vanilla).
You need to have a package for every kernel variant you want support,
so the kernel module package should be named drbd9-grsec.

> - Add a python program for managing multi-node DRBD9 clusters. While
> it is a client/server application, it does not contain an init-script
> by intention. The server should get DBus activated. DBus is also a
> dependency of that package, but is there a way to start/add the DBus
> service at install time? Is this even desired?  For now, the user has
> to start/rc-update dbus manually. Is that okay?

This is the preferred way to deal with it. We don't want start/stop
services install time.
 
> I tested the combination of the three packages in simple 2 node
> cluster setup (separated VM from my build machine) and it worked as
> expected.
> 
> Besides that, I already merged back some of the patches currently
> required to our internal repo (e.g., busybox mv patches), so we can
> get rid of them in the next release. This is currently only in our
> internal repo and not visible in the public git repos.

very nice!

I think I just apply them as is and we take it from there.

Many thanks!

-nc

> 
> Regards, rck
> 
> Roland Kammerer (3):Return-Path: <alpine-aports+bounces-2051-ncopa=[email-masked]>
From: Roland Kammerer <[email-masked]>
To: [email-masked]
Cc: Roland Kammerer <[email-masked]>
Subject: [alpine-aports] [PATCH 2/3] testing/drbd9: new aport
Date: Tue, 29 Dec 2015 16:07:35 +0100

http://www.drbd.org
Network-based RAID 1 version 9
---
 testing/drbd9/APKBUILD         | 45 ++++++++++++++++++++++++++++++++++++++++++
 testing/drbd9/busybox-mv.patch |  8 ++++++++
 2 files changed, 53 insertions(+)
 create mode 100644 testing/drbd9/APKBUILD
 create mode 100644 testing/drbd9/busybox-mv.patch

diff --git a/testing/drbd9/APKBUILD b/testing/drbd9/APKBUILD
new file mode 100644
index 0000000..bae8f22
--- /dev/null
+++ b/testing/drbd9/APKBUILD
@@ -0,0 +1,45 @@
+# Contributor: Roland Kammerer <[email-masked]>
+# Maintainer: Roland Kammerer <[email-masked]>
+_usname=drbd
+pkgname=${_usname}9
+pkgver=9.0.0
+pkgrel=0
+pkgdesc="Network-based RAID 1 version 9"
+url="http://www.drbd.org"
+arch="all"
+license="GPL"
+depends=""
+depends_dev=""
+makedepends="linux-grsec-dev"
+install=""
+subpackages=""
+source="http://oss.linbit.com/$_usname/9.0/$_usname-$pkgver.tar.gz
+        busybox-mv.patch"
+
+_builddir=$srcdir/$_usname-$pkgver
+prepare() {
+	local i
+	cd "$_builddir"
+	for i in $source; do
+		case $i in
+		*.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;;
+		esac
+	done
+}
+
+build() {
+	cd "$_builddir"
+	make || return 1
+}
+
+package() {
+	cd "$_builddir"
+	make DESTDIR="$pkgdir" install || return 1
+}
+
+md5sums="62706c1b57bf399071272dad0d267421  drbd-9.0.0.tar.gz
+0ce3796e13ae3d271a1a3bac8ace1603  busybox-mv.patch"
+sha256sums="0dc6e37492dcc8a960311b3b0b7e2d17bd1afff146756cdd80d5477c17d7dffc  drbd-9.0.0.tar.gz
+49898fdf26f8d6bfc8f0a433ca3c17bd0f860f65119ae7f0144eba5977cf30f8  busybox-mv.patch"
+sha512sums="a86fbf199ad58aa5458323ca7e42e827516d3a61b871b6eeabf3507547cbec76e713d2276d9e6b4c5d984ec86263516f5feeda871b012f32fd5b49de9489b549  drbd-9.0.0.tar.gz
+bcaa7a126cffc5219ecdb9a9bcee8b32312a8d7ed3233360a0393788eb10c5ebe321b607f1f060acf9aa02092b274964437c72bb6bf73d35fa79a7daf27c16d2  busybox-mv.patch"
diff --git a/testing/drbd9/busybox-mv.patch b/testing/drbd9/busybox-mv.patch
new file mode 100644
index 0000000..76345f8
--- /dev/null
+++ b/testing/drbd9/busybox-mv.patch
@@ -0,0 +1,8 @@
+--- a/drbd/Kbuild
++++ b/drbd/Kbuild
+@@ -131,4 +131,4 @@
+ 		exit 1;								\
+ 	fi ;									\
+ 	echo -e "\t\t\" build by $$USER@$$HOSTNAME, `date "+%F %T"`\";\n}";	\
+-	mv --force $@.new $@
++	mv -f $@.new $@
-- 
2.6.4

---

>  testing/drbd9/APKBUILD                          | 45
> +++++++++++++++++++ testing/drbd9/busybox-mv.patch
> |  8 ++++ testing/py-drbdmanage/APKBUILD                  | 57
> +++++++++++++++++++++++++
> testing/py-drbdmanage/rm-systemd-and-bash.patch | 15 +++++++ 7 files
> changed, 140 insertions(+), 30 deletions(-) delete mode 100644
> main/drbd-utils/bits_per_long.patch create mode 100644
> testing/drbd9/APKBUILD create mode 100644
> testing/drbd9/busybox-mv.patch create mode 100644
> testing/py-drbdmanage/APKBUILD create mode 100644
> testing/py-drbdmanage/path.patch create mode 100644
> testing/py-drbdmanage/rm-systemd-and-bash.patch
> 

---