summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin H. Johnson <robbat2@gentoo.org>2009-11-05 04:15:10 +0000
committerRobin H. Johnson <robbat2@gentoo.org>2009-11-05 04:15:10 +0000
commit4ff48d8c37087bb55afb96930946ceaea8a2867d (patch)
treec7a7cb6645354e036b3435a5cbbc5a6b48972047 /sys-fs/multipath-tools
parentAutomated update of use.local.desc (diff)
downloadgentoo-2-4ff48d8c37087bb55afb96930946ceaea8a2867d.tar.gz
gentoo-2-4ff48d8c37087bb55afb96930946ceaea8a2867d.tar.bz2
gentoo-2-4ff48d8c37087bb55afb96930946ceaea8a2867d.zip
Bug #268961: kpartx fails on extended partitions, referencing the wrong parent device and offset.
(Portage version: 2.2_rc48/cvs/Linux x86_64)
Diffstat (limited to 'sys-fs/multipath-tools')
-rw-r--r--sys-fs/multipath-tools/ChangeLog10
-rw-r--r--sys-fs/multipath-tools/files/multipath-tools-0.4.8-kparted-ext-partitions.patch28
-rw-r--r--sys-fs/multipath-tools/multipath-tools-0.4.8-r2.ebuild83
3 files changed, 120 insertions, 1 deletions
diff --git a/sys-fs/multipath-tools/ChangeLog b/sys-fs/multipath-tools/ChangeLog
index 8cf89abeedc7..72af3605cc4d 100644
--- a/sys-fs/multipath-tools/ChangeLog
+++ b/sys-fs/multipath-tools/ChangeLog
@@ -1,6 +1,14 @@
# ChangeLog for sys-fs/multipath-tools
# Copyright 1999-2009 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/sys-fs/multipath-tools/ChangeLog,v 1.31 2009/11/04 11:11:03 maekke Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-fs/multipath-tools/ChangeLog,v 1.32 2009/11/05 04:15:09 robbat2 Exp $
+
+*multipath-tools-0.4.8-r2 (05 Nov 2009)
+
+ 05 Nov 2009; Robin H. Johnson <robbat2@gentoo.org>
+ +multipath-tools-0.4.8-r2.ebuild,
+ +files/multipath-tools-0.4.8-kparted-ext-partitions.patch:
+ Bug #268961: kpartx fails on extended partitions, referencing the wrong
+ parent device and offset.
04 Nov 2009; Markus Meier <maekke@gentoo.org>
multipath-tools-0.4.8-r1.ebuild:
diff --git a/sys-fs/multipath-tools/files/multipath-tools-0.4.8-kparted-ext-partitions.patch b/sys-fs/multipath-tools/files/multipath-tools-0.4.8-kparted-ext-partitions.patch
new file mode 100644
index 000000000000..3f70fd70e4c3
--- /dev/null
+++ b/sys-fs/multipath-tools/files/multipath-tools-0.4.8-kparted-ext-partitions.patch
@@ -0,0 +1,28 @@
+From c421c9282791696264d1333fb2552835140354c3 Mon Sep 17 00:00:00 2001
+From: Robin H. Johnson <robbat2@gentoo.org>
+Date: Thu, 5 Nov 2009 03:44:12 +0000
+Subject: [PATCH] kpartx: Fix broken calculation of extended partitions that caused random devices to be used instead of the correct parent device.
+
+Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
+---
+ kpartx/dos.c | 4 +++-
+ 1 files changed, 3 insertions(+), 1 deletions(-)
+
+diff --git a/kpartx/dos.c b/kpartx/dos.c
+index 1691105..317fc56 100644
+--- a/kpartx/dos.c
++++ b/kpartx/dos.c
+@@ -53,7 +53,9 @@ read_extended_partition(int fd, struct partition *ep, int en,
+ if (n < ns) {
+ sp[n].start = here + le32_to_cpu(p.start_sect);
+ sp[n].size = le32_to_cpu(p.nr_sects);
+- sp[n].container = en + 1;
++ // This line seems to have no understandable
++ // purpose, and causes the wrong device to be used
++ //sp[n].container = en + 1;
+ n++;
+ } else {
+ fprintf(stderr,
+--
+1.6.4
+
diff --git a/sys-fs/multipath-tools/multipath-tools-0.4.8-r2.ebuild b/sys-fs/multipath-tools/multipath-tools-0.4.8-r2.ebuild
new file mode 100644
index 000000000000..1592368f60e9
--- /dev/null
+++ b/sys-fs/multipath-tools/multipath-tools-0.4.8-r2.ebuild
@@ -0,0 +1,83 @@
+# Copyright 1999-2009 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-fs/multipath-tools/multipath-tools-0.4.8-r2.ebuild,v 1.1 2009/11/05 04:15:09 robbat2 Exp $
+
+EAPI=2
+inherit eutils toolchain-funcs
+
+DESCRIPTION="Device mapper target autoconfig"
+HOMEPAGE="http://christophe.varoqui.free.fr/"
+SRC_URI="http://christophe.varoqui.free.fr/${PN}/${P}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~ppc ~ppc64 ~x86"
+IUSE=""
+
+RDEPEND="|| (
+ >=sys-fs/lvm2-2.02.45
+ >=sys-fs/device-mapper-1.00.19-r1
+ )
+ >=sys-fs/udev-124
+ sys-fs/sysfsutils
+ dev-libs/libaio"
+DEPEND="${RDEPEND}"
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-0.4.8-build.patch
+ epatch "${FILESDIR}"/${PN}-0.4.8-udev-scsi_id-changes.patch
+ # Patch per upstream tree for 1GiB limit of kpartx
+ epatch "${FILESDIR}"/${PN}-0.4.8-r1-kpartx.patch
+ # CVE-2009-0115, world writable socket
+ epatch "${FILESDIR}"/${PN}-0.4.8-socket-cve-2009-0115.patch
+ # kpartx fails on extended partitions
+ epatch "${FILESDIR}"/${PN}-0.4.8-kparted-ext-partitions.patch
+}
+
+src_compile() {
+ # The -j1 is NOT a joke. The 0.4.8-era upstream code rebuilds several object
+ # files with different compiler defines. The upstream git, as yet unreleased
+ # moves to proper automake, but it's a large jump and is not being
+ # backported to 0.4.8.
+ emake -j1 CC="$(tc-getCC)" || die "emake failed"
+}
+
+src_install() {
+ dodir /sbin /usr/share/man/man8
+ make DESTDIR="${D}" install || die "install failed"
+
+ insinto /etc
+ newins "${S}"/multipath.conf.annotated multipath.conf
+ fperms 644 /etc/udev/rules.d/65-multipath.rules
+ fperms 644 /etc/udev/rules.d/66-kpartx.rules
+ # This is the monitoring daemon
+ newinitd "${FILESDIR}"/rc-multipathd multipathd
+ # This is the init script that fires the multipath addon for baselayout2
+ newinitd "${FILESDIR}"/init.d-multipath-0.4.8-r1 multipath
+ # Handle early-boot startup as well as shutdown of multipath devices
+ insinto /lib/rcscripts/addons
+ doins "${FILESDIR}"/multipath-start.sh
+ doins "${FILESDIR}"/multipath-stop.sh
+
+ dodoc multipath.conf.*
+ dodoc AUTHOR ChangeLog FAQ README TODO
+ docinto kpartx; dodoc kpartx/ChangeLog kpartx/README
+}
+
+pkg_preinst() {
+ # The dev.d script was previously wrong and is now removed (the udev rules
+ # file does the job instead), but it won't be removed from live systems due
+ # to cfgprotect.
+ # This should help out a little...
+ if [[ -e ${ROOT}/etc/dev.d/block/multipath.dev ]] ; then
+ mkdir -p "${D}"/etc/dev.d/block
+ echo "# Please delete this file. It is obsoleted by /etc/udev/rules.d/65-multipath.rules" \
+ > "${D}"/etc/dev.d/block/multipath.dev
+ fi
+}
+pkg_postinst() {
+ elog "If you need multipath on your system, you should ensure that a"
+ elog "'multipath' entry is present in your RC_VOLUME_ORDER variable!"
+ elog "If you use baselayout2, you must add 'multipath' into"
+ elog "your boot runlevel!"
+}