[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#442236: marked as done (please add multipath support)



Your message dated Wed, 19 Mar 2008 21:02:32 +0000
with message-id <E1Jc5Qe-0006Sg-71@ries.debian.org>
and subject line Bug#442236: fixed in partman-base 117
has caused the Debian Bug report #442236,
regarding please add multipath support
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact owner@bugs.debian.org
immediately.)


-- 
442236: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=442236
Debian Bug Tracking System
Contact owner@bugs.debian.org with problems
--- Begin Message ---
Package: partman-base
Severity: wishlist
Tags: patch

Hi,
the attached patch against current d-i svn adds multipath support in an
(hopefully) unintrusive way. Please apply. This together with the
already posted patches to parted an hw-detect as well as the
parted-multipath udeb will allow the installer to work on multipathed
block devices up to the grub install part.
Cheers,
 -- Guido


-- System Information:
Debian Release: lenny/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (500, 'testing')
Architecture: powerpc (ppc)

Kernel: Linux 2.6.23-rc5-g3a1bc03a-dirty
Locale: LANG=de_DE.UTF-8, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
diff --git a/packages/partman/partman-base/debian/partman-base.templates b/packages/partman/partman-base/debian/partman-base.templates
index f48d99a..59e12c7 100644
--- a/packages/partman/partman-base/debian/partman-base.templates
+++ b/packages/partman/partman-base/debian/partman-base.templates
@@ -295,6 +295,14 @@ Type: text
 # For example: Serial ATA RAID isw_dhiiedgihc_Volume01 (partition #1)
 _Description: Serial ATA RAID %s (partition #%s)
 
+Template: partman/text/multipath
+Type: text
+_Description: Multipath %s (WWID %s)
+
+Template: partman/text/multipath_partition
+Type: text
+_Description: Multipath %s Partition #%s
+
 Template: partman/text/lvm_lv
 Type: text
 _Description: LVM VG %s, LV %s
diff --git a/packages/partman/partman-base/definitions.sh b/packages/partman/partman-base/definitions.sh
index bedd9d1..e16e453 100644
--- a/packages/partman/partman-base/definitions.sh
+++ b/packages/partman/partman-base/definitions.sh
@@ -478,13 +478,41 @@ log () {
 	echo $0: "$@" >>/var/log/partman
 }
 
+
+# return the device mapper table type
+dm_table ()
+{
+    type=""
+    if [ -x /sbin/dmsetup ]; then
+        type=$(/sbin/dmsetup table "$1" | head -n 1 | cut -d " " -f3)
+    fi
+    echo $type
+}
+
+# Check if a device is the partition on a multipath'ed device by getting the
+# corresponding mp map exists
+multipath_part ()
+{
+	type multipath >/dev/null 2>&1 || return 1
+
+	type=$(dm_table $1)
+	[ "$type" = linear ] || return 1
+	name=$(dmsetup info --noheadings -c -oname "$1")
+
+	mp=${name%-part*}
+	if [ $(multipath -l $mp | wc -l) -gt  0 ]; then
+		return 0
+	fi
+	return 1
+}
+
 ####################################################################
 # The functions below are not yet documented
 ####################################################################
 
 # TODO: this should not be global
 humandev () {
-    local host bus target part lun idenum targtype scsinum linux
+    local host bus target part lun idenum targtype scsinum linux wwid
     case "$1" in
 	/dev/ide/host*/bus[01]/target[01]/lun0/disc)
 	    host=`echo $1 | sed 's,/dev/ide/host\(.*\)/bus.*/target[01]/lun0/disc,\1,'`
@@ -684,10 +712,7 @@ humandev () {
 	    printf "$RET" ${type} ${device}
 	    ;;
 	/dev/mapper/*)
-	    type=""
-	    if [ -x /sbin/dmsetup ]; then
-	        type=$(/sbin/dmsetup table "$1" | head -n 1 | cut -d " " -f3)
-	    fi
+	    type=$(dm_table "$1")
 
 	    # First check for Serial ATA RAID devices
 	    if type dmraid >/dev/null 2>&1; then
@@ -718,6 +743,16 @@ humandev () {
 	        mapping=${1#/dev/mapper/}
 	        db_metaget partman/text/dmcrypt_volume description
 	        printf "$RET" $mapping
+	    elif [ "$type" = multipath ]; then
+	    	device=${1#/dev/mapper/}
+	    	wwid=$(multipath -l ${device} | head -n 1 | sed "s/^${device} \+(\([a-f0-9]\+\)).*/\1/")
+	    	db_metaget partman/text/multipath description
+	    	printf "$RET" ${device} ${wwid}
+	    elif multipath_part $1; then
+	    	part=$(echo "$1" | sed 's%.*-part\([0-9]\+\)$%\1%')
+	    	device=$(echo "$1" | sed 's%/dev/mapper/\(.*\)-part[0-9]\+$%\1%')
+	    	db_metaget partman/text/multipath_partition description
+	    	printf "$RET" ${device} ${part}
 	    else
 	        # LVM2 devices are found as /dev/mapper/<vg>-<lv>.  If the vg
 	        # or lv contains a dash, the dash is replaced by two dashes.
@@ -1079,8 +1114,13 @@ confirm_changes () {
 			filesystem=$(cat $id/visual_filesystem)
 			# Special case d-m devices to use a different description
 			if cat device | grep -q "/dev/mapper" ; then
-				partdesc="partman/text/confirm_unpartitioned_item"
-			else
+				type=$(dm_table $device)
+				# multipath devices are partitioned
+				if [  "$type" != multipath ] -a ! multipath_part $device; then
+					partdesc="partman/text/confirm_unpartitioned_item"
+				fi
+			fi
+			if [ -z "$partdesc" ]; then
 				partdesc="partman/text/confirm_item"
 				db_subst $partdesc PARTITION "$num"
 			fi
diff --git a/packages/partman/partman-base/init.d/parted b/packages/partman/partman-base/init.d/parted
index b7d5c7a..bff8139 100755
--- a/packages/partman/partman-base/init.d/parted
+++ b/packages/partman/partman-base/init.d/parted
@@ -16,6 +16,25 @@ part_of_sataraid () {
 	return 1
 }
 
+part_of_multipath() {
+	local mpdev
+	type multipath >/dev/null 2>&1 || return 1
+
+	if multipath_part $1; then
+		return 0
+	fi
+	# The block devices that make up the multipath:
+	# Output looks like \_ 4:0:0:1 sdc 8:32 ...
+	for mpdev in $(multipath -l | \
+	               grep '_ \([0-9]\+:\)\{3\}[0-9]\+ sd[a-z]\+ [0-9]\+:[0-9]\+' | \
+		       cut -f4 -d' '); do
+		if [ "$(readlink -f /dev/$mpdev)" = $1 ]; then
+			return 0
+		fi
+	done
+	return 1
+}
+
 if [ ! -f /var/run/parted_server.pid ]; then
     mkdir -p /var/run
     parted_server
@@ -50,6 +69,10 @@ if [ ! -f /var/run/parted_server.pid ]; then
 			continue
 		fi
 	fi
+	# Skip devices that are part of a multipathed device
+	if part_of_multipath $partdev; then
+		continue
+	fi
 
 	dirname=$(echo $1 | sed 's:/:=:g')
 	dev=$DEVICES/$dirname

--- End Message ---
--- Begin Message ---
Source: partman-base
Source-Version: 117

We believe that the bug you reported is fixed in the latest version of
partman-base, which is due to be installed in the Debian FTP archive:

partman-base_117.dsc
  to pool/main/p/partman-base/partman-base_117.dsc
partman-base_117.tar.gz
  to pool/main/p/partman-base/partman-base_117.tar.gz
partman-base_117_amd64.udeb
  to pool/main/p/partman-base/partman-base_117_amd64.udeb
partman-utils_117_amd64.udeb
  to pool/main/p/partman-base/partman-utils_117_amd64.udeb



A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 442236@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Frans Pop <fjp@debian.org> (supplier of updated partman-base package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@debian.org)


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Format: 1.7
Date: Wed, 19 Mar 2008 20:58:08 +0100
Source: partman-base
Binary: partman-base partman-utils
Architecture: source amd64
Version: 117
Distribution: unstable
Urgency: low
Maintainer: Debian Install System Team <debian-boot@lists.debian.org>
Changed-By: Frans Pop <fjp@debian.org>
Description: 
 partman-base - Partition the storage devices (partman) (udeb)
 partman-utils - Utilities related to partitioning (udeb)
Closes: 442236
Changes: 
 partman-base (117) unstable; urgency=low
 .
   [ Colin Watson ]
   * Don't emit confusing log messages if partman-lvm or partman-crypto are
     already loaded.
   * Support preseeding questions asked through ask_user using the name of
     the plugin responsible for the answer you want (e.g.
     partman-auto/init_automatically_partition=biggest_free).
   * Fix parted_devices check for floppy devices, broken by me in
     partman-base 100 (sorry!).
   * Allow disable_swap to take a device argument, in which case it only
     disables swap on that device rather than on all devices.
   * Only disable swap on devices that are being changed.
 .
   [ Guido Guenther ]
   * Add multipath support (closes: #442236):
     - recognize and display multipath devices
     - skip physical disks that are part of a multipath device
 .
   [ Frans Pop ]
   * Drop the compatibility symlink for definitions.sh; all other partman
     components have now been uploaded.
   * Change "initialise" to American English spelling (-ize).
 .
   [ Updated translations ]
   * Amharic (am.po) by Tegegne Tefera
   * Arabic (ar.po) by Ossama M. Khayat
   * Bulgarian (bg.po) by Damyan Ivanov
   * Czech (cs.po) by Miroslav Kure
   * Esperanto (eo.po) by Serge Leblanc
   * Basque (eu.po) by Piarres Beobide
   * Finnish (fi.po) by Esko Arajärvi
   * French (fr.po) by Christian Perrier
   * Galician (gl.po) by Jacobo Tarrio
   * Indonesian (id.po) by Arief S Fitrianto
   * Japanese (ja.po) by Kenshi Muto
   * Korean (ko.po) by Changwoo Ryu
   * Dutch (nl.po) by Frans Pop
   * Panjabi (pa.po) by Amanpreet Singh Alam
   * Polish (pl.po) by Bartosz Fenski
   * Portuguese (Brazil) (pt_BR.po) by Felipe Augusto van de Wiel (faw)
   * Portuguese (pt.po) by Miguel Figueiredo
   * Russian (ru.po) by Yuri Kozlov
   * Slovak (sk.po) by Ivan Masár
   * Swedish (sv.po) by Daniel Nylander
   * Thai (th.po) by Theppitak Karoonboonyanan
Files: 
 dcc7df62622c0526d7b7284adff0f074 782 debian-installer standard partman-base_117.dsc
 3dd5925418c4768e8853f88870f47f51 148397 debian-installer standard partman-base_117.tar.gz
 2794a0c8210115ec680f5d12fbe6c4cd 127908 debian-installer standard partman-base_117_amd64.udeb
 54ad4f047597e10b09413e23bc0f0b7c 3716 debian-installer extra partman-utils_117_amd64.udeb
Package-Type: udeb

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFH4XE+gm/Kwh6ICoQRAmwoAKCorzyYg4QE+C3tPYjFNF4voQ+XcQCfRIJa
IJxxtAxyLQuNy29dQr+iB64=
=LhTN
-----END PGP SIGNATURE-----



--- End Message ---

Reply to: