From 34d09c6deff6666260622c1a5633e8dcec984fb4 Mon Sep 17 00:00:00 2001 From: Hedayat Vatankhah Date: Nov 13 2015 19:50:01 +0000 Subject: Update to upstream version 1.70, fixes #1275641 - Fix bug #1236358 - os-prober duplicates grub entries for read/write btrfs subvolumes, thanks to Helmut Horvath - Fix bug #1236649 - os-prober does not detect os on btrfs partition without any subvolume --- diff --git a/.gitignore b/.gitignore index 3b86f15..b08ea4e 100644 --- a/.gitignore +++ b/.gitignore @@ -10,3 +10,4 @@ /os-prober_1.58.tar.gz /os-prober_1.65.tar.xz /os-prober_1.68.tar.xz +/os-prober_1.70.tar.xz diff --git a/os-prober-btrfsfix.patch b/os-prober-btrfsfix.patch index c038108..ecc53eb 100644 --- a/os-prober-btrfsfix.patch +++ b/os-prober-btrfsfix.patch @@ -340,7 +340,7 @@ Index: os-prober/os-probes/common/50mounted-tests fi for type in $(grep -v nodev /proc/filesystems); do # hfsplus filesystems are mountable as hfs. Try hfs last so -@@ -46,6 +62,76 @@ if [ ! -d "$tmpmnt" ]; then +@@ -46,6 +62,108 @@ if [ ! -d "$tmpmnt" ]; then fi mounted= @@ -361,51 +361,83 @@ Index: os-prober/os-probes/common/50mounted-tests + # 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 9) ++ sssubvols=$(btrfs subvolume list -s "$tmpmnt" | cut -d ' ' -f 14) + if ! umount "$tmpmnt"; then + warn "failed to umount btrfs volume on $tmpmnt" + rmdir "$tmpmnt" || true + exit 1 + fi -+ if [ -z "$subvols" ]; then -+ debug "no subvols found on btrfs volume $UUID" -+ exit 1 -+ fi ++ + found= -+ for subvol in $subvols; do -+ debug "begin btrfs processing for $UUID subvol=$subvol" -+ if echo "$rosubvols" | grep -q -x "$subvol"; then -+ continue ++ mounted= ++ ++ mpoint="$(grep btrfs /proc/self/mountinfo | grep "$partition " | cut -d ' ' -f 5)" ++ if [ -n "$mpoint" -a "x$mpoint" = "x/" ]; then ++ debug "This is the root for the running system" #running system must be done elsewhere ++ else ++ #partition was not root of running system, so lets look for bootable subvols ++ if [ -n "$mpoint" ] ; then ++ mounted=1 #partition was already mounted,so lets not unmount it when done ++ else ++ # again, do not mount btrfs ro ++ mount -t btrfs -U "$UUID" "$tmpmnt" ++ mpoint="$tmpmnt" ++ fi ++ ++ test="/usr/libexec/os-probes/mounted/90linux-distro" ++ if [ -f "$test" ] && [ -x "$test" ]; then ++ debug "running subtest $test" ++ if "$test" "$partition" "$mpoint" btrfs "UUID=$UUID"; then ++ debug "os found by subtest $test on $partition" ++ found=1 + fi -+ if echo "$sssubvols" | grep -q -x "$subvol"; then -+ continue ++ fi ++ if [ -z "$mounted" ]; then ++ if ! umount "$tmpmnt"; then ++ warn "failed to umount $tmpmnt" + fi -+ mounted= -+ mpoint="$(grep btrfs /proc/self/mountinfo | grep "$partition " | grep "/$subvol " | cut -d ' ' -f 5)" -+ if [ -n "$mpoint" ]; then -+ if [ "x$mpoint" = "x/" ]; then -+ continue # this is the root for the running system ++ fi ++ fi ++ ++ if [ -z "$subvols" ]; then ++ debug "no subvols found on btrfs volume $UUID" ++ else ++ found= ++ for subvol in $subvols; do ++ debug "begin btrfs processing for $UUID subvol=$subvol" ++ if echo "$rosubvols" | grep -q -x "$subvol"; then ++ continue + fi -+ mounted=1 -+ else -+ # again, do not mount btrfs ro -+ mount -t btrfs -o subvol="$subvol" -U "$UUID" "$tmpmnt" -+ mpoint="$tmpmnt" -+ fi -+ test="/usr/lib/os-probes/mounted/90linux-distro" -+ if [ -f "$test" ] && [ -x "$test" ]; then -+ debug "running subtest $test" -+ if "$test" "$partition" "$mpoint" btrfs "UUID=$UUID" "subvol=$subvol"; then -+ debug "os found by subtest $test on subvol $subvol" -+ found=1 ++ if echo "$sssubvols" | grep -q -x "$subvol"; then ++ continue + fi -+ fi -+ if [ -z "$mounted" ]; then -+ if ! umount "$tmpmnt"; then -+ warn "failed to umount $tmpmnt" ++ mounted= ++ mpoint="$(grep btrfs /proc/self/mountinfo | grep "$partition " | grep "/$subvol " | cut -d ' ' -f 5)" ++ if [ -n "$mpoint" ]; then ++ if [ "x$mpoint" = "x/" ]; then ++ continue # this is the root for the running system ++ fi ++ mounted=1 ++ else ++ # again, do not mount btrfs ro ++ mount -t btrfs -o subvol="$subvol" -U "$UUID" "$tmpmnt" ++ mpoint="$tmpmnt" + fi -+ fi -+ done ++ test="/usr/lib/os-probes/mounted/90linux-distro" ++ if [ -f "$test" ] && [ -x "$test" ]; then ++ debug "running subtest $test" ++ if "$test" "$partition" "$mpoint" btrfs "UUID=$UUID" "subvol=$subvol"; then ++ debug "os found by subtest $test on subvol $subvol" ++ found=1 ++ fi ++ fi ++ if [ -z "$mounted" ]; then ++ if ! umount "$tmpmnt"; then ++ warn "failed to umount $tmpmnt" ++ fi ++ fi ++ done ++ fi + rmdir "$tmpmnt" || true + if [ "$found" ]; then + exit 0 diff --git a/os-prober.spec b/os-prober.spec index 423d76b..2fdc9b4 100644 --- a/os-prober.spec +++ b/os-prober.spec @@ -1,5 +1,5 @@ Name: os-prober -Version: 1.68 +Version: 1.70 Release: 1%{?dist} Summary: Probes disks on the system for installed operating systems @@ -38,7 +38,7 @@ in a generic machine-readable format. Support for new OSes and Linux distributions can be added easily. %prep -%setup -q -n os-prober +%setup -q %patch0 -p1 -b .newnsdirfix %patch1 -p1 -b .macosxdummyfix %patch2 -p1 -b .mdraidfix @@ -105,6 +105,13 @@ fi %{_var}/lib/%{name} %changelog +* Fri Nov 13 2015 Hedayat Vatankhah - 1.70-1 +- Update to upstream version 1.70, fixes #1275641 +- Fix bug #1236358 - os-prober duplicates grub entries for read/write btrfs + subvolumes, thanks to Helmut Horvath +- Fix bug #1236649 - os-prober does not detect os on btrfs partition without + any subvolume + * Tue Oct 20 2015 Hedayat Vatankhah - 1.68-1 - Update to upstream version 1.68, bug #1267779 - Support a case where a kernel named vmlinuz/x is used under Gentoo, bug #1223237 diff --git a/sources b/sources index d556963..ac17094 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -11e9794cc4bfd77092c76d9d96a2035b os-prober_1.68.tar.xz +c1cfdd90dc958f12b932ccc8d64051e1 os-prober_1.70.tar.xz