From d61f5aac8fa5ce41c7066806c55cbe00035fccd3f17100f495219caaaac1ff5c Mon Sep 17 00:00:00 2001 From: Andrei Borzenkov Date: Thu, 18 Jun 2015 18:55:24 +0000 Subject: [PATCH] Accepting request 312489 from home:michael-chang:branches:Base:System - add os-prober-btrfs-absolute-subvol.patch * fix os-prober mount error, no such file or directory (bsc#931955) OBS-URL: https://build.opensuse.org/request/show/312489 OBS-URL: https://build.opensuse.org/package/show/Base:System/os-prober?expand=0&rev=56 --- os-prober-btrfs-absolute-subvol.patch | 28 +++++++++++++++++++++++++++ os-prober.changes | 6 ++++++ os-prober.spec | 5 ++++- 3 files changed, 38 insertions(+), 1 deletion(-) create mode 100644 os-prober-btrfs-absolute-subvol.patch diff --git a/os-prober-btrfs-absolute-subvol.patch b/os-prober-btrfs-absolute-subvol.patch new file mode 100644 index 0000000..3f86c4b --- /dev/null +++ b/os-prober-btrfs-absolute-subvol.patch @@ -0,0 +1,28 @@ +Index: os-prober-1.61/os-probes/common/50mounted-tests +=================================================================== +--- os-prober-1.61.orig/os-probes/common/50mounted-tests ++++ os-prober-1.61/os-probes/common/50mounted-tests +@@ -58,9 +58,7 @@ mounted= + + if [ "$types" = btrfs ]; then + partition="$BTRFSDEV" +-fi +- +-if type grub2-mount >/dev/null 2>&1 && \ ++elif type grub2-mount >/dev/null 2>&1 && \ + type grub2-probe >/dev/null 2>&1 && \ + grub2-mount "$partition" "$tmpmnt" 2>/dev/null; then + mounted=1 +@@ -114,9 +112,9 @@ if [ "$types" = btrfs ]; then + exit 1 + fi + # besides regular subvols, get ro and snapshot so thet can be excluded +- subvols=$(btrfs subvolume list "$tmpmnt" | cut -d ' ' -f 9) +- rosubvols=$(btrfs subvolume list -r "$tmpmnt" | cut -d ' ' -f 9) +- sssubvols=$(btrfs subvolume list -s "$tmpmnt" | cut -d ' ' -f 14) ++ 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!^\/!!) + if ! umount "$tmpmnt"; then + warn "failed to umount btrfs volume on $tmpmnt" + rmdir "$tmpmnt" || true diff --git a/os-prober.changes b/os-prober.changes index 5be29bb..e61ba46 100644 --- a/os-prober.changes +++ b/os-prober.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Thu Jun 18 10:24:05 UTC 2015 - mchang@suse.com + +- add os-prober-btrfs-absolute-subvol.patch + * fix os-prober mount error, no such file or directory (bsc#931955) + ------------------------------------------------------------------- Mon Jun 1 07:16:32 UTC 2015 - mchang@suse.com diff --git a/os-prober.spec b/os-prober.spec index 138d0be..bba6b43 100644 --- a/os-prober.spec +++ b/os-prober.spec @@ -1,7 +1,7 @@ # # spec file for package os-prober # -# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2015 SUSE LINUX Products GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -58,6 +58,8 @@ Patch15: os-prober-call-dmraid-once.patch Patch16: os-prober-grep-for-windows-bcd-file.patch # PATCH-FIX-SLE: fix os-prober fails to detect other SLES12 installation (bsc#892364) Patch17: Improve-btrfs-handling-on-os-probing-for-grub2.patch +# PATCH-FIX-SLE: fix os-prober mount error, no such file or directory (bsc#931955) +Patch18: os-prober-btrfs-absolute-subvol.patch Requires: /bin/grep Requires: /bin/sed Requires: /sbin/modprobe @@ -96,6 +98,7 @@ cp %{SOURCE1} . %patch15 -p1 %patch16 -p1 %patch17 -p1 +%patch18 -p1 find . -name \*.orig -delete %build