Fix separate /usr partitions for usrmove distros (bug #1044760)

- Fix umount error when directory is temporarily busy (bug #903906)
This commit is contained in:
Hedayat Vatankhah 2014-05-06 23:31:56 +04:30
parent e292704fcb
commit dea69a97c7
3 changed files with 45 additions and 5 deletions

View File

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

View File

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

View File

@ -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 <hedayat.fwd+rpmchlog@gmail.com> - 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 <hedayat.fwd+rpmchlog@gmail.com> - 1.58-5
- Fixed bug #982009: fix btrfs support
- Suppress some more debug messages when debug messages are disabled