[Dmraid-debian-commits] [SCM] Maintenance of the dmraid package branch, master, updated. debian/1.0.0.rc16-3-2-g8d857ed

Giuseppe Iuculano iuculano at debian.org
Mon Nov 22 12:16:53 UTC 2010


The following commit has been merged in the master branch:
commit 7b2bf79b870efdddb3941e4e82fe5eca4b715a81
Author: Modestas Vainius <modax at debian.org>
Date:   Mon Nov 22 13:00:34 2010 +0100

    Make dmraid-activate work with DDF1 arrays by special-casing their handling. Similar to ISW case, there do not seem to be a way for getting raid subsets for the physical drive except parsing native log.
    
    Closes: #603319

diff --git a/debian/dmraid-activate b/debian/dmraid-activate
index f609a9d..7e73473 100644
--- a/debian/dmraid-activate
+++ b/debian/dmraid-activate
@@ -116,6 +116,58 @@ log_error()
 	fi
 }
 
+ddf1_virtual_drive_guids()
+{
+	ddf1_awk_script=$(cat <<'EOF'
+BEGIN {
+    section = ""
+    disk_ref = ""
+    guid_i = 0
+}
+
+function section_begins(name)
+{
+    section = name
+    vd_guid = ""
+    drive_map = 0
+}
+
+{
+    if (!/^0x/ && / at /) {
+        # Section begins
+        section_begins(substr($0, 1, match($0, / at /)-1))
+    } else if (section == "Disk Data" && /^0x020 reference:[ \t]*[0-9A-Fx]+/) {
+        disk_ref = $3
+        sub(/^0x/, "", disk_ref)
+    } else if (disk_ref) {
+        if (section == "Virtual Drive Config Record" && /^0x008 guid:/) {
+            vd_guid = substr($0, match($0,/\[[0-9a-f ]+\]$/)+1, RLENGTH-2)
+            gsub(/ /, "", vd_guid)
+            # IF LSI, do timestamp substitution to get persistent name, see
+            # 19_ddf1_lsi_persistent_name.patch
+            if (vd_guid ~ /^4c5349/)
+                vd_guid = substr(vd_guid, 1, 32) "47114711" substr(vd_guid, 41)
+        } else if (drive_map) {
+            # 0: 4BCBB980 @ 0
+            if ($2 == disk_ref) {
+                guids[guid_i] = vd_guid
+                guid_i++
+            }
+        } else if (vd_guid) {
+            drive_map = /^Drive map:/
+        }
+    }
+}
+END {
+    # Print discovered virtual drive GUIDs which belong to this physical drive
+    for (guid in guids)
+        print guids[guid]
+}
+EOF
+)
+	dmraid -i -n "$1" | awk "$ddf1_awk_script"
+}
+
 if grep -qs "\<nodmraid\>" /proc/cmdline; then
 	log_warning "dmraid disabled by boot option"
 	exit 0
@@ -141,10 +193,10 @@ if [ -z "$Raid_Name" ]; then
 	exit 0
 fi
 
-# We need a special case for isw arrays, since it is possible to have several
-# subsets of a RAID group, of varying RAID types.
 case "$Raid_Name" in
 	isw_*)
+		# We need a special case for isw arrays, since it is possible to have several
+		# subsets of a RAID group, of varying RAID types.
 		Isw_Group_Name=$Raid_Name
 		Isw_Subsets=$(dmraid -i -n "/dev/$Node_Name" | grep volume | sed 's/.*volume: " *\(.*\)"$/\1/')
 
@@ -154,6 +206,17 @@ case "$Raid_Name" in
 		done
 		break
 		;;
+	.ddf1_disks)
+		# Dummy name for the main DDF1 group. Needs special handling to
+		# find RAID subsets for this physical drive
+		Ddf1_guids=`ddf1_virtual_drive_guids "/dev/$Node_Name"`
+
+		for ddf1_guid in $Ddf1_guids
+		do
+			activate_array "ddf1_${ddf1_guid}"
+		done
+		break
+		;;
 	*)
 		activate_array "$Raid_Name"
 		break

-- 
Maintenance of the dmraid package



More information about the Dmraid-debian-commits mailing list