Update to latest upstream version with better support for latest OSes,

closes rhbz#2090942
Remove 'which' dependency, closes rhbz#2111531
Add support for detecting EFI shell binary (shell.efi), closes rhbz#2101953
Add support for Win 11 on ARM 64 systems
This commit is contained in:
Hedayat Vatankhah 2022-08-07 01:30:00 +04:30
parent f02724dab4
commit 56ec8a1f4b
9 changed files with 74 additions and 34 deletions

1
.gitignore vendored
View File

@ -14,3 +14,4 @@
/os-prober_1.71.tar.xz
/os-prober_1.74.tar.xz
/os-prober_1.77.tar.xz
/os-prober_1.81.tar.xz

View File

@ -0,0 +1,15 @@
diff --git a/os-probes/mounted/arm64/20microsoft b/os-probes/mounted/arm64/20microsoft
index 066918a..b69c2ba 100755
--- a/os-probes/mounted/arm64/20microsoft
+++ b/os-probes/mounted/arm64/20microsoft
@@ -31,7 +31,9 @@ if item_in_dir -q bootmgr "$2"; then
for boot in $(item_in_dir boot "$2"); do
bcd=$(item_in_dir bcd "$2/$boot")
if [ -n "$bcd" ]; then
- if grep -aqs "W.i.n.d.o.w.s. .1.0" "$2/$boot/$bcd"; then
+ if grep -aqs "W.i.n.d.o.w.s. .1.1" "$2/$boot/$bcd"; then
+ long="Windows 11"
+ elif grep -aqs "W.i.n.d.o.w.s. .1.0" "$2/$boot/$bcd"; then
long="Windows 10"
elif grep -aqs "W.i.n.d.o.w.s. .8" "$2/$boot/$bcd"; then
long="Windows 8"

30
os-prober-efi-shell.patch Normal file
View File

@ -0,0 +1,30 @@
diff --git a/os-probes/mounted/common/efi/05shell b/os-probes/mounted/common/efi/05shell
new file mode 100644
index 0000000..d4233c0
--- /dev/null
+++ b/os-probes/mounted/common/efi/05shell
@@ -0,0 +1,24 @@
+#!/usr/bin/sh
+# Detects a shell.efi bootloader on a EFI System Partition
+
+. /usr/share/os-prober/common.sh
+
+found=
+
+efi_shell=`find $1 -iname "shell.efi"`
+if [ -n "${efi_shell}" ]; then
+ bdir="${efi_shell%/*}"
+ bdir="${efi_shell##*/}"
+ filename=`basename ${efi_shell}`
+ long="EFI firmware management shell"
+ short="EFI_SHELL"
+ path=${bdir}/${filename}
+ found=true
+fi
+
+if [ -n "$found" ]; then
+ label="$(count_next_label "$short")"
+ result "${path}:${long}:${label}"
+fi
+
+exit 0

View File

@ -1,13 +0,0 @@
Index: os-prober/linux-boot-probes/mounted/common/90fallback
===================================================================
--- os-prober.orig/linux-boot-probes/mounted/common/90fallback
+++ os-prober/linux-boot-probes/mounted/common/90fallback
@@ -33,7 +33,7 @@ for kernpat in /vmlinuz /vmlinux /boot/v
# Dracut initramfses are named differently again.
initrdname3=$(echo "$kernfile" | sed "s/vmlinu[zx]/initramfs\*/" | sed 's/$/.img/')
# And Gentoo's also
- initrdname4=$(echo "$kernfile" | sed "s/kernel/initramfs\*/")
+ initrdname4=$(echo "$kernfile" | sed "s/kernel\|vmlinu[zx]/initramfs\*/")
foundinitrd=0
for initrd in $(eval ls "$initrdname" "$initrdname1" "$initrdname2" "$initrdname3" "$initrdname4" 2>/dev/null); do
if [ "$initrd" != "$kernfile" ] && [ -f "$initrd" ] && [ ! -L "$initrd" ]; then

View File

@ -1,5 +1,5 @@
diff --git a/os-probes/mounted/common/90linux-distro b/os-probes/mounted/common/90linux-distro
index 9bc5154..541079e 100755
index b9c24dd..52db3f6 100755
--- a/os-probes/mounted/common/90linux-distro
+++ b/os-probes/mounted/common/90linux-distro
@@ -19,7 +19,7 @@ subvol="$5"
@ -11,9 +11,9 @@ index 9bc5154..541079e 100755
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")")"
@@ -146,8 +146,9 @@ if (ls "$dir"/lib*/ld*.so* && [ -d "$dir/boot" ] || ls "$dir"/usr/lib*/ld*.so*)
short="Exherbo"
long="Exherbo Linux"
else
- short="Linux"
- long="unknown Linux distribution"
@ -23,7 +23,7 @@ index 9bc5154..541079e 100755
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*)
@@ -157,6 +158,6 @@ if (ls "$dir"/lib*/ld*.so* && [ -d "$dir/boot" ] || ls "$dir"/usr/lib*/ld*.so*)
result "$partition:$long:$label:linux"
fi
exit 0

View File

@ -1,7 +1,7 @@
Index: os-prober-1.58/linux-boot-probes/mounted/common/40grub2
===================================================================
--- os-prober-1.58.orig/linux-boot-probes/mounted/common/40grub2
+++ os-prober-1.58/linux-boot-probes/mounted/common/40grub2
diff --git a/linux-boot-probes/mounted/common/40grub2 b/linux-boot-probes/mounted/common/40grub2
index 664505f..5895e45 100755
--- a/linux-boot-probes/mounted/common/40grub2
+++ b/linux-boot-probes/mounted/common/40grub2
@@ -77,7 +77,7 @@ parse_grub_menu () {
ignore_item=1
fi
@ -17,6 +17,6 @@ Index: os-prober-1.58/linux-boot-probes/mounted/common/40grub2
;;
- initrd)
+ initrd*)
initrd="$(echo "$2" | sed 's/(.*)//')"
# Initrd same.
if [ "$partition" != "$bootpart" ]; then
shift
initrd=""
for initrd_path in "$@"; do

View File

@ -2,17 +2,16 @@ Index: os-prober/common.sh
===================================================================
--- os-prober.orig/common.sh
+++ os-prober/common.sh
@@ -336,3 +336,13 @@ linux_mount_boot () {
@@ -336,3 +336,12 @@ linux_mount_boot () {
mountboot="$bootpart $mounted"
}
+
+umount_exec=$(which umount)
+umount() {
+ if ! $umount_exec $@ 2> /dev/null; then
+ if ! command umount $@ 2> /dev/null; then
+ error "umount error, retrying after 1 sec"
+ sleep 1
+ $umount_exec $@
+ command umount $@
+ fi
+}
+

View File

@ -1,6 +1,6 @@
Name: os-prober
Version: 1.77
Release: 10%{?dist}
Version: 1.81
Release: 1%{?dist}
Summary: Probes disks on the system for installed operating systems
# For more information about licensing, see copyright file.
@ -14,13 +14,14 @@ Patch2: os-prober-btrfsfix.patch
Patch3: os-prober-bootpart-name-fix.patch
Patch4: os-prober-mounted-partitions-fix.patch
Patch5: os-prober-factor-out-logger.patch
Patch12: os-prober-efi-shell.patch
# To be sent upstream
Patch6: os-prober-factored-logger-efi-fix.patch
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
Patch10: os-prober-grub2-mount-workaround.patch
Patch11: os-prober-arm64-win11.patch
Requires: udev coreutils util-linux
Requires: grep /bin/sed /sbin/modprobe
@ -90,6 +91,13 @@ fi
%{_var}/lib/%{name}
%changelog
* Sat Aug 06 2022 Hedayat Vatankhah <hedayat.fwd+rpmchlog@gmail.com> - 1.81-1
- Update to latest upstream version with better support for latest OSes,
closes rhbz#2090942
- Remove 'which' dependency, closes rhbz#2111531
- Add support for detecting EFI shell binary (shell.efi), closes rhbz#2101953
- Add support for Win 11 on ARM 64 systems
* Fri Jul 22 2022 Fedora Release Engineering <releng@fedoraproject.org> - 1.77-10
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild

View File

@ -1 +1 @@
SHA512 (os-prober_1.77.tar.xz) = 4d9c22ccc4d950644a06a17ec4424aca5ff82aeb20052dc389dd451b6b9a1799c5a9438644a29093153730af42066abbbbb78f593f2564314c9adbd43f60e39b
SHA512 (os-prober_1.81.tar.xz) = ffb0e618f9e58a7a8e4a265d253bad4e168c220697216684acb38dbfa20680e552eb7c5f3d2186cd750c61a8929bf152527aa85c39318ed8b025a4ffffadde50