diff --git a/.gitignore b/.gitignore index 14cfccf..557bdbe 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1 @@ -SOURCES/os-prober_1.74.tar.xz -/os-prober_1.74.tar.xz +os-prober_1.81.tar.xz diff --git a/gating.yaml b/gating.yaml deleted file mode 100644 index a949aa0..0000000 --- a/gating.yaml +++ /dev/null @@ -1,6 +0,0 @@ ---- !Policy -product_versions: - - rhel-8 -decision_context: osci_compose_gate -rules: - - !PassingTestCaseRule {test_case_name: manual.sst_desktop.os-prober.functional} diff --git a/os-prober-90fallback-include-possible-kernel-parameters-from-g.patch b/os-prober-90fallback-include-possible-kernel-parameters-from-g.patch deleted file mode 100644 index e3d5e6d..0000000 --- a/os-prober-90fallback-include-possible-kernel-parameters-from-g.patch +++ /dev/null @@ -1,53 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Leo Sandoval -Date: Thu, 27 Jun 2024 10:53:32 -0600 -Subject: [PATCH] 90fallback: include possible kernel parameters from grub's - default file - -Probed filesystems may include the GRUB's default -file ($mpoint/etc/default/grub) so it desirable to source it and get -and place either GRUB_CMDLINE_LINUX and/or GRUB_CMDLINE_LINUX_DEFAULT -on the kernel parameters field, ultimately tools like grub2-mkconfig -makes use of it and create menuentries with kernel parameters. - -Signed-off-by: Leo Sandoval ---- - linux-boot-probes/mounted/common/90fallback | 18 +++++++++++++++++- - 1 file changed, 17 insertions(+), 1 deletion(-) - -diff --git a/linux-boot-probes/mounted/common/90fallback b/linux-boot-probes/mounted/common/90fallback -index 7e40d15..cad7645 100755 ---- a/linux-boot-probes/mounted/common/90fallback -+++ b/linux-boot-probes/mounted/common/90fallback -@@ -10,6 +10,22 @@ mpoint="$3" - type="$4" - - mappedpartition=$(mapdevfs "$partition" 2>/dev/null) || mappedpartition="$partition" -+kernparams="root=$mappedpartition" -+ -+# In case there is $mpoint/etc/default/grub, source it and take into account -+# relevant command line variables. This function must be run inside a subshell -+# otherwise grub default variable may be overriden -+get_cmdline_linux_params() -+{ -+ local mpoint_sysconfdir="$mpoint/etc" -+ if test -f ${mpoint_sysconfdir}/default/grub ; then -+ unset GRUB_CMDLINE_LINUX GRUB_CMDLINE_LINUX_DEFAULT -+ . ${mpoint_sysconfdir}/default/grub -+ echo "${GRUB_CMDLINE_LINUX} ${GRUB_CMDLINE_LINUX_DEFAULT}" -+ fi -+} -+ -+kernparams="$(echo $kernparams $(get_cmdline_linux_params) | sed 's/[[:space:]]\+$//')" - - exitcode=1 - for kernpat in /vmlinuz /vmlinux /boot/vmlinuz /boot/vmlinux "/boot/vmlinuz*" \ -@@ -38,7 +54,7 @@ for kernpat in /vmlinuz /vmlinux /boot/vmlinuz /boot/vmlinux "/boot/vmlinuz*" \ - for initrd in $(eval ls "$initrdname" "$initrdname1" "$initrdname2" "$initrdname3" "$initrdname4" 2>/dev/null); do - if [ "$initrd" != "$kernfile" ] && [ -f "$initrd" ] && [ ! -L "$initrd" ]; then - initrd=$(echo "$initrd" | sed "s!^$mpoint!!") -- result "$partition:$kernbootpart::$kernbasefile:$initrd:root=$mappedpartition" -+ result "$partition:$kernbootpart::$kernbasefile:$initrd:$kernparams" - exitcode=0 - foundinitrd=1 - fi diff --git a/os-prober-arm64-win11.patch b/os-prober-arm64-win11.patch new file mode 100644 index 0000000..07e5230 --- /dev/null +++ b/os-prober-arm64-win11.patch @@ -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" diff --git a/os-prober-common.sh-do-not-resolve-symbolic-link-on-mapped-dev.patch b/os-prober-common.sh-do-not-resolve-symbolic-link-on-mapped-dev.patch deleted file mode 100644 index 77a403f..0000000 --- a/os-prober-common.sh-do-not-resolve-symbolic-link-on-mapped-dev.patch +++ /dev/null @@ -1,27 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Leo Sandoval -Date: Thu, 27 Jun 2024 11:31:38 -0600 -Subject: [PATCH] common.sh: do not resolve symbolic link on mapped device - filesystems - -/dev/dm-* devices may change from boot to boot so better to use the -symlink instead of the resolved file name - -Signed-off-by: Leo Sandoval ---- - common.sh | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/common.sh b/common.sh -index a24286a..f0ebfb3 100644 ---- a/common.sh -+++ b/common.sh -@@ -92,7 +92,7 @@ export fd_result # so subshells inherit current value by default - # shim to make it easier to use os-prober outside d-i - if ! type mapdevfs >/dev/null 2>&1; then - mapdevfs () { -- readlink -f "$1" -+ echo "$1" - } - fi - diff --git a/os-prober-efi-shell.patch b/os-prober-efi-shell.patch new file mode 100644 index 0000000..ee186d8 --- /dev/null +++ b/os-prober-efi-shell.patch @@ -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 diff --git a/os-prober-gentoo-fix.patch b/os-prober-gentoo-fix.patch deleted file mode 100644 index 8545db2..0000000 --- a/os-prober-gentoo-fix.patch +++ /dev/null @@ -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 diff --git a/os-prober-grub2-mount-workaround.patch b/os-prober-grub2-mount-workaround.patch new file mode 100644 index 0000000..5e8a092 --- /dev/null +++ b/os-prober-grub2-mount-workaround.patch @@ -0,0 +1,35 @@ +diff --git a/os-probes/mounted/common/90linux-distro b/os-probes/mounted/common/90linux-distro +index b9c24dd..52db3f6 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')" +@@ -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" ++ exit 1 ++# short="Linux" ++# long="unknown Linux distribution" + fi + + label="$(count_next_label "$short")" +@@ -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 +-else +- exit 1 +-fi ++#else ++# exit 1 ++#fi diff --git a/os-prober-grub2-parsefix.patch b/os-prober-grub2-parsefix.patch index 0ef8bda..7f85626 100644 --- a/os-prober-grub2-parsefix.patch +++ b/os-prober-grub2-parsefix.patch @@ -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 diff --git a/os-prober-umount-fix.patch b/os-prober-umount-fix.patch index 6e7937c..9ab0580 100644 --- a/os-prober-umount-fix.patch +++ b/os-prober-umount-fix.patch @@ -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 +} + diff --git a/os-prober.spec b/os-prober.spec index e18a753..60d56b5 100644 --- a/os-prober.spec +++ b/os-prober.spec @@ -1,11 +1,10 @@ Name: os-prober -Version: 1.74 -Release: 10%{?dist} +Version: 1.81 +Release: 7%{?dist} Summary: Probes disks on the system for installed operating systems -Group: System Environment/Base # For more information about licensing, see copyright file. -License: GPLv2+ and GPL+ +License: GPL-2.0-or-later AND GPL-1.0-or-later URL: http://kitenet.net/~joey/code/os-prober/ Source0: http://ftp.us.debian.org/debian/pool/main/o/os-prober/%{name}_%{version}.tar.xz Patch0: os-prober-no-dummy-mach-kernel.patch @@ -15,19 +14,20 @@ 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-90fallback-include-possible-kernel-parameters-from-g.patch -Patch12: os-prober-common.sh-do-not-resolve-symbolic-link-on-mapped-dev.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 -Requires: device-mapper +Requires: grub2-tools-minimal +BuildRequires: make BuildRequires: gcc git %description @@ -36,14 +36,17 @@ in a generic machine-readable format. Support for new OSes and Linux distributions can be added easily. %prep -%autosetup -n %{name} -S git +%autosetup -n %{name}-%{version} -S git 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 \ linux-boot-probes/common/50mounted-tests +sed -i -e 's|grub-mount|grub2-mount|g' os-probes/common/50mounted-tests \ + linux-boot-probes/common/50mounted-tests common.sh %build -%make_build CFLAGS="%{optflags}" LDFLAGS="%{build_ldflags}" +%set_build_flags +%make_build LDFLAGS="$LDFLAGS -fPIC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" %install install -m 0755 -d %{buildroot}%{_bindir} @@ -88,23 +91,70 @@ fi %{_var}/lib/%{name} %changelog -* Mon Sep 2 2024 Leo Sandoval - 1.74-10 -- 90fallback: include possible kernel parameters from grub's default file -- common.sh: do not resolve symbolic link on mapped device filesystems -- Resolves: #RHEL-55234 +* Mon Jun 24 2024 Troy Dawson - 1.81-7 +- Bump release for June 2024 mass rebuild -* Tue Jun 22 2021 Javier Martinez Canillas - 1.74-9 -- Another build but with a gating.yaml to allow leaving gating - Resolves: rhbz#1624158 +* Thu Jan 25 2024 Fedora Release Engineering - 1.81-6 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild -* Mon Jun 21 2021 Javier Martinez Canillas - 1.74-8 -- Bump NVR to allow building - Resolves: rhbz#1624158 +* Sun Jan 21 2024 Fedora Release Engineering - 1.81-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild -* Thu Jul 25 2019 Peter Jones - 1.74-7 -- Make gcc use -Wl,-z,now -Wl,-z,relro -pie. Dunno why the default didn't - pick this up. - Resolves: rhbz#1624158 +* Thu Dec 21 2023 Nicolas Frayer +- Migrate to SPDX license +- Please refer to https://fedoraproject.org/wiki/Changes/SPDX_Licenses_Phase_2 + +* Thu Jul 20 2023 Fedora Release Engineering - 1.81-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild + +* Thu Jan 19 2023 Fedora Release Engineering - 1.81-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild + +* Tue Jan 10 2023 Robbie Harwood - 1.81-2 +- Fix inheritance of environment build flags + +* Sat Aug 06 2022 Hedayat Vatankhah - 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 - 1.77-10 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild + +* Thu Jan 20 2022 Fedora Release Engineering - 1.77-9 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild + +* Thu Jul 22 2021 Fedora Release Engineering - 1.77-8 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild + +* Tue Jan 26 2021 Fedora Release Engineering - 1.77-7 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild + +* Sat Oct 10 2020 Hedayat Vatankhah - 1.77-6 +- Workaround for grub2-mount slow wildcard file matching, fixes #1770599 + +* Tue Jul 28 2020 Fedora Release Engineering - 1.77-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild + +* Wed Jan 29 2020 Fedora Release Engineering - 1.77-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild + +* Thu Jul 25 2019 Fedora Release Engineering - 1.77-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild + +* Tue May 14 2019 Hedayat Vatankhah - 1.77-2 +- Use distro LDFLAGS when building the package, fixes #1543863 + +* Tue May 14 2019 Hedayat Vatankhah - 1.77-1 +- Update to 1.77, use grub2-mount rather than device mapper for mounts, fixes #1447156 + +* Fri Feb 01 2019 Fedora Release Engineering - 1.74-8 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild + +* Fri Jul 13 2018 Fedora Release Engineering - 1.74-7 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild * Sun Feb 18 2018 Hedayat Vatankhah - 1.74-6 - Add gcc build dependency diff --git a/rpminspect.yaml b/rpminspect.yaml deleted file mode 100644 index 4c08189..0000000 --- a/rpminspect.yaml +++ /dev/null @@ -1,13 +0,0 @@ ---- -inspections: - # Not a Java package - javabytecode: off - - # These just flag when things change "too much" - changedfiles: off - filesize: off - patches: off - upstream: off - - # https://bugzilla.redhat.com/show_bug.cgi?id=2010936 - annocheck: off diff --git a/sources b/sources index f5258cc..e23b716 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (os-prober_1.74.tar.xz) = 5407fb3c782ae0532120995d60cfc307028de9bea52ce5534baaf940a99269b735c1174ef0f7a5316be485a1e8bfd097108c2819eadf00e2e38595bfc2c22245 +SHA512 (os-prober_1.81.tar.xz) = ffb0e618f9e58a7a8e4a265d253bad4e168c220697216684acb38dbfa20680e552eb7c5f3d2186cd750c61a8929bf152527aa85c39318ed8b025a4ffffadde50