Skip to content

Instantly share code, notes, and snippets.

@bradfa
Last active February 10, 2016 01:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bradfa/8845aac14a4fd408b5ac to your computer and use it in GitHub Desktop.
Save bradfa/8845aac14a4fd408b5ac to your computer and use it in GitHub Desktop.
lvm2 v2.02.111 backport to wheezy
diff -Naur lvm2-2.02.111.orig/debian/changelog lvm2-2.02.111/debian/changelog
--- lvm2-2.02.111.orig/debian/changelog 2015-03-26 09:23:27.183189444 -0400
+++ lvm2-2.02.111/debian/changelog 2015-03-26 10:18:59.573536749 -0400
@@ -1,3 +1,13 @@
+lvm2 (2.02.111-2.1~bpo70+1) wheezy-backports; urgency=low
+
+ * Rebuild for wheezy-backports.
+ * Remove build-depend on dh-systemd introduced in 2.02.104-1.
+ * Remove debian/rules calls to systemd units/start/enable.
+ * Do not apply systemd.patch.
+ * Remove "lib/systemd/system/*" from debian/*.install files.
+
+ -- Andrew Bradford <andrew@bradfordembedded.com> Thu, 26 Mar 2015 09:46:46 -0400
+
lvm2 (2.02.111-2.1) unstable; urgency=medium
* Non-maintainer upload
diff -Naur lvm2-2.02.111.orig/debian/clvm.install lvm2-2.02.111/debian/clvm.install
--- lvm2-2.02.111.orig/debian/clvm.install 2015-03-26 09:23:27.183189444 -0400
+++ lvm2-2.02.111/debian/clvm.install 2015-03-26 10:19:54.094032942 -0400
@@ -1,5 +1,2 @@
-lib/systemd/lvm2-cluster*
-lib/systemd/system/lvm2-cluster*
-lib/systemd/system/lvm2-clvmd*
usr/sbin/clvmd
usr/share/man/man8/clvmd*
diff -Naur lvm2-2.02.111.orig/debian/control lvm2-2.02.111/debian/control
--- lvm2-2.02.111.orig/debian/control 2015-03-26 09:23:27.183189444 -0400
+++ lvm2-2.02.111/debian/control 2015-03-26 09:44:41.782762840 -0400
@@ -3,7 +3,7 @@
Priority: optional
Maintainer: Debian LVM Team <pkg-lvm-maintainers@lists.alioth.debian.org>
Uploaders: Bastian Blank <waldi@debian.org>
-Build-Depends: dpkg-dev (>= 1.16.1~), debhelper (>= 8.1.3~), dh-systemd, automake, libcman-dev (>> 2), libcorosync-dev, libdlm-dev (>> 2), libreadline-gplv2-dev, libselinux1-dev, libudev-dev, openais-dev, pkg-config
+Build-Depends: dpkg-dev (>= 1.16.1~), debhelper (>= 8.1.3~), automake, libcman-dev (>> 2), libcorosync-dev, libdlm-dev (>> 2), libreadline-gplv2-dev, libselinux1-dev, libudev-dev, openais-dev, pkg-config
Standards-Version: 3.9.5
Homepage: http://sources.redhat.com/lvm2/
Vcs-Svn: svn://svn.debian.org/pkg-lvm/lvm2/trunk/
diff -Naur lvm2-2.02.111.orig/debian/dmeventd.install lvm2-2.02.111/debian/dmeventd.install
--- lvm2-2.02.111.orig/debian/dmeventd.install 2015-03-26 09:23:27.183189444 -0400
+++ lvm2-2.02.111/debian/dmeventd.install 2015-03-26 10:13:45.226668546 -0400
@@ -1,4 +1,3 @@
lib/*/device-mapper
-lib/systemd/system/dm-event*
sbin/dmeventd
usr/share/man/man8/dmeventd.8
diff -Naur lvm2-2.02.111.orig/debian/lvm2.install lvm2-2.02.111/debian/lvm2.install
--- lvm2-2.02.111.orig/debian/lvm2.install 2015-03-26 09:23:27.183189444 -0400
+++ lvm2-2.02.111/debian/lvm2.install 2015-03-26 10:19:44.213943103 -0400
@@ -1,9 +1,5 @@
../../initramfs-tools/lvm2/* usr/share/initramfs-tools
etc/lvm/lvm.conf
-lib/systemd/system/lvm2-activation*
-lib/systemd/system/lvm2-lvmetad*
-lib/systemd/system/lvm2-monitor*
-lib/systemd/system/lvm2-pvscan*
lib/udev/rules.d/*-lvm*.rules
sbin/fsadm
sbin/lv*
diff -Naur lvm2-2.02.111.orig/debian/lvm2.links lvm2-2.02.111/debian/lvm2.links
--- lvm2-2.02.111.orig/debian/lvm2.links 2015-03-26 09:23:27.183189444 -0400
+++ lvm2-2.02.111/debian/lvm2.links 2015-03-26 10:19:32.517836752 -0400
@@ -1 +0,0 @@
-lib/systemd/system/lvm2-activation.service lib/systemd/system/lvm2.service
diff -Naur lvm2-2.02.111.orig/debian/patches/series lvm2-2.02.111/debian/patches/series
--- lvm2-2.02.111.orig/debian/patches/series 2015-03-26 09:23:27.183189444 -0400
+++ lvm2-2.02.111/debian/patches/series 2015-03-26 10:09:52.556545261 -0400
@@ -6,5 +6,5 @@
implicit-pointer.patch
dm-event-api.patch
udev.patch
-systemd.patch
+#systemd.patch
clvmd-openais-format.patch
diff -Naur lvm2-2.02.111.orig/debian/rules lvm2-2.02.111/debian/rules
--- lvm2-2.02.111.orig/debian/rules 2015-03-26 09:23:27.183189444 -0400
+++ lvm2-2.02.111/debian/rules 2015-03-26 09:55:50.288860164 -0400
@@ -143,7 +143,7 @@
dh_testroot
rm -rf $(INSTALL_DIR)
+$(MAKE_REAL) -C $(DIR) install DESTDIR=$(CURDIR)/$(INSTALL_DIR) LIB_VERSION_DM=$(DEVMAPPER_ABINAME)
- +$(MAKE_REAL) -C $(DIR)/scripts install_systemd_units install_tmpfiles_configuration DESTDIR=$(CURDIR)/$(INSTALL_DIR)
+ +$(MAKE_REAL) -C $(DIR)/scripts install_tmpfiles_configuration DESTDIR=$(CURDIR)/$(INSTALL_DIR)
touch $@
install-base-prep:
@@ -178,9 +178,6 @@
install_dmeventd: DIR = $(BUILD_DIR)/install_deb
install_dmeventd: $(STAMPS_DIR)/install_deb install_liblvm2
+$(MAKE_SELF) install-base-prep INSTALL_DIR='$(DIR)'
- dh_systemd_enable --no-enable dm-event.service
- dh_systemd_enable dm-event.socket
- dh_systemd_start --restart-after-upgrade dm-event.socket
+$(MAKE_SELF) install-base CHANGELOG=WHATS_NEW_DM GENCONTROL_ARGS="-v$(DEVMAPPER_VERSION_DEBIAN)"
install_dmsetup: export DH_OPTIONS = -pdmsetup
@@ -245,9 +242,6 @@
install_lvm2: DIR = $(BUILD_DIR)/install_deb
install_lvm2: $(STAMPS_DIR)/install_deb
+$(MAKE_SELF) install-base-prep INSTALL_DIR='$(DIR)'
- dh_systemd_enable --no-enable lvm2-lvmetad.service
- dh_systemd_enable lvm2-activation.service lvm2-activation-early.service lvm2-lvmetad.socket lvm2-monitor.service
- dh_systemd_start --restart-after-upgrade lvm2-lvmetad.socket
dh_installinit --no-start -- start 26 S .
+$(MAKE_SELF) install-base
diff -Naur lvm2-2.02.111.orig/scripts/lvm2-activation-early_systemd_debian.service lvm2-2.02.111/scripts/lvm2-activation-early_systemd_debian.service
--- lvm2-2.02.111.orig/scripts/lvm2-activation-early_systemd_debian.service 2015-03-26 09:23:27.179189408 -0400
+++ lvm2-2.02.111/scripts/lvm2-activation-early_systemd_debian.service 1969-12-31 19:00:00.000000000 -0500
@@ -1,14 +0,0 @@
-[Unit]
-Description=Activation of LVM2 logical volumes
-Documentation=man:lvm(8) man:vgchange(8)
-DefaultDependencies=no
-After=systemd-udev-settle.service
-Before=cryptsetup.target local-fs.target shutdown.target
-Wants=systemd-udev-settle.service
-
-[Service]
-ExecStart=/sbin/lvm vgchange -aay --sysinit
-Type=oneshot
-
-[Install]
-WantedBy=local-fs.target
diff -Naur lvm2-2.02.111.orig/scripts/lvm2-activation_systemd_debian.service lvm2-2.02.111/scripts/lvm2-activation_systemd_debian.service
--- lvm2-2.02.111.orig/scripts/lvm2-activation_systemd_debian.service 2015-03-26 09:23:27.179189408 -0400
+++ lvm2-2.02.111/scripts/lvm2-activation_systemd_debian.service 1969-12-31 19:00:00.000000000 -0500
@@ -1,14 +0,0 @@
-[Unit]
-Description=Activation of LVM2 logical volumes
-Documentation=man:lvm(8) man:vgchange(8)
-DefaultDependencies=no
-After=lvm2-activation-early.service cryptsetup.target
-Before=local-fs.target shutdown.target
-Wants=systemd-udev-settle.service
-
-[Service]
-ExecStart=/sbin/lvm vgchange -aay --sysinit
-Type=oneshot
-
-[Install]
-WantedBy=local-fs.target
diff -Naur lvm2-2.02.111.orig/scripts/lvm2_lvmetad_systemd_red_hat.service.in lvm2-2.02.111/scripts/lvm2_lvmetad_systemd_red_hat.service.in
--- lvm2-2.02.111.orig/scripts/lvm2_lvmetad_systemd_red_hat.service.in 2015-03-26 09:23:27.179189408 -0400
+++ lvm2-2.02.111/scripts/lvm2_lvmetad_systemd_red_hat.service.in 2015-03-26 10:08:41.000000000 -0400
@@ -13,3 +13,6 @@
Environment=SD_ACTIVATION=1
Restart=on-abort
PIDFile=@LVMETAD_PIDFILE@
+
+[Install]
+WantedBy=sysinit.target
diff -Naur lvm2-2.02.111.orig/scripts/Makefile.in lvm2-2.02.111/scripts/Makefile.in
--- lvm2-2.02.111.orig/scripts/Makefile.in 2015-03-26 09:23:27.179189408 -0400
+++ lvm2-2.02.111/scripts/Makefile.in 2015-03-26 10:08:41.000000000 -0400
@@ -99,8 +99,6 @@
install_systemd_units:
$(INSTALL_DIR) $(systemd_unit_dir)
- $(INSTALL_DATA) lvm2-activation_systemd_debian.service $(systemd_unit_dir)/lvm2-activation.service
- $(INSTALL_DATA) lvm2-activation-early_systemd_debian.service $(systemd_unit_dir)/lvm2-activation-early.service
ifeq ("@BUILD_DMEVENTD@", "yes")
$(INSTALL_DATA) dm_event_systemd_red_hat.socket $(systemd_unit_dir)/dm-event.socket
$(INSTALL_DATA) dm_event_systemd_red_hat.service $(systemd_unit_dir)/dm-event.service
@bradfa
Copy link
Author

bradfa commented Mar 30, 2015

This builds and works well on wheezy as a backport but does not (I think) include my desired libdevmapper-event portions which are required in order to support dm-cache.

@bradfa
Copy link
Author

bradfa commented Mar 30, 2015

Looking through the rules file, it seems like cache support is being built in, but probably I am missing the thin-provisioning-tools package (which is only in Jessie, for now).
But hopefully this, combined with ensuring that the initramfs has the proper modules included and the cache-check executable.

A potentially helpful link: http://forums.debian.net/viewtopic.php?f=5&t=119644
That link includes this script within the /etc/initramfs-tools/hooks directory which will get used when you run update-initramfs -u -k all command to rebuild the initramfs image:

#!/bin/sh

PREREQ="lvm2"

prereqs()
{
    echo "$PREREQ"
}

case $1 in
prereqs)
    prereqs
    exit 0
    ;;
esac

if [ ! -x /usr/sbin/cache_check ]; then
    exit 0
fi

. /usr/share/initramfs-tools/hook-functions

copy_exec /usr/sbin/cache_check

manual_add_modules dm_cache dm_cache_mq dm_cache_smq

@bradfa
Copy link
Author

bradfa commented Mar 30, 2015

So, if I have this right, we should install the following backported (from Jessie to Wheezy) packages along with a modern Linux kernel that has dm-cache support:

  • dmeventd
  • dmsetup
  • liblvm2app2.2
  • liblvm2cmd2.02
  • lvm2
  • thin-provisioning-tools

@bradfa
Copy link
Author

bradfa commented Apr 7, 2015

Probably can remove all systemd related things which still remain in lvm2-2.02.111/scripts/Makefile.in

@bradfa
Copy link
Author

bradfa commented Jul 20, 2015

It seems that the current Linux 3.16 in Jessie (also backported to Wheezy) DOES have dm-cache support built in! :)
So, hopefully, no need to build a custom kernel to use dm-cache now.

@bradfa
Copy link
Author

bradfa commented Feb 10, 2016

For newer kernels, use the dm_cache_smq module in addition to the dm_cache_mq module.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment