Accepting request 343150 from home:lnussel:branches:Base:System

- detect os on default subvolume in snapshot (bsc#954225)
  (os-prober-btrfs-snapshot-detection.patch)

OBS-URL: https://build.opensuse.org/request/show/343150
OBS-URL: https://build.opensuse.org/package/show/Base:System/os-prober?expand=0&rev=62
This commit is contained in:
Dirk Mueller 2015-11-09 10:56:29 +00:00 committed by Git OBS Bridge
parent 72b8e53663
commit 6be7187d97
3 changed files with 41 additions and 1 deletions

View File

@ -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!^\<FS_TREE\>/!!)
rosubvols=$(btrfs subvolume list -r -a "$tmpmnt" | cut -d ' ' -f 9 | sed -e s!^\<FS_TREE\>/!!)
sssubvols=$(btrfs subvolume list -s -a "$tmpmnt" | cut -d ' ' -f 14 | sed -e s!^\<FS_TREE\>/!!)
+ 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)"

View File

@ -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

View File

@ -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