From dea69a97c72c65657d3d15097d81ea7f997626c4 Mon Sep 17 00:00:00 2001 From: Hedayat Vatankhah Date: Tue, 6 May 2014 23:31:56 +0430 Subject: [PATCH] Fix separate /usr partitions for usrmove distros (bug #1044760) - Fix umount error when directory is temporarily busy (bug #903906) --- os-prober-umount-fix.patch | 18 ++++++++++++++++++ os-prober-usrmovefix.patch | 24 ++++++++++++++++++++---- os-prober.spec | 8 +++++++- 3 files changed, 45 insertions(+), 5 deletions(-) create mode 100644 os-prober-umount-fix.patch diff --git a/os-prober-umount-fix.patch b/os-prober-umount-fix.patch new file mode 100644 index 0000000..2f8696f --- /dev/null +++ b/os-prober-umount-fix.patch @@ -0,0 +1,18 @@ +Index: os-prober-1.58/common.sh +=================================================================== +--- os-prober-1.58.orig/common.sh ++++ os-prober-1.58/common.sh +@@ -313,3 +313,13 @@ linux_mount_boot () { + + mountboot="$bootpart $mounted" + } ++ ++umount_exec=$(which umount) ++umount() { ++ if ! $umount_exec $@; then ++ error "umount error, retrying after 1 sec" ++ sleep 1 ++ $umount_exec $@ ++ fi ++} ++ diff --git a/os-prober-usrmovefix.patch b/os-prober-usrmovefix.patch index e03d536..6db9936 100644 --- a/os-prober-usrmovefix.patch +++ b/os-prober-usrmovefix.patch @@ -1,12 +1,28 @@ -diff -up os-prober-1.57/os-probes/mounted/common/90linux-distro.usrmovefix os-prober-1.57/os-probes/mounted/common/90linux-distro ---- os-prober-1.57/os-probes/mounted/common/90linux-distro.usrmovefix 2013-01-23 00:39:20.333616357 +0330 -+++ os-prober-1.57/os-probes/mounted/common/90linux-distro 2013-01-23 00:39:51.834222545 +0330 +Index: os-prober-1.58/os-probes/mounted/common/90linux-distro +=================================================================== +--- os-prober-1.58.orig/os-probes/mounted/common/90linux-distro ++++ os-prober-1.58/os-probes/mounted/common/90linux-distro @@ -17,7 +17,7 @@ type="$3" # symlinks we need to also check in $dir/usr/lib* for distributions that # moved /lib* to /usr and only left symlinks behind. # TODO: look for ld-linux.so on arches that have it -if (ls "$dir"/lib*/ld*.so* || ls "$dir"/usr/lib*/ld*.so*) >/dev/null 2>/dev/null; then -+if (ls "$dir"/lib*/ld*.so* && [ -d "$dir/boot" ] || ls "$dir"/usr/lib*/ld*.so*) >/dev/null 2>/dev/null; then ++if [ -L "$dir"/lib ] || (ls "$dir"/lib*/ld*.so* || ls "$dir"/usr/lib*/ld*.so*) >/dev/null 2>/dev/null; then if [ -e "$dir/etc/debian_version" ]; then short="Debian" long="$(printf "Debian GNU/Linux (%s)\n" "$(cat "$dir/etc/debian_version")")" +@@ -125,9 +125,13 @@ if (ls "$dir"/lib*/ld*.so* || ls "$dir"/ + elif [ -e "$dir/etc/meego-release" ]; then + short="MeeGo" + long="$(head -1 "$dir/etc/meego-release")" +- else ++ elif (ls "$dir"/lib*/ld*.so* && [ -d "$dir/boot" ] || ls "$dir"/usr/lib*/ld*.so*) >/dev/null 2>/dev/null; then ++ # Don't report 'Linux distribution' if only a /lib symlink is found or if this is ++ # a partition without /boot (should be /usr partition) + short="Linux" + long="unknown Linux distribution" ++ else ++ exit 1 + fi + + label="$(count_next_label "$short")" diff --git a/os-prober.spec b/os-prober.spec index 173dab4..3fbf030 100644 --- a/os-prober.spec +++ b/os-prober.spec @@ -1,6 +1,6 @@ Name: os-prober Version: 1.58 -Release: 5%{?dist} +Release: 6%{?dist} Summary: Probes disks on the system for installed operating systems Group: System Environment/Base @@ -27,6 +27,7 @@ Patch10: os-prober-factor-out-logger.patch # testing in https://bugzilla.redhat.com/show_bug.cgi?id=873207 # - adamw 2013/07 #Patch11: os-prober-factored-logger-efi-fix.patch +Patch12: os-prober-umount-fix.patch Requires: udev coreutils util-linux Requires: grep /bin/sed /sbin/modprobe @@ -50,6 +51,7 @@ distributions can be added easily. %patch9 -p1 -b .mounted-partitions-fix %patch10 -p1 -b .factor-out-logger #patch11 -p1 -b .factor-out-logger-efi-fix +%patch12 -p1 -b .umount-fix find -type f -exec sed -i -e 's|usr/lib|usr/libexec|g' {} \; sed -i -e 's|grub-probe|grub2-probe|g' os-probes/common/50mounted-tests \ @@ -100,6 +102,10 @@ fi %{_var}/lib/%{name} %changelog +* Tue May 06 2014 Hedayat Vatankhah - 1.58-6 +- Fix separate /usr partitions for usrmove distros (bug #1044760) +- Fix umount error when directory is temporarily busy (bug #903906) + * Thu Apr 24 2014 Hedayat Vatankhah - 1.58-5 - Fixed bug #982009: fix btrfs support - Suppress some more debug messages when debug messages are disabled