diff --git a/os-prober-btrfs-snapshot-detection.patch b/os-prober-btrfs-snapshot-detection.patch new file mode 100644 index 0000000..d2dfb19 --- /dev/null +++ b/os-prober-btrfs-snapshot-detection.patch @@ -0,0 +1,31 @@ +Index: os-prober/os-probes/common/50mounted-tests +=================================================================== +--- os-prober.orig/os-probes/common/50mounted-tests ++++ os-prober/os-probes/common/50mounted-tests +@@ -115,6 +115,7 @@ if [ "$types" = btrfs ]; then + subvols=$(btrfs subvolume list -a "$tmpmnt" | cut -d ' ' -f 9 | sed -e s!^\/!!) + rosubvols=$(btrfs subvolume list -r -a "$tmpmnt" | cut -d ' ' -f 9 | sed -e s!^\/!!) + sssubvols=$(btrfs subvolume list -s -a "$tmpmnt" | cut -d ' ' -f 14 | sed -e s!^\/!!) ++ defaultvol=$(btrfs subvolume get-default "$tmpmnt" | cut -d ' ' -f 9) + if ! umount "$tmpmnt"; then + warn "failed to umount btrfs volume on $tmpmnt" + rmdir "$tmpmnt" || true +@@ -127,11 +128,13 @@ if [ "$types" = btrfs ]; then + found= + for subvol in $subvols; do + debug "begin btrfs processing for $UUID subvol=$subvol" +- if echo "$rosubvols" | grep -q -x "$subvol"; then +- continue +- fi +- if echo "$sssubvols" | grep -q -x "$subvol"; then +- continue ++ if [ "$subvol" != "$defaultvol" ]; then ++ if echo "$rosubvols" | grep -q -x "$subvol"; then ++ continue ++ fi ++ if echo "$sssubvols" | grep -q -x "$subvol"; then ++ continue ++ fi + fi + mounted= + mpoint="$(grep btrfs /proc/self/mountinfo | grep "$partition " | grep "/$subvol " | cut -d ' ' -f 5)" diff --git a/os-prober.changes b/os-prober.changes index 0c69c81..b94a9af 100644 --- a/os-prober.changes +++ b/os-prober.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Mon Nov 9 10:32:31 UTC 2015 - lnussel@suse.de + +- detect os on default subvolume in snapshot (bsc#954225) + (os-prober-btrfs-snapshot-detection.patch) + ------------------------------------------------------------------- Thu Oct 1 07:24:12 UTC 2015 - mchang@suse.com diff --git a/os-prober.spec b/os-prober.spec index 5d2ba95..782398a 100644 --- a/os-prober.spec +++ b/os-prober.spec @@ -1,7 +1,7 @@ # # spec file for package os-prober # -# Copyright (c) 2015 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -64,6 +64,8 @@ Patch18: os-prober-btrfs-absolute-subvol.patch Patch19: os-prober-40grub-check-grub2.patch # PATCH-FIX-UPSTREAM: fix os-prober is missing support for Windows 10 detection (bsc#947487) Patch20: os-prober-properly-detect-Windows-10.patch +# PATCH-FIX-OPENSUSE: detect os on default subvolume in snapshot (bsc#954225) +Patch21: os-prober-btrfs-snapshot-detection.patch Requires: /bin/grep Requires: /bin/sed Requires: /sbin/modprobe @@ -105,6 +107,7 @@ cp %{SOURCE1} . %patch18 -p1 %patch19 -p1 %patch20 -p1 +%patch21 -p1 find . -name \*.orig -delete %build