03b69a
diff --git a/common.sh b/common.sh
03b69a
index c2c5f46..8fb3c5f 100644
03b69a
--- a/common.sh
03b69a
+++ b/common.sh
03b69a
@@ -155,6 +155,7 @@ parse_proc_mounts () {
03b69a
 	done
03b69a
 }
03b69a
 
03b69a
+# add forth parameter to pickup btrfs subvol info
03b69a
 parsefstab () {
03b69a
 	while read -r line; do
03b69a
 		case "$line" in
03b69a
@@ -165,12 +166,22 @@ parsefstab () {
03b69a
 				set -f
03b69a
 				set -- $line
03b69a
 				set +f
03b69a
-				printf '%s %s %s\n' "$1" "$2" "$3"
03b69a
+				printf '%s %s %s %s\n' "$1" "$2" "$3" "$4"
03b69a
 			;;
03b69a
 		esac
03b69a
 	done
03b69a
 }
03b69a
 
03b69a
+#check_btrfs_mounted $bootsv $bootuuid)
03b69a
+check_btrfs_mounted () {
03b69a
+	bootsv="$1"
03b69a
+	bootuuid="$2"
03b69a
+	bootdev=$(blkid | grep "$bootuuid" | cut -d ':' -f  1)
03b69a
+	bindfrom=$(grep " btrfs " /proc/self/mountinfo |
03b69a
+		   grep " $bootdev " | grep " /$bootsv " | cut -d ' ' -f 5)
03b69a
+	printf "%s" "$bindfrom"
03b69a
+}
03b69a
+
03b69a
 unescape_mount () {
03b69a
 	printf %s "$1" | \
03b69a
 		sed 's/\\011/	/g; s/\\012/\n/g; s/\\040/ /g; s/\\134/\\/g'
03b69a
diff --git a/linux-boot-prober b/linux-boot-prober
03b69a
index e32dc84..2a60fa2 100755
03b69a
--- a/linux-boot-prober
03b69a
+++ b/linux-boot-prober
03b69a
@@ -5,16 +5,143 @@ set -e
03b69a
 
03b69a
 newns "$@"
03b69a
 require_tmpdir
03b69a
+ERR="n"
03b69a
+
03b69a
+tmpmnt=/var/lib/os-prober/mount
03b69a
+if [ ! -d "$tmpmnt" ]; then
03b69a
+	mkdir "$tmpmnt"
03b69a
+fi
03b69a
+
03b69a
+mounted=
03b69a
+bootmnt=
03b69a
+bootsv=
03b69a
+bootuuid=
03b69a
 
03b69a
 grep "^/dev/" /proc/mounts | parse_proc_mounts >"$OS_PROBER_TMP/mounted-map" || true
03b69a
 
03b69a
-partition="$1"
03b69a
+if [ -z "$1" ]; then
03b69a
+	ERR=y
03b69a
+elif [ "$1" = btrfs -a -z "$2" ]; then
03b69a
+	ERR=y
03b69a
+elif [ "$1" = btrfs -a -z "$3" ]; then
03b69a
+	ERR=y
03b69a
+elif [ "$1" = btrfs ]; then
03b69a
+	type=btrfs
03b69a
+	echo "$2" | grep -q "^UUID=" || ERR=y
03b69a
+	echo "$3" | grep -q "^subvol=" || ERR=y
03b69a
+	export "$2"
03b69a
+	export "$3"
03b69a
+	partition=$(blkid | grep "$UUID" | cut -d ':' -f 1 | tr '\n' ' ' | cut -d ' ' -f 1)
03b69a
+	debug "btrfs: partition=$partition, UUID=$UUID, subvol=$subvol"
03b69a
+else
03b69a
+	partition="$1"
03b69a
+	type=other
03b69a
+fi
03b69a
 
03b69a
-if [ -z "$partition" ]; then
03b69a
+if [ "x$ERR" != xn ]; then
03b69a
 	echo "usage: linux-boot-prober partition" >&2
03b69a
+	echo "       linux-boot-prober btrfs UUID=<> subvol=<>" >&2
03b69a
 	exit 1
03b69a
 fi
03b69a
 
03b69a
+if [ "$type" = btrfs ]; then
03b69a
+	# handle all of the btrfs stuff here
03b69a
+	if [ ! -e "/proc/self/mountinfo" ]; then
03b69a
+		warn "/proc/self/mountinfo does not exist, exiting"
03b69a
+		umount "$tmpmnt" 2>/dev/null
03b69a
+		rmdir "$tmpmnt" 2>/dev/null
03b69a
+		exit 1
03b69a
+	fi
03b69a
+	mpoint=$(grep "btrfs" /proc/self/mountinfo | grep " /$subvol " | grep " $partition " | cut -d ' ' -f 5)
03b69a
+	if [ "$mpoint" = "/" ]; then
03b69a
+		warn "specifying active root not valid, exiting"
03b69a
+		umount "$tmpmnt" 2>/dev/null
03b69a
+		rmdir "$tmpmnt" 2>/dev/null
03b69a
+		exit 1
03b69a
+	fi
03b69a
+	if [ "$mpoint" = "$tmpmnt" ]; then
03b69a
+		warn "btrfs subvol=$subvool, UUID=$UUID, already mounted on $tmpmnt **ERROR**"
03b69a
+		umount "$tmpmnt" 2>/dev/null
03b69a
+		rmdir "$tmpmnt" 2>/dev/null
03b69a
+		exit 1
03b69a
+	fi
03b69a
+	if [ -z "$mpoint" ]; then
03b69a
+		# mount the btrfs root
03b69a
+		if ! mount -o subvol=$subvol -t btrfs -U $UUID "$tmpmnt" 2>/dev/null; then
03b69a
+			warn "error mounting btrfs subvol=$subvol UUID=$UUID"
03b69a
+			umount "$tmpmnt/boot" 2>/dev/null
03b69a
+			umount "$tmpmnt" 2>/dev/null
03b69a
+			rmdir "$tmpmnt" 2>/dev/null
03b69a
+			exit 1
03b69a
+		fi
03b69a
+	else
03b69a
+		# bind-mount
03b69a
+		if ! mount -o bind "$mpoint" "$tmpmnt" 2>/dev/null; then
03b69a
+			warn "error mounting btrfs bindfrom=$mpoint subvol=$subvol UUID=$UUID"
03b69a
+			umount "$tmpmnt/boot" 2>/dev/null
03b69a
+			umount "$tmpmnt" 2>/dev/null
03b69a
+			rmdir "$tmpmnt" 2>/dev/null
03b69a
+			exit 1
03b69a
+		fi
03b69a
+	fi
03b69a
+	debug "mounted btrfs $partition, subvol=$subvol on $tmpmnt"
03b69a
+	if [ ! -e "$tmpmnt/etc/fstab" ]; then
03b69a
+		warn "btrfs subvol=$subvol not root"
03b69a
+		umount "$tmpmnt" 2>/dev/null
03b69a
+		rmdir "$tmpmnt" 2>/dev/null
03b69a
+		exit 1
03b69a
+	fi
03b69a
+	bootmnt=$(parsefstab < "$tmpmnt/etc/fstab" | grep " /boot ") || true
03b69a
+	if [ -z "$bootmnt" ]; then
03b69a
+		# /boot is part of the root
03b69a
+		bootpart="$partition"
03b69a
+		bootsv="$subvol"
03b69a
+	elif echo "$bootmnt" | cut -d ' ' -f 3 | grep -q "btrfs"; then
03b69a
+		# separate btrfs /boot subvolume
03b69a
+		bootsv=$(echo "$bootmnt" | cut -d ' ' -f 4 | grep "^subvol=" | sed "s/subvol=//" )
03b69a
+		bootuuid=$(echo "$bootmnt" | cut -d ' ' -f 1 | grep "^UUID=" | sed "s/UUID=//" )
03b69a
+		debug "mounting btrfs $tmpmnt/boot UUID=$bootuuid subvol=$bootsv"
03b69a
+		bindfrom=$(check_btrfs_mounted $bootsv $bootuuid)
03b69a
+		if [ -n "$bindfrom" ]; then
03b69a
+			# already mounted some place
03b69a
+			if ! mount -o bind $bindfrom "$tmpmnt/boot" 2>/dev/null; then
03b69a
+				warn "error bind mounting btrfs boot subvol=$bootsv, from=$bindfrom"
03b69a
+				umount "$tmpmnt/boot" 2>/dev/null
03b69a
+				umount "$tmpmnt" 2>/dev/null
03b69a
+				rmdir "$tmpmnt" 2>/dev/null
03b69a
+				exit 1
03b69a
+			fi
03b69a
+		elif ! mount -o subvol=$bootsv -t btrfs -U $bootuuid "$tmpmnt/boot" 2>/dev/null; then
03b69a
+			warn "error mounting btrfs boot partition subvol=$bootsv, UUID=$bootuuid"
03b69a
+			umount "$tmpmnt/boot" 2>/dev/null
03b69a
+			umount "$tmpmnt" 2>/dev/null
03b69a
+			rmdir "$tmpmnt" 2>/dev/null
03b69a
+			exit 1
03b69a
+		fi
03b69a
+		bootpart=$(grep " btrfs " /proc/self/mountinfo | grep " /$bootsv " | cut -d ' ' -f 10)
03b69a
+	else
03b69a
+		# non-btrfs partition or logical volume
03b69a
+		linux_mount_boot $partition $tmpmnt
03b69a
+		bootpart="${mountboot%% *}"
03b69a
+		bootsv=
03b69a
+	fi
03b69a
+
03b69a
+	test="/usr/lib/linux-boot-probes/mounted/40grub2"
03b69a
+	if [ -f $test ] && [ -x $test ]; then
03b69a
+		debug "running $test $partition $bootpart $tmpmnt $type $subvol $bootsv"
03b69a
+		if $test "$partition" "$bootpart" "$tmpmnt" "$type" "$subvol" "$bootsv"; then
03b69a
+			debug "$test succeeded"
03b69a
+		fi
03b69a
+	fi
03b69a
+	umount "$tmpmnt/boot" 2>/dev/null || true
03b69a
+	if ! umount "$tmpmnt" 2>/dev/null; then
03b69a
+		warn "problem umount $tmpmnt"
03b69a
+	fi
03b69a
+	rmdir "$tmpmnt" 2>/dev/null || true
03b69a
+
03b69a
+	exit 0
03b69a
+fi
03b69a
+
03b69a
 if ! mapped="$(mapdevfs "$partition")"; then
03b69a
 	log "Device '$partition' does not exist; skipping"
03b69a
 	continue
03b69a
@@ -22,8 +149,8 @@ fi
03b69a
 
03b69a
 if ! grep -q "^$mapped " "$OS_PROBER_TMP/mounted-map"; then
03b69a
 	for test in /usr/lib/linux-boot-probes/*; do
03b69a
-		debug "running $test"
03b69a
 		if [ -x $test ] && [ -f $test ]; then
03b69a
+			debug "running $test"
03b69a
 			if $test "$partition"; then
03b69a
 				debug "linux detected by $test"
03b69a
 				break
03b69a
diff --git a/linux-boot-probes/mounted/common/40grub2 b/linux-boot-probes/mounted/common/40grub2
03b69a
index 885614e..db5cbfd 100755
03b69a
--- a/linux-boot-probes/mounted/common/40grub2
03b69a
+++ b/linux-boot-probes/mounted/common/40grub2
03b69a
@@ -2,17 +2,30 @@
03b69a
 . /usr/share/os-prober/common.sh
03b69a
 set -e
03b69a
 
03b69a
+# add support for btrfs with no separate /boot
03b69a
+# that is, rootsv = bootsv
03b69a
 partition="$1"
03b69a
 bootpart="$2"
03b69a
 mpoint="$3"
03b69a
 type="$4"
03b69a
+rootsv="$5"
03b69a
+bootsv="$6"
03b69a
 
03b69a
 found_item=0
03b69a
 
03b69a
 entry_result () {
03b69a
+	if [ "x$type" = "xbtrfs" -a "$partition" = "$bootpart" ]; then
03b69a
+		# trim off the leading subvol
03b69a
+		kernelfile=$(echo "$kernel" | cut -d '/' -f 2- | cut -d '/' -f 2-)
03b69a
+		if [ "x$rootsv" != "x$bootsv" ]; then
03b69a
+		   kernelfile="/boot/$kernelfile"
03b69a
+		fi
03b69a
+	else
03b69a
+		kernelfile=$kernel
03b69a
+	fi
03b69a
 	if [ "$ignore_item" = 0 ] && \
03b69a
 	   [ -n "$kernel" ] && \
03b69a
-	   [ -e "$mpoint/$kernel" ]; then
03b69a
+	   [ -e "$mpoint/$kernelfile" ]; then
03b69a
 		result "$rootpart:$bootpart:$title:$kernel:$initrd:$parameters"
03b69a
 		found_item=1
03b69a
 	fi
03b69a
diff --git a/os-prober b/os-prober
03b69a
index 8852887..482c3c2 100755
03b69a
--- a/os-prober
03b69a
+++ b/os-prober
03b69a
@@ -76,9 +76,12 @@ partitions () {
03b69a
 
03b69a
 	# Also detect OSes on LVM volumes (assumes LVM is active)
03b69a
 	if type lvs >/dev/null 2>&1; then
03b69a
-		echo "$(LVM_SUPPRESS_FD_WARNINGS=1 log_output lvs --noheadings --separator : -o vg_name,lv_name |
03b69a
+		echo "$(LVM_SUPPRESS_FD_WARNINGS=1 log_output lvs --noheadings --separator : -o vg_name,lv_name 2>/dev/null |
03b69a
 			sed "s|-|--|g;s|^[[:space:]]*\(.*\):\(.*\)$|/dev/mapper/\1-\2|")"
03b69a
 	fi
03b69a
+
03b69a
+	# now lets make sure we got all of the btrfs partitions and disks
03b69a
+	blkid | grep 'TYPE="btrfs"' | cut -d ':' -f 1
03b69a
 }
03b69a
 
03b69a
 parse_proc_swaps () {
03b69a
@@ -136,6 +139,8 @@ if [ -f /proc/mdstat ] ; then
03b69a
 	grep "^md" /proc/mdstat | cut -d: -f2- | parse_proc_mdstat >"$OS_PROBER_TMP/raided-map" || true
03b69a
 fi
03b69a
 
03b69a
+: >"$OS_PROBER_TMP/btrfs-vols"
03b69a
+
03b69a
 for partition in $(partitions); do
03b69a
 	if ! mapped="$(mapdevfs "$partition")"; then
03b69a
 		log "Device '$partition' does not exist; skipping"
03b69a
@@ -154,7 +159,26 @@ for partition in $(partitions); do
03b69a
 		continue
03b69a
 	fi
03b69a
 
03b69a
-	if ! grep -q "^$mapped " "$OS_PROBER_TMP/mounted-map" ; then
03b69a
+	# do btrfs processing here; both mounted and unmounted will
03b69a
+	# be handled by 50mounted-tests so we can do a subvol only once.
03b69a
+	type=$(blkid -o value -s TYPE $mapped || true)
03b69a
+	if [ "$type" = btrfs ]; then
03b69a
+		uuid=$(blkid -o value -s UUID $mapped)
03b69a
+		if grep -q "^$uuid" "$OS_PROBER_TMP/btrfs-vols" ; then
03b69a
+			continue
03b69a
+		fi
03b69a
+		debug "btrfs volume uuid=$uuid partition=$partition"
03b69a
+		echo "$uuid" >>"$OS_PROBER_TMP/btrfs-vols"
03b69a
+		test="/usr/lib/os-probes/50mounted-tests"
03b69a
+		if [ -f "$test" ] && [ -x "$test" ]; then
03b69a
+			debug "running $test on btrfs $partition"
03b69a
+			if "$test" btrfs "$uuid" "$partition"; then
03b69a
+				debug "os detected by $test"
03b69a
+				continue
03b69a
+			fi
03b69a
+		fi
03b69a
+
03b69a
+	elif ! grep -q "^$mapped " "$OS_PROBER_TMP/mounted-map" ; then
03b69a
 		for test in /usr/lib/os-probes/*; do
03b69a
 			if [ -f "$test" ] && [ -x "$test" ]; then
03b69a
 				debug "running $test on $partition"
03b69a
diff --git a/os-probes/common/50mounted-tests b/os-probes/common/50mounted-tests
03b69a
index 2951ef9..e33eb82 100755
03b69a
--- a/os-probes/common/50mounted-tests
03b69a
+++ b/os-probes/common/50mounted-tests
03b69a
@@ -19,19 +19,31 @@ do_unmount() {
03b69a
 	rmdir "$tmpmnt" || true
03b69a
 }
03b69a
 
03b69a
-types="$(fs_type "$partition")"
03b69a
+if [ "x$1" = xbtrfs ]; then
03b69a
+	types=btrfs
03b69a
+	if [ -z "$2" -o -z "$3" ]; then
03b69a
+		debug "missing btrfs parameters, exiting"
03b69a
+		exit 1
03b69a
+	fi
03b69a
+	UUID="$2"
03b69a
+	BTRFSDEV="$3"
03b69a
+else
03b69a
+	partition="$1"
03b69a
+	types="$(fs_type "$partition")" || types=NOT-DETECTED
03b69a
+fi
03b69a
+
03b69a
 if [ "$types" = NOT-DETECTED ]; then
03b69a
 	debug "$1 type not recognised; skipping"
03b69a
-	exit 0
03b69a
+	exit 1
03b69a
 elif [ "$types" = swap ]; then
03b69a
 	debug "$1 is a swap partition; skipping"
03b69a
-	exit 0
03b69a
+	exit 1
03b69a
 elif [ "$types" = crypto_LUKS ]; then
03b69a
 	debug "$1 is a LUKS partition; skipping"
03b69a
-	exit 0
03b69a
+	exit 1
03b69a
 elif [ "$types" = LVM2_member ]; then
03b69a
 	debug "$1 is an LVM member; skipping"
03b69a
-	exit 0
03b69a
+	exit 1
03b69a
 elif [ "$types" = ntfs ]; then
03b69a
 	if type ntfs-3g >/dev/null 2>&1; then
03b69a
 		types='ntfs-3g ntfs'
03b69a
@@ -40,7 +52,7 @@ elif [ -z "$types" ]; then
03b69a
 	if type cryptsetup >/dev/null 2>&1 && \
03b69a
 	   cryptsetup luksDump "$partition" >/dev/null 2>&1; then
03b69a
 		debug "$1 is a LUKS partition; skipping"
03b69a
-		exit 0
03b69a
+		exit 1
03b69a
 	fi
03b69a
 	for type in $(grep -v nodev /proc/filesystems); do
03b69a
 		# hfsplus filesystems are mountable as hfs. Try hfs last so
03b69a
@@ -63,6 +75,108 @@ if [ ! -d "$tmpmnt" ]; then
03b69a
 fi
03b69a
 
03b69a
 mounted=
03b69a
+
03b69a
+# all btrfs processing here.  Handle both unmounted and
03b69a
+# mounted subvolumes.
03b69a
+if [ "$types" = btrfs ]; then
03b69a
+	partition="$BTRFSDEV"
03b69a
+	debug "begin btrfs processing for $UUID"
03b69a
+	# note that the btrfs volume must not be mounted ro
03b69a
+	if mount -t btrfs -U "$UUID" "$tmpmnt"  2>/dev/null; then
03b69a
+		debug "btrfs volume $UUID mounted"
03b69a
+	else
03b69a
+		warn "cannot mount btrfs volume $UUID, exiting"
03b69a
+		rmdir "$tmpmnt" || true
03b69a
+		exit 1
03b69a
+	fi
03b69a
+	# besides regular subvols, get ro and snapshot so thet can be excluded
03b69a
+        subvols=$(btrfs subvolume list "$tmpmnt" | cut -d ' ' -f 9)
03b69a
+        rosubvols=$(btrfs subvolume list -r "$tmpmnt" | cut -d ' ' -f 9)
03b69a
+        sssubvols=$(btrfs subvolume list -s "$tmpmnt" | cut -d ' ' -f 14)
03b69a
+        if ! umount "$tmpmnt"; then
03b69a
+            warn "failed to umount btrfs volume on $tmpmnt"
03b69a
+            rmdir "$tmpmnt" || true
03b69a
+            exit 1
03b69a
+        fi
03b69a
+
03b69a
+	found=
03b69a
+	mounted=
03b69a
+
03b69a
+	mpoint="$(grep btrfs /proc/self/mountinfo | grep "$partition " | cut -d ' ' -f 5)"
03b69a
+	if [ -n "$mpoint" -a "x$mpoint" = "x/" ]; then
03b69a
+		debug "This is the root for the running system" #running system must be done elsewhere
03b69a
+	else
03b69a
+	    #partition was not root of running system, so lets look for bootable subvols
03b69a
+	    if [ -n "$mpoint" ] ; then
03b69a
+		mounted=1  #partition was already mounted,so lets not unmount it when done
03b69a
+	    else
03b69a
+		# again, do not mount btrfs ro
03b69a
+		mount -t btrfs -U "$UUID" "$tmpmnt"
03b69a
+		mpoint="$tmpmnt"
03b69a
+	    fi
03b69a
+
03b69a
+	    test="/usr/lib/os-probes/mounted/90linux-distro"
03b69a
+	    if [ -f "$test" ] && [ -x "$test" ]; then
03b69a
+		debug "running subtest $test"
03b69a
+		if "$test" "$partition" "$mpoint" btrfs "UUID=$UUID"; then
03b69a
+		    debug "os found by subtest $test on $partition"
03b69a
+		    found=1
03b69a
+		fi
03b69a
+	    fi
03b69a
+	    if [ -z "$mounted" ]; then
03b69a
+		if ! umount "$tmpmnt"; then
03b69a
+		    warn "failed to umount $tmpmnt"
03b69a
+		fi
03b69a
+	    fi
03b69a
+	fi
03b69a
+
03b69a
+	if [ -z "$subvols" ]; then
03b69a
+	        debug "no subvols found on btrfs volume $UUID"
03b69a
+	else
03b69a
+		found=
03b69a
+                for subvol in $subvols; do
03b69a
+			debug "begin btrfs processing for $UUID subvol=$subvol"
03b69a
+			if echo "$rosubvols" | grep -q -x "$subvol"; then
03b69a
+				continue
03b69a
+			fi
03b69a
+			if echo "$sssubvols" | grep -q -x "$subvol"; then
03b69a
+				continue
03b69a
+			fi
03b69a
+			mounted=
03b69a
+			mpoint="$(grep btrfs /proc/self/mountinfo | grep "$partition " | grep "/$subvol " | cut -d ' ' -f 5)"
03b69a
+			if [ -n "$mpoint" ]; then
03b69a
+				if [ "x$mpoint" = "x/" ]; then
03b69a
+					continue # this is the root for the running system
03b69a
+				fi
03b69a
+				mounted=1
03b69a
+			else
03b69a
+				# again, do not mount btrfs ro
03b69a
+				mount -t btrfs -o subvol="$subvol" -U "$UUID" "$tmpmnt"
03b69a
+				mpoint="$tmpmnt"
03b69a
+			fi
03b69a
+			test="/usr/lib/os-probes/mounted/90linux-distro"
03b69a
+			if [ -f "$test" ] && [ -x "$test" ]; then
03b69a
+				debug "running subtest $test"
03b69a
+				if "$test" "$partition" "$mpoint" btrfs "UUID=$UUID" "subvol=$subvol"; then
03b69a
+					debug "os found by subtest $test on subvol $subvol"
03b69a
+					found=1
03b69a
+				fi
03b69a
+			fi
03b69a
+			if [ -z "$mounted" ]; then
03b69a
+				if ! umount "$tmpmnt"; then
03b69a
+				    warn "failed to umount $tmpmnt"
03b69a
+				fi
03b69a
+			fi
03b69a
+		done
03b69a
+	fi
03b69a
+	rmdir "$tmpmnt" || true
03b69a
+	if [ "$found" ]; then
03b69a
+		exit 0
03b69a
+	else
03b69a
+		exit 1
03b69a
+	fi
03b69a
+fi
03b69a
+
03b69a
 if type grub-mount >/dev/null 2>&1 && \
03b69a
    type grub-probe >/dev/null 2>&1 && \
03b69a
    grub-mount "$partition" "$tmpmnt" 2>/dev/null; then
03b69a
diff --git a/os-probes/mounted/common/90linux-distro b/os-probes/mounted/common/90linux-distro
03b69a
index badfbb1..9bc5154 100755
03b69a
--- a/os-probes/mounted/common/90linux-distro
03b69a
+++ b/os-probes/mounted/common/90linux-distro
03b69a
@@ -7,6 +7,8 @@ set -e
03b69a
 partition="$1"
03b69a
 dir="$2"
03b69a
 type="$3"
03b69a
+uuid="$4"
03b69a
+subvol="$5"
03b69a
 
03b69a
 # This test is inaccurate, but given separate / and /boot partitions and the
03b69a
 # fact that only some architectures have ld-linux.so, I can't see anything
03b69a
@@ -143,7 +145,11 @@ if (ls "$dir"/lib*/ld*.so* && [ -d "$dir/boot" ] || ls "$dir"/usr/lib*/ld*.so*)
03b69a
 	fi
03b69a
 	
03b69a
         label="$(count_next_label "$short")"
03b69a
-	result "$partition:$long:$label:linux"
03b69a
+	if [ "x$type" = "xbtrfs" -a "x$uuid" != "x" -a "x$subvol" != "x" ]; then
03b69a
+		result "$partition:$long:$label:linux:$type:$uuid:$subvol"
03b69a
+	else
03b69a
+		result "$partition:$long:$label:linux"
03b69a
+	fi
03b69a
 	exit 0
03b69a
 else
03b69a
 	exit 1