File os-prober-accept-ESP-on-IMSM.patch of Package os-prober.1605

Index: os-prober-1.61/os-probes/mounted/x86/05efi
===================================================================
--- os-prober-1.61.orig/os-probes/mounted/x86/05efi
+++ os-prober-1.61/os-probes/mounted/x86/05efi
@@ -28,20 +28,31 @@ if type udevadm > /dev/null 2>&1; then
 fi
 
 if type udevinfo > /dev/null 2>&1; then
-	# Skip virtual devices
+	eval "$(udevinfo -q property -n "$partition" | grep -E '^(MD_CONTAINER|ID_PART_ENTRY_(TYPE|SCHEME))=')"
+	debug "$partition container is '$MD_CONTAINER'"
+
+	# Skip virtual devices unless they are known SW-RAID
 	if udevinfo -q path -n $partition | grep -q /virtual/; then
-		debug "$1 is virtual device: exiting"
-		exit 1
+		# Check for Intel Matrix array
+		if [ -n "$MD_CONTAINER" ]; then 
+			eval "$(udevinfo -q property -n "$MD_CONTAINER" | grep -E '^MD_METADATA=')"
+			debug "$MD_CONTAINER metadata is '$MD_METADATA'"
+		fi
+		if [ "$MD_METADATA" = imsm ]; then
+			debug "$partition is on IMSM array"
+		else
+			debug "$1 is virtual device: exiting"
+			exit 1
+		fi
 	fi
 
-	eval "$(udevinfo -q property -n "$partition" | grep -E '^ID_PART_ENTRY_(TYPE|SCHEME)=')"
 	debug "$partition partition scheme is $ID_PART_ENTRY_SCHEME"
 	debug "$partition partition type is $ID_PART_ENTRY_TYPE"
 
 	if [ -z "$ID_PART_ENTRY_TYPE" -o -z "$ID_PART_ENTRY_SCHEME" -o \
-		\( "$ID_PART_ENTRY_SCHEME" != gpt -a "$ID_PART_ENTRY_SCHEME" != msdos \) -o \
+		\( "$ID_PART_ENTRY_SCHEME" != gpt -a "$ID_PART_ENTRY_SCHEME" != dos \) -o \
 		\( "$ID_PART_ENTRY_SCHEME" = gpt -a "$ID_PART_ENTRY_TYPE" != c12a7328-f81f-11d2-ba4b-00a0c93ec93b \) -o \
-		\( "$ID_PART_ENTRY_SCHEME" = msdos -a "$ID_PART_ENTRY_TYPE" != 0xef \) ]; then
+		\( "$ID_PART_ENTRY_SCHEME" = dos -a "$ID_PART_ENTRY_TYPE" != 0xef \) ]; then
 		debug "$partition is not a ESP partition: exiting"
 		exit 1
 	fi
openSUSE Build Service is sponsored by