From ce7b65b98cf88f78ec54b7bbcd53dc5233b3665083913b295ccfac79a3164ee4 Mon Sep 17 00:00:00 2001 From: Michael Chang Date: Tue, 27 Aug 2019 10:14:38 +0000 Subject: [PATCH] Accepting request 726441 from home:michael-chang:branches:Base:System - Fix duplicated distro detected on btrfs multiple device (bsc#1142858) * os-prober-btrfs-multiple-device.patch - Update URL for downloading source archive from Debain Salsa server * os-prober.spec - Added * os-prober-1.76.tar.bz2 - Removed * os-prober_1.76.tar.xz OBS-URL: https://build.opensuse.org/request/show/726441 OBS-URL: https://build.opensuse.org/package/show/Base:System/os-prober?expand=0&rev=98 --- os-prober-1.76.tar.bz2 | 3 +++ os-prober-btrfs-multiple-device.patch | 35 +++++++++++++++++++++++++++ os-prober.changes | 16 ++++++++++++ os-prober.spec | 5 +++- os-prober_1.76.tar.xz | 3 --- 5 files changed, 58 insertions(+), 4 deletions(-) create mode 100644 os-prober-1.76.tar.bz2 create mode 100644 os-prober-btrfs-multiple-device.patch delete mode 100644 os-prober_1.76.tar.xz diff --git a/os-prober-1.76.tar.bz2 b/os-prober-1.76.tar.bz2 new file mode 100644 index 0000000..1ef4b94 --- /dev/null +++ b/os-prober-1.76.tar.bz2 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2f84f7758596590a40c051a9ce2b66c4f26119fe9078d3771070b22b12183c1f +size 26176 diff --git a/os-prober-btrfs-multiple-device.patch b/os-prober-btrfs-multiple-device.patch new file mode 100644 index 0000000..601502b --- /dev/null +++ b/os-prober-btrfs-multiple-device.patch @@ -0,0 +1,35 @@ +Index: os-prober-1.76/os-prober +=================================================================== +--- os-prober-1.76.orig/os-prober ++++ os-prober-1.76/os-prober +@@ -161,6 +161,15 @@ fi + + : >"$OS_PROBER_TMP/btrfs-vols" + ++btrfsrootdev=$(sed -n -e 's!\([^\s]\+\)\s\+\(/\|/target/boot\|/target\)\s\+btrfs!\1!p;ta;b;:a;q' "$OS_PROBER_TMP/mounted-map") ++if [ -n "$btrfsrootdev" ] ; then ++ if btrfsrootdev="$(mapdevfs "$btrfsrootdev")"; then ++ btrfsrootdevuuid=$(blkid -o value -s UUID "$btrfsrootdev") ++ debug "btrfs is mounted as root, uuid: $btrfsrootdevuuid" ++ echo "$btrfsrootdevuuid" >>"$OS_PROBER_TMP/btrfs-vols" ++ fi ++fi ++ + for partition in $(partitions); do + if ! mapped="$(mapdevfs "$partition")"; then + log "Device '$partition' does not exist; skipping" +@@ -183,13 +192,9 @@ for partition in $(partitions); do + # be handled by 50mounted-tests so we can do a subvol only once. + type=$(blkid -o value -s TYPE $mapped || true) + if [ "$type" = btrfs ]; then +- mpoint=$(grep "^$mapped " "$OS_PROBER_TMP/mounted-map" | head -n1 | cut -d " " -f 2) +- mpoint="$(unescape_mount "$mpoint")" +- if [ "$mpoint" = "/target/boot" ] || [ "$mpoint" = "/target" ] || [ "$mpoint" = "/" ]; then +- continue +- fi + uuid=$(blkid -o value -s UUID $mapped) + if grep -q "^$uuid" "$OS_PROBER_TMP/btrfs-vols" ; then ++ debug "skipped btrfs partition=$partition uuid=$uuid" + continue + fi + debug "btrfs volume uuid=$uuid partition=$partition" diff --git a/os-prober.changes b/os-prober.changes index 2f7e9e8..4a4a324 100644 --- a/os-prober.changes +++ b/os-prober.changes @@ -1,3 +1,19 @@ +------------------------------------------------------------------- +Tue Aug 13 08:12:58 UTC 2019 - Michael Chang + +- Fix duplicated distro detected on btrfs multiple device (bsc#1142858) + * os-prober-btrfs-multiple-device.patch + +------------------------------------------------------------------- +Tue Aug 13 07:48:14 UTC 2019 - Michael Chang + +- Update URL for downloading source archive from Debain Salsa server + * os-prober.spec +- Added + * os-prober-1.76.tar.bz2 +- Removed + * os-prober_1.76.tar.xz + ------------------------------------------------------------------- Tue Apr 23 07:42:32 UTC 2019 - mchang diff --git a/os-prober.spec b/os-prober.spec index f88c460..5088f18 100644 --- a/os-prober.spec +++ b/os-prober.spec @@ -23,7 +23,7 @@ Summary: Probes disks on the system for installed operating systems License: GPL-2.0-or-later Group: System/Boot Url: https://salsa.debian.org/installer-team/os-prober -Source0: %{name}_%{version}.tar.xz +Source0: https://salsa.debian.org/installer-team/os-prober/-/archive/%{version}/%{name}-%{version}.tar.bz2 Source1: COPYING-note.txt # move newns binary outside of os-prober subdirectory, so that debuginfo # can be automatically generated for it @@ -73,6 +73,8 @@ Patch27: os-prober-make-btrfsprogs-optional.patch # PATCH-FIX-OPENSUSE: os-prober isn't compatible with transactional update (boo#1125729) # PATCH-FIX-OPENSUSE: os-prober deletes subvolume on btrfs disk (boo#1130669) Patch28: os-prober-use-tmp-over-var-lib-for-transient-files.patch +# PATCH-FIX-OPENSUSE: Two TW selections is shown in GRUB after installing system with multi-device Btrfs (bsc#1142858) +Patch29: os-prober-btrfs-multiple-device.patch Requires: /bin/grep Requires: /bin/sed Requires: /sbin/modprobe @@ -118,6 +120,7 @@ cp %{SOURCE1} . %patch26 -p1 %patch27 -p1 %patch28 -p1 +%patch29 -p1 find . -name \*.orig -delete %build diff --git a/os-prober_1.76.tar.xz b/os-prober_1.76.tar.xz deleted file mode 100644 index 4c80b74..0000000 --- a/os-prober_1.76.tar.xz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:d3a580610e0148ee1fea98de993b27b856870fb0a31e9ce1a33be2654e2c64ed -size 26432