summaryrefslogtreecommitdiff
path: root/sys-fs
diff options
context:
space:
mode:
authorSamuli Suominen <ssuominen@gentoo.org>2012-07-05 08:55:13 +0000
committerSamuli Suominen <ssuominen@gentoo.org>2012-07-05 08:55:13 +0000
commitba50bc151ccd37a0ca13a42bfab9ddd5665a5530 (patch)
tree7676cb710ec523376f18f661853dd4e0bdd116d2 /sys-fs
parentChange manifest to new hashes. (diff)
downloadgentoo-2-ba50bc151ccd37a0ca13a42bfab9ddd5665a5530.tar.gz
gentoo-2-ba50bc151ccd37a0ca13a42bfab9ddd5665a5530.tar.bz2
gentoo-2-ba50bc151ccd37a0ca13a42bfab9ddd5665a5530.zip
Fix compability with sys-fs/udev >= 185 wrt #424810 by Marien Zwart
(Portage version: 2.2.0_alpha116/cvs/Linux x86_64)
Diffstat (limited to 'sys-fs')
-rw-r--r--sys-fs/lvm2/ChangeLog8
-rw-r--r--sys-fs/lvm2/files/lvm2-2.02.95-udev185.patch208
-rw-r--r--sys-fs/lvm2/lvm2-2.02.95-r3.ebuild267
3 files changed, 482 insertions, 1 deletions
diff --git a/sys-fs/lvm2/ChangeLog b/sys-fs/lvm2/ChangeLog
index 3132e9726cd2..c0fd2d06c818 100644
--- a/sys-fs/lvm2/ChangeLog
+++ b/sys-fs/lvm2/ChangeLog
@@ -1,6 +1,12 @@
# ChangeLog for sys-fs/lvm2
# Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/sys-fs/lvm2/ChangeLog,v 1.273 2012/06/07 03:30:37 robbat2 Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-fs/lvm2/ChangeLog,v 1.274 2012/07/05 08:55:13 ssuominen Exp $
+
+*lvm2-2.02.95-r3 (05 Jul 2012)
+
+ 05 Jul 2012; Samuli Suominen <ssuominen@gentoo.org> +lvm2-2.02.95-r3.ebuild,
+ +files/lvm2-2.02.95-udev185.patch:
+ Fix compability with sys-fs/udev >= 185 wrt #424810 by Marien Zwart
07 Jun 2012; Robin H. Johnson <robbat2@gentoo.org> lvm2-2.02.95-r2.ebuild:
Bug #419871: Drop comments that say /usr is not used.
diff --git a/sys-fs/lvm2/files/lvm2-2.02.95-udev185.patch b/sys-fs/lvm2/files/lvm2-2.02.95-udev185.patch
new file mode 100644
index 000000000000..ba7e40deea64
--- /dev/null
+++ b/sys-fs/lvm2/files/lvm2-2.02.95-udev185.patch
@@ -0,0 +1,208 @@
+From 06738cac051b671ed26bd137676713eab457b37f Mon Sep 17 00:00:00 2001
+From: Peter Rajnoha <prajnoha@redhat.com>
+Date: Tue, 29 May 2012 08:09:10 +0000
+Subject: [PATCH] Remove unsupported udev_get_dev_path libudev call used for checking udev dir.
+
+With latest changes in the udev, some deprecated functions were removed
+from libudev amongst which there was the "udev_get_dev_path" function
+we used to compare a device directory used in udev and directore set in
+libdevmapper. The "/dev" is hardcoded in udev now (udev version >= 183).
+
+Amongst other changes and from packager's point of view, it's also
+important to note that the libudev development library ("libudev-devel")
+could now be a part of the systemd development library ("systemd-devel")
+because of the udev + systemd merge.
+---
+ WHATS_NEW_DM | 1 +
+ lib/commands/toolcontext.c | 28 ++++++++++++++++------------
+ lib/misc/lvm-wrappers.c | 14 --------------
+ lib/misc/lvm-wrappers.h | 1 -
+ libdm/libdevmapper.h | 3 +++
+ tools/dmsetup.c | 30 ++++++++++++------------------
+ 6 files changed, 32 insertions(+), 45 deletions(-)
+
+diff --git a/lib/commands/toolcontext.c b/lib/commands/toolcontext.c
+index 78f0801..cc23163 100644
+--- a/lib/commands/toolcontext.c
++++ b/lib/commands/toolcontext.c
+@@ -650,9 +650,9 @@ static int _init_dev_cache(struct cmd_context *cmd)
+ {
+ const struct dm_config_node *cn;
+ const struct dm_config_value *cv;
+- size_t uninitialized_var(udev_dir_len), len;
++ size_t len, udev_dir_len = strlen(DM_UDEV_DEV_DIR);
++ int len_diff;
+ int device_list_from_udev;
+- const char *uninitialized_var(udev_dir);
+
+ init_dev_disable_after_error_count(
+ find_config_tree_int(cmd, "devices/disable_after_error_count",
+@@ -661,13 +661,9 @@ static int _init_dev_cache(struct cmd_context *cmd)
+ if (!dev_cache_init(cmd))
+ return_0;
+
+- if ((device_list_from_udev = udev_is_running() ?
++ device_list_from_udev = udev_is_running() ?
+ find_config_tree_bool(cmd, "devices/obtain_device_list_from_udev",
+- DEFAULT_OBTAIN_DEVICE_LIST_FROM_UDEV) : 0)) {
+- if (!(udev_dir = udev_get_dev_dir()))
+- stack;
+- udev_dir_len = (udev_dir) ? strlen(udev_dir) : 0;
+- }
++ DEFAULT_OBTAIN_DEVICE_LIST_FROM_UDEV) : 0;
+ init_obtain_device_list_from_udev(device_list_from_udev);
+
+ if (!(cn = find_config_tree_node(cmd, "devices/scan"))) {
+@@ -688,11 +684,19 @@ static int _init_dev_cache(struct cmd_context *cmd)
+ return 0;
+ }
+
+- if (device_list_from_udev && udev_dir) {
++ if (device_list_from_udev) {
+ len = strlen(cv->v.str);
+- len = udev_dir_len > len ? len : udev_dir_len;
+- if (strncmp(udev_dir, cv->v.str, len) ||
+- udev_dir[len] != cv->v.str[len]) {
++
++ /*
++ * DM_UDEV_DEV_DIR always has '/' at its end.
++ * If the item in the conf does not have it, be sure
++ * to make the right comparison without the '/' char!
++ */
++ len_diff = len && cv->v.str[len - 1] != '/' ?
++ udev_dir_len - 1 != len :
++ udev_dir_len != len;
++
++ if (len_diff || strncmp(DM_UDEV_DEV_DIR, cv->v.str, len)) {
+ device_list_from_udev = 0;
+ init_obtain_device_list_from_udev(0);
+ }
+diff --git a/lib/misc/lvm-wrappers.c b/lib/misc/lvm-wrappers.c
+index 84f61a6..6cffae3 100644
+--- a/lib/misc/lvm-wrappers.c
++++ b/lib/misc/lvm-wrappers.c
+@@ -65,16 +65,6 @@ bad:
+ return 0;
+ }
+
+-const char *udev_get_dev_dir(void)
+-{
+- if (!_udev) {
+- log_debug(_no_context_msg);
+- return NULL;
+- }
+-
+- return udev_get_dev_path(_udev);
+-}
+-
+ struct udev* udev_get_library_context(void)
+ {
+ return _udev;
+@@ -96,10 +86,6 @@ int udev_is_running(void)
+ return 0;
+ }
+
+-const char *udev_get_dev_dir(void)
+-{
+- return NULL;
+-}
+ #endif
+
+ int lvm_getpagesize(void)
+diff --git a/lib/misc/lvm-wrappers.h b/lib/misc/lvm-wrappers.h
+index f5b381c..e43f831 100644
+--- a/lib/misc/lvm-wrappers.h
++++ b/lib/misc/lvm-wrappers.h
+@@ -24,7 +24,6 @@ struct udev *udev_get_library_context(void);
+ int udev_init_library_context(void);
+ void udev_fin_library_context(void);
+ int udev_is_running(void);
+-const char *udev_get_dev_dir(void);
+
+ int lvm_getpagesize(void);
+
+diff --git a/libdm/libdevmapper.h b/libdm/libdevmapper.h
+index 7df4db8..1f780a3 100644
+--- a/libdm/libdevmapper.h
++++ b/libdm/libdevmapper.h
+@@ -1500,6 +1500,9 @@ struct dm_config_node *dm_config_clone_node(struct dm_config_tree *cft, const st
+
+ struct dm_pool *dm_config_memory(struct dm_config_tree *cft);
+
++/* Udev device directory. */
++#define DM_UDEV_DEV_DIR "/dev/"
++
+ /* Cookie prefixes.
+ *
+ * The cookie value consists of a prefix (16 bits) and a base (16 bits).
+diff --git a/tools/dmsetup.c b/tools/dmsetup.c
+index 6934de8..2787b76 100644
+--- a/tools/dmsetup.c
++++ b/tools/dmsetup.c
+@@ -1008,11 +1008,9 @@ static int _udevcookies(CMD_ARGS)
+ #else /* UDEV_SYNC_SUPPORT */
+ static int _set_up_udev_support(const char *dev_dir)
+ {
+- struct udev *udev;
+- const char *udev_dev_dir;
+- size_t udev_dev_dir_len;
+ int dirs_diff;
+ const char *env;
++ size_t len = strlen(dev_dir), udev_dir_len = strlen(DM_UDEV_DEV_DIR);
+
+ if (_switches[NOUDEVSYNC_ARG])
+ dm_udev_set_sync_support(0);
+@@ -1030,14 +1028,6 @@ static int _set_up_udev_support(const char *dev_dir)
+ " defined by --udevcookie option.",
+ _udev_cookie);
+
+- if (!(udev = udev_new()) ||
+- !(udev_dev_dir = udev_get_dev_path(udev)) ||
+- !*udev_dev_dir) {
+- log_error("Could not get udev dev path.");
+- return 0;
+- }
+- udev_dev_dir_len = strlen(udev_dev_dir);
+-
+ /*
+ * Normally, there's always a fallback action by libdevmapper if udev
+ * has not done its job correctly, e.g. the nodes were not created.
+@@ -1049,12 +1039,17 @@ static int _set_up_udev_support(const char *dev_dir)
+ * is the same as "dev path" used by libdevmapper.
+ */
+
+- /* There's always a slash at the end of dev_dir. But check udev_dev_dir! */
+- if (udev_dev_dir[udev_dev_dir_len - 1] != '/')
+- dirs_diff = strncmp(dev_dir, udev_dev_dir, udev_dev_dir_len);
+- else
+- dirs_diff = strcmp(dev_dir, udev_dev_dir);
+
++ /*
++ * DM_UDEV_DEV_DIR always has '/' at its end.
++ * If the dev_dir does not have it, be sure
++ * to make the right comparison without the '/' char!
++ */
++ if (dev_dir[len - 1] != '/')
++ udev_dir_len--;
++
++ dirs_diff = udev_dir_len != len ||
++ strncmp(DM_UDEV_DEV_DIR, dev_dir, len);
+ _udev_only = !dirs_diff && (_udev_cookie || !_switches[VERIFYUDEV_ARG]);
+
+ if (dirs_diff) {
+@@ -1064,11 +1059,10 @@ static int _set_up_udev_support(const char *dev_dir)
+ "about udev not working correctly while processing "
+ "particular nodes will be suppressed. These nodes "
+ "and symlinks will be managed in each directory "
+- "separately.", dev_dir, udev_dev_dir);
++ "separately.", dev_dir, DM_UDEV_DEV_DIR);
+ dm_udev_set_checking(0);
+ }
+
+- udev_unref(udev);
+ return 1;
+ }
+
+--
+1.7.2.1
+
diff --git a/sys-fs/lvm2/lvm2-2.02.95-r3.ebuild b/sys-fs/lvm2/lvm2-2.02.95-r3.ebuild
new file mode 100644
index 000000000000..8c2767852b92
--- /dev/null
+++ b/sys-fs/lvm2/lvm2-2.02.95-r3.ebuild
@@ -0,0 +1,267 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-fs/lvm2/lvm2-2.02.95-r3.ebuild,v 1.1 2012/07/05 08:55:13 ssuominen Exp $
+
+EAPI=3
+inherit eutils multilib toolchain-funcs autotools linux-info
+
+DESCRIPTION="User-land utilities for LVM2 (device-mapper) software."
+HOMEPAGE="http://sources.redhat.com/lvm2/"
+SRC_URI="ftp://sources.redhat.com/pub/lvm2/${PN/lvm/LVM}.${PV}.tgz
+ ftp://sources.redhat.com/pub/lvm2/old/${PN/lvm/LVM}.${PV}.tgz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-linux ~x86-linux"
+
+IUSE="readline static static-libs clvm cman +lvm1 selinux +udev +thin"
+
+DEPEND_COMMON="!!sys-fs/device-mapper
+ readline? ( sys-libs/readline )
+ clvm? ( =sys-cluster/libdlm-3*
+ cman? ( =sys-cluster/cman-3* ) )
+ udev? ( >=sys-fs/udev-151-r4 )"
+
+# /run is now required for locking during early boot. /var cannot be assumed to
+# be available.
+RDEPEND="${DEPEND_COMMON}
+ !<sys-apps/openrc-0.10.1
+ >=sys-apps/baselayout-2.1-r1
+ !!sys-fs/lvm-user
+ !!sys-fs/clvm
+ >=sys-apps/util-linux-2.16
+ thin? ( sys-block/thin-provisioning-tools )"
+
+# Upgrading to this LVM will break older cryptsetup
+RDEPEND="${RDEPEND}
+ !<sys-fs/cryptsetup-1.1.2"
+
+DEPEND="${DEPEND_COMMON}
+ virtual/pkgconfig
+ >=sys-devel/binutils-2.20.1-r1
+ static? ( || ( >=sys-fs/udev-181[static-libs] <sys-fs/udev-181 ) )"
+
+S="${WORKDIR}/${PN/lvm/LVM}.${PV}"
+
+pkg_setup() {
+ local CONFIG_CHECK="~SYSVIPC"
+ use udev && local WARNING_SYSVIPC="CONFIG_SYSVIPC:\tis not set (required for udev sync)\n"
+ check_extra_config
+ # 1. Genkernel no longer copies /sbin/lvm blindly.
+ if use static; then
+ elog "Warning, we no longer overwrite /sbin/lvm and /sbin/dmsetup with"
+ elog "their static versions. If you need the static binaries,"
+ elog "you must append .static to the filename!"
+ fi
+}
+
+src_unpack() {
+ unpack ${A}
+}
+
+src_prepare() {
+ epatch "${FILESDIR}"/lvm.conf-2.02.67.patch
+
+ # Should not be needed due to upstream re-arrangement of build
+ #epatch "${FILESDIR}"/${PN}-2.02.56-dmeventd.patch
+ # Should not be need with new upstream udev rules
+ #epatch "${FILESDIR}"/${PN}-2.02.56-device-mapper-export-format.patch
+
+ # Merged upstream:
+ #epatch "${FILESDIR}"/${PN}-2.02.51-as-needed.patch
+ # Merged upstream:
+ #epatch "${FILESDIR}"/${PN}-2.02.48-fix-pkgconfig.patch
+ # Merged upstream:
+ #epatch "${FILESDIR}"/${PN}-2.02.51-fix-pvcreate.patch
+ # Fixed differently upstream:
+ #epatch "${FILESDIR}"/${PN}-2.02.51-dmsetup-selinux-linking-fix-r3.patch
+
+ epatch "${FILESDIR}"/${PN}-2.02.63-always-make-static-libdm.patch
+ epatch "${FILESDIR}"/lvm2-2.02.56-lvm2create_initrd.patch
+ # bug 318513 - merged upstream
+ #epatch "${FILESDIR}"/${PN}-2.02.64-dmeventd-libs.patch
+ # bug 301331
+ epatch "${FILESDIR}"/${PN}-2.02.67-createinitrd.patch
+ # bug 330373
+ epatch "${FILESDIR}"/${PN}-2.02.92-locale-muck.patch
+ # --as-needed
+ epatch "${FILESDIR}"/${PN}-2.02.70-asneeded.patch
+ # bug 332905
+ epatch "${FILESDIR}"/${PN}-2.02.92-dynamic-static-ldflags.patch
+ # bug 361429 - merged upstream in .85
+ #epatch "${FILESDIR}"/${PN}-2.02.84-udev-pkgconfig.patch
+
+ # Merged upstream
+ #epatch "${FILESDIR}"/${PN}-2.02.73-asneeded.patch
+
+ epatch "${FILESDIR}"/${PN}-2.02.88-respect-cc.patch
+
+ # Upstream bug of LVM path
+ epatch "${FILESDIR}"/${PN}-2.02.95-lvmpath.patch
+
+ # Upstream patch for http://bugs.gentoo.org/424810
+ epatch "${FILESDIR}"/${PN}-2.02.95-udev185.patch
+
+ eautoreconf
+}
+
+src_configure() {
+ local myconf
+ local buildmode
+
+ myconf="${myconf} --enable-dmeventd"
+ myconf="${myconf} --enable-cmdlib"
+ myconf="${myconf} --enable-applib"
+ myconf="${myconf} --enable-fsadm"
+ myconf="${myconf} --enable-lvmetad"
+
+ # Most of this package does weird stuff.
+ # The build options are tristate, and --without is NOT supported
+ # options: 'none', 'internal', 'shared'
+ if use static ; then
+ einfo "Building static LVM, for usage inside genkernel"
+ buildmode="internal"
+ # This only causes the .static versions to become available
+ # We explicitly provide the .static versions so that they can be included in
+ # initramfs environments.
+ myconf="${myconf} --enable-static_link"
+ else
+ ewarn "Building shared LVM, it will not work inside genkernel!"
+ buildmode="shared"
+ fi
+
+ # dmeventd requires mirrors to be internal, and snapshot available
+ # so we cannot disable them
+ myconf="${myconf} --with-mirrors=internal"
+ myconf="${myconf} --with-snapshots=internal"
+ use thin \
+ && myconf="${myconf} --with-thin=internal" \
+ || myconf="${myconf} --with-thin=none"
+
+ if use lvm1 ; then
+ myconf="${myconf} --with-lvm1=${buildmode}"
+ else
+ myconf="${myconf} --with-lvm1=none"
+ fi
+
+ # disable O_DIRECT support on hppa, breaks pv detection (#99532)
+ use hppa && myconf="${myconf} --disable-o_direct"
+
+ if use clvm; then
+ myconf="${myconf} --with-cluster=${buildmode}"
+ # 4-state! Make sure we get it right, per bug 210879
+ # Valid options are: none, cman, gulm, all
+ #
+ # 2009/02:
+ # gulm is removed now, now dual-state:
+ # cman, none
+ # all still exists, but is not needed
+ #
+ # 2009/07:
+ # TODO: add corosync and re-enable ALL
+ local clvmd=""
+ use cman && clvmd="cman"
+ #clvmd="${clvmd/cmangulm/all}"
+ [ -z "${clvmd}" ] && clvmd="none"
+ myconf="${myconf} --with-clvmd=${clvmd}"
+ myconf="${myconf} --with-pool=${buildmode}"
+ else
+ myconf="${myconf} --with-clvmd=none --with-cluster=none"
+ fi
+
+ econf \
+ $(use_enable readline) \
+ $(use_enable selinux) \
+ --enable-pkgconfig \
+ --with-confdir="${EPREFIX}/etc" \
+ --sbindir="${EPREFIX}/sbin" \
+ --with-staticdir="${EPREFIX}/sbin" \
+ --libdir="${EPREFIX}/$(get_libdir)" \
+ --with-usrlibdir="${EPREFIX}/usr/$(get_libdir)" \
+ --with-default-run-dir=/run/lvm \
+ --with-default-locking-dir=/run/lock/lvm \
+ --with-dmeventd-path=/sbin/dmeventd \
+ $(use_enable udev udev_rules) \
+ $(use_enable udev udev_sync) \
+ $(use_with udev udevdir "${EPREFIX}/lib/udev/rules.d/") \
+ ${myconf} \
+ CLDFLAGS="${LDFLAGS}" || die
+}
+
+src_compile() {
+ einfo "Doing symlinks"
+ pushd include
+ emake || die "Failed to prepare symlinks"
+ popd
+
+ einfo "Starting main build"
+ emake || die "compile fail"
+}
+
+src_install() {
+ emake DESTDIR="${D}" install || die "Failed to emake install"
+
+ dodoc README VERSION* WHATS_NEW WHATS_NEW_DM doc/*.{conf,c,txt}
+ newinitd "${FILESDIR}"/lvm.rc-2.02.95-r2 lvm || die
+ newinitd "${FILESDIR}"/lvm-monitoring.initd-2.02.67-r2 lvm-monitoring || die
+ newconfd "${FILESDIR}"/lvm.confd-2.02.28-r2 lvm || die
+ if use clvm; then
+ newinitd "${FILESDIR}"/clvmd.rc-2.02.39 clvmd || die
+ newconfd "${FILESDIR}"/clvmd.confd-2.02.39 clvmd || die
+ fi
+
+ # move shared libs to /lib(64)
+ if use static-libs; then
+ dolib.a libdm/ioctl/libdevmapper.a || die "dolib.a libdevmapper.a"
+ #gen_usr_ldscript libdevmapper.so
+ fi
+
+ dosbin "${S}"/scripts/lvm2create_initrd/lvm2create_initrd
+ doman "${S}"/scripts/lvm2create_initrd/lvm2create_initrd.8
+ newdoc "${S}"/scripts/lvm2create_initrd/README README.lvm2create_initrd
+
+ insinto /etc
+ doins "${FILESDIR}"/dmtab
+
+ # Device mapper stuff
+ newinitd "${FILESDIR}"/device-mapper.rc-2.02.95-r2 device-mapper || die
+ newconfd "${FILESDIR}"/device-mapper.conf-1.02.22-r3 device-mapper || die
+
+ newinitd "${FILESDIR}"/dmeventd.initd-2.02.67-r1 dmeventd || die
+ if use static-libs; then
+ dolib.a daemons/dmeventd/libdevmapper-event.a \
+ || die "dolib.a libdevmapper-event.a"
+ #gen_usr_ldscript libdevmapper-event.so
+ fi
+
+ use static-libs || \
+ rm -f "${D}"/usr/$(get_libdir)/{libdevmapper-event,liblvm2cmd,liblvm2app,libdevmapper}.a
+
+ #insinto /etc/udev/rules.d/
+ #newins "${FILESDIR}"/64-device-mapper.rules-2.02.56-r3 64-device-mapper.rules || die
+
+ # do not rely on /lib -> /libXX link
+ sed -i \
+ -e "s|/lib/rcscripts/|/$(get_libdir)/rcscripts/|" \
+ "${ED}"/etc/init.d/* || die
+
+ elog "USE flag nocman is deprecated and replaced"
+ elog "with the cman USE flag."
+ elog ""
+ elog "USE flags clvm and cman are masked"
+ elog "by default and need to be unmasked to be used"
+ elog ""
+ elog "If you are using genkernel and root-on-LVM, rebuild the initramfs."
+}
+
+pkg_postinst() {
+ elog "lvm volumes are no longer automatically created for"
+ elog "baselayout-2 users. If you are using baselayout-2, be sure to"
+ elog "run: # rc-update add lvm boot"
+ elog "Do NOT add it if you are still using baselayout-1."
+}
+
+src_test() {
+ einfo "Testcases disabled because of device-node mucking"
+ einfo "If you want them, compile the package and see ${S}/tests"
+}