Workaround for grub2-mount slow wildcard file matching, fixes #1770599

This commit is contained in:
Hedayat Vatankhah 2020-10-10 14:36:11 +03:30
parent df7f485f34
commit 2e94fd7ad1
2 changed files with 40 additions and 1 deletions

View File

@ -0,0 +1,35 @@
diff --git a/os-probes/mounted/common/90linux-distro b/os-probes/mounted/common/90linux-distro
index 9bc5154..541079e 100755
--- a/os-probes/mounted/common/90linux-distro
+++ b/os-probes/mounted/common/90linux-distro
@@ -19,7 +19,7 @@ subvol="$5"
# 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* && [ -d "$dir/boot" ] || 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 [ -e "$dir/etc/os-release" ]; then
short="$(grep ^NAME= "$dir/etc/os-release" | sed 's/^[^=]*=//; s/^['\''"]\(.*\)['\''"]$/\1/; s/\\\(.\)/\1/g; s/[[:space:]].*//')"
long="$(grep ^PRETTY_NAME= "$dir/etc/os-release" | sed 's/^[^=]*=//; s/^['\''"]\(.*\)['\''"]$/\1/; s/\\\(.\)/\1/g')"
@@ -140,8 +140,9 @@ if (ls "$dir"/lib*/ld*.so* && [ -d "$dir/boot" ] || ls "$dir"/usr/lib*/ld*.so*)
short="Devuan"
long="$(printf "Devuan GNU/Linux (%s)\n" "$(cat "$dir/etc/devuan_version")")"
else
- short="Linux"
- long="unknown Linux distribution"
+ exit 1
+# short="Linux"
+# long="unknown Linux distribution"
fi
label="$(count_next_label "$short")"
@@ -151,6 +152,6 @@ if (ls "$dir"/lib*/ld*.so* && [ -d "$dir/boot" ] || ls "$dir"/usr/lib*/ld*.so*)
result "$partition:$long:$label:linux"
fi
exit 0
-else
- exit 1
-fi
+#else
+# exit 1
+#fi

View File

@ -1,6 +1,6 @@
Name: os-prober
Version: 1.77
Release: 5%{?dist}
Release: 6%{?dist}
Summary: Probes disks on the system for installed operating systems
# For more information about licensing, see copyright file.
@ -20,6 +20,7 @@ Patch7: os-prober-umount-fix.patch
Patch8: os-prober-grub2-parsefix.patch
Patch9: os-prober-grepfix.patch
Patch10: os-prober-gentoo-fix.patch
Patch11: os-prober-grub2-mount-workaround.patch
Requires: udev coreutils util-linux
Requires: grep /bin/sed /sbin/modprobe
@ -88,6 +89,9 @@ fi
%{_var}/lib/%{name}
%changelog
* Sat Oct 10 2020 Hedayat Vatankhah <hedayat.fwd+rpmchlog@gmail.com> - 1.77-6
- Workaround for grub2-mount slow wildcard file matching, fixes #1770599
* Tue Jul 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1.77-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild