Package: lvm2
Version: 2.02.98-5
Severity: normal
Tags: patch

Dear maintainer,

Debian users who use systemd sometimes have trouble booting their
machines (see e.g. http://bugs.debian.org/718190). Here at DebConf I had
the chance to reproduce the issue and noticed that the lvm2 package does
not ship the systemd generator that upstream provides.

The attached patch calls the install_systemd_generators and
install_tmpfiles_configuration make targets to install the files, adds
them to debian/lvm2.install and fixes the hard-coded path in
scripts/lvm2_activation_generator_systemd_red_hat.c (patch sent
upstream).

In my tests, this fixes the lvm boot issues with systemd. Therefore,
please merge it for your next upload.

Thank you.
diff -Nru lvm2-2.02.98/debian/lvm2.install lvm2-2.02.98/debian/lvm2.install
--- lvm2-2.02.98/debian/lvm2.install	2012-05-27 16:25:21.000000000 +0200
+++ lvm2-2.02.98/debian/lvm2.install	2013-08-14 19:02:39.000000000 +0200
@@ -8,3 +8,5 @@
 usr/share/man/man8/pv*
 usr/share/man/man8/vg*
 usr/share/man/man5
+usr/lib/tmpfiles.d/lvm2.conf
+lib/systemd/system-generators/lvm2-activation-generator
diff -Nru lvm2-2.02.98/debian/patches/lvm_path.patch lvm2-2.02.98/debian/patches/lvm_path.patch
--- lvm2-2.02.98/debian/patches/lvm_path.patch	1970-01-01 01:00:00.000000000 +0100
+++ lvm2-2.02.98/debian/patches/lvm_path.patch	2013-08-14 20:41:10.000000000 +0200
@@ -0,0 +1,28 @@
+Description: Use LVM_PATH instead of hard-coded /usr/sbin/lvm
+Author: Michael Stapelberg <stapelb...@debian.org>
+Last-Update: 2013-08-14
+Forwarded: https://www.redhat.com/archives/linux-lvm/2013-August/msg00033.html
+
+---
+
+Index: lvm2-2.02.98/scripts/lvm2_activation_generator_systemd_red_hat.c
+===================================================================
+--- lvm2-2.02.98.orig/scripts/lvm2_activation_generator_systemd_red_hat.c	2013-08-14 18:44:12.005448150 +0200
++++ lvm2-2.02.98/scripts/lvm2_activation_generator_systemd_red_hat.c	2013-08-14 18:52:14.403183063 +0200
+@@ -20,6 +20,7 @@
+ #include <sys/stat.h>
+ #include <fcntl.h>
+ #include "lvm2app.h"
++#include "lib.h" /* for LVM_PATH */
+ 
+ #define KMSG_DEV_PATH        "/dev/kmsg"
+ #define LVM_CONF_USE_LVMETAD "global/use_lvmetad"
+@@ -125,7 +126,7 @@
+ 	fputs("Before=local-fs.target shutdown.target\n"
+ 	      "Wants=systemd-udev-settle.service\n\n"
+ 	      "[Service]\n"
+-	      "ExecStart=/usr/sbin/lvm vgchange -aay --sysinit\n"
++	      "ExecStart=" LVM_PATH " vgchange -aay --sysinit\n"
+ 	      "Type=oneshot\n", f);
+ 
+ 	if (fclose(f) < 0) {
diff -Nru lvm2-2.02.98/debian/patches/series lvm2-2.02.98/debian/patches/series
--- lvm2-2.02.98/debian/patches/series	2013-07-13 12:32:01.000000000 +0200
+++ lvm2-2.02.98/debian/patches/series	2013-08-14 18:43:42.000000000 +0200
@@ -7,3 +7,4 @@
 dm-event-api.patch
 monitoring-default-off.patch
 missing-dmeventd.patch
+lvm_path.patch
diff -Nru lvm2-2.02.98/debian/rules lvm2-2.02.98/debian/rules
--- lvm2-2.02.98/debian/rules	2013-07-14 16:30:54.000000000 +0200
+++ lvm2-2.02.98/debian/rules	2013-08-14 19:02:46.000000000 +0200
@@ -140,6 +140,8 @@
 	dh_testroot
 	rm -rf $(INSTALL_DIR)
 	+$(MAKE_REAL) -C $(DIR) install DESTDIR=$(CURDIR)/$(INSTALL_DIR) LIB_VERSION_DM=$(DEVMAPPER_ABINAME)
+	+$(MAKE_REAL) -C $(DIR) install_systemd_generators DESTDIR=$(CURDIR)/$(INSTALL_DIR) LIB_VERSION_DM=$(DEVMAPPER_ABINAME)
+	+$(MAKE_REAL) -C $(DIR) install_tmpfiles_configuration DESTDIR=$(CURDIR)/$(INSTALL_DIR) LIB_VERSION_DM=$(DEVMAPPER_ABINAME)
 	touch $@
 
 install-base-prep:

Reply via email to