From 2c62f814816a3533058a3decc76b7a13aae6d7796597e44a95e76bc7815b7a52 Mon Sep 17 00:00:00 2001 From: Michael Chang Date: Tue, 3 Jan 2023 02:35:40 +0000 Subject: [PATCH] Accepting request 1044146 from home:michael-chang:branches:Base:System - update to 1.81 - use %autosetup macro to unpack source and apply patch - drop patch for upstream * os-prober-multiple-initrd.patch - rediff * Improve-btrfs-handling-on-os-probing-for-grub2.patch * os-prober-linux-distro-avoid-expensive-ld-file-test.patch * os-prober-linux-distro-parse-os-release.patch * os-prober-linux-secure-boot.patch OBS-URL: https://build.opensuse.org/request/show/1044146 OBS-URL: https://build.opensuse.org/package/show/Base:System/os-prober?expand=0&rev=107 --- ...rfs-handling-on-os-probing-for-grub2.patch | 34 ++++++++++--------- os-prober-1.79.tar.bz2 | 3 -- os-prober-1.81.tar.bz2 | 3 ++ ...-distro-avoid-expensive-ld-file-test.patch | 33 ++++++++++++------ os-prober-linux-distro-parse-os-release.patch | 14 ++++---- os-prober-linux-secure-boot.patch | 20 ++++++----- os-prober-multiple-initrd.patch | 32 ----------------- os-prober.changes | 13 +++++++ os-prober.spec | 33 ++---------------- 9 files changed, 79 insertions(+), 106 deletions(-) delete mode 100644 os-prober-1.79.tar.bz2 create mode 100644 os-prober-1.81.tar.bz2 delete mode 100644 os-prober-multiple-initrd.patch diff --git a/Improve-btrfs-handling-on-os-probing-for-grub2.patch b/Improve-btrfs-handling-on-os-probing-for-grub2.patch index c64b260..ee80934 100644 --- a/Improve-btrfs-handling-on-os-probing-for-grub2.patch +++ b/Improve-btrfs-handling-on-os-probing-for-grub2.patch @@ -35,14 +35,12 @@ b. Fix kernelfile path if separate boot partition on btrfs Signed-off-by: Michael Chang --- - linux-boot-probes/mounted/common/40grub2 | 16 +++++++++++++--- - 1 file changed, 13 insertions(+), 3 deletions(-) + linux-boot-probes/mounted/common/40grub2 | 24 +++++++++++++++++------- + 1 file changed, 17 insertions(+), 7 deletions(-) -Index: os-prober-1.61/linux-boot-probes/mounted/common/40grub2 -=================================================================== ---- os-prober-1.61.orig/linux-boot-probes/mounted/common/40grub2 -+++ os-prober-1.61/linux-boot-probes/mounted/common/40grub2 -@@ -14,9 +14,19 @@ bootsv="$6" +--- a/linux-boot-probes/mounted/common/40grub2 ++++ b/linux-boot-probes/mounted/common/40grub2 +@@ -14,9 +14,19 @@ found_item=0 entry_result () { @@ -65,7 +63,7 @@ Index: os-prober-1.61/linux-boot-probes/mounted/common/40grub2 else kernelfile=$kernel fi -@@ -81,7 +91,7 @@ parse_grub_menu () { +@@ -81,7 +91,7 @@ ignore_item=1 fi ;; @@ -74,7 +72,7 @@ Index: os-prober-1.61/linux-boot-probes/mounted/common/40grub2 # Hack alert: sed off any (hdn,n) but # assume the kernel is on the same # partition. -@@ -90,14 +100,14 @@ parse_grub_menu () { +@@ -90,18 +100,18 @@ parameters="$@" # Systems with a separate /boot will not have # the path to the kernel in grub.cfg. @@ -85,10 +83,14 @@ Index: os-prober-1.61/linux-boot-probes/mounted/common/40grub2 ;; - initrd|initrdefi) + initrd|initrdefi|initrd16) - initrd="$(echo "$2" | sed 's/(.*)//')" - # Initrd same. -- if [ "$partition" != "$bootpart" ]; then -+ if [ "$partition" != "$bootpart" -a "$type" != "btrfs" ]; then - initrd="/boot$initrd" - fi - ;; + shift + initrd="" + for initrd_path in "$@"; do + # sed hack, as above + initrd_path="$(echo "$initrd_path" | sed 's/(.*)//')" + # Initrd same. +- if [ "$partition" != "$bootpart" ]; then ++ if [ "$partition" != "$bootpart" -a "$type" != "btrfs" ]; then + initrd_path="/boot$initrd_path" + fi + if [ -z "$initrd" ]; then diff --git a/os-prober-1.79.tar.bz2 b/os-prober-1.79.tar.bz2 deleted file mode 100644 index da68cc7..0000000 --- a/os-prober-1.79.tar.bz2 +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:1fb3aeda6c28e9b9a07d53779ceb0b8d653bd70ff1d99a80ee98fb6a6d877254 -size 27205 diff --git a/os-prober-1.81.tar.bz2 b/os-prober-1.81.tar.bz2 new file mode 100644 index 0000000..1afc55b --- /dev/null +++ b/os-prober-1.81.tar.bz2 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f4af6c8f99a8d248ab26c7cf27525849e777b4a7d3bf644e2b8fbafbb0db6f14 +size 27725 diff --git a/os-prober-linux-distro-avoid-expensive-ld-file-test.patch b/os-prober-linux-distro-avoid-expensive-ld-file-test.patch index 0ff7176..7e3683a 100644 --- a/os-prober-linux-distro-avoid-expensive-ld-file-test.patch +++ b/os-prober-linux-distro-avoid-expensive-ld-file-test.patch @@ -1,8 +1,11 @@ -Index: os-prober/os-probes/mounted/common/90linux-distro -=================================================================== ---- os-prober.orig/os-probes/mounted/common/90linux-distro -+++ os-prober/os-probes/mounted/common/90linux-distro -@@ -10,147 +10,133 @@ type="$3" +--- + os-prober | 5 + os-probes/mounted/common/90linux-distro | 280 +++++++++++++++----------------- + 2 files changed, 138 insertions(+), 147 deletions(-) + +--- a/os-probes/mounted/common/90linux-distro ++++ b/os-probes/mounted/common/90linux-distro +@@ -10,153 +10,139 @@ uuid="$4" subvol="$5" @@ -19,6 +22,9 @@ Index: os-prober/os-probes/mounted/common/90linux-distro - 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')" +- elif [ -e "$dir/usr/lib/os-release" ]; then +- short="$(grep ^NAME= "$dir/usr/lib/os-release" | sed 's/^[^=]*=//; s/^['\''"]\(.*\)['\''"]$/\1/; s/\\\(.\)/\1/g; s/[[:space:]].*//')" +- long="$(grep ^PRETTY_NAME= "$dir/usr/lib/os-release" | sed 's/^[^=]*=//; s/^['\''"]\(.*\)['\''"]$/\1/; s/\\\(.\)/\1/g')" - elif [ -e "$dir/etc/debian_version" ]; then - short="Debian" - long="$(printf "Debian GNU/Linux (%s)\n" "$(cat "$dir/etc/debian_version")")" @@ -135,6 +141,9 @@ Index: os-prober/os-probes/mounted/common/90linux-distro - elif [ -e "$dir/etc/devuan_version" ]; then - short="Devuan" - long="$(printf "Devuan GNU/Linux (%s)\n" "$(cat "$dir/etc/devuan_version")")" +- elif [ -e "$dir/etc/exherbo-release" ]; then +- short="Exherbo" +- long="Exherbo Linux" - else - short="Linux" - long="unknown Linux distribution" @@ -150,6 +159,9 @@ Index: os-prober/os-probes/mounted/common/90linux-distro +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')" ++elif [ -e "$dir/usr/lib/os-release" ]; then ++ short="$(grep ^NAME= "$dir/usr/lib/os-release" | sed 's/^[^=]*=//; s/^['\''"]\(.*\)['\''"]$/\1/; s/\\\(.\)/\1/g; s/[[:space:]].*//')" ++ long="$(grep ^PRETTY_NAME= "$dir/usr/lib/os-release" | sed 's/^[^=]*=//; s/^['\''"]\(.*\)['\''"]$/\1/; s/\\\(.\)/\1/g')" +elif [ -e "$dir/etc/debian_version" ]; then + short="Debian" + long="$(printf "Debian GNU/Linux (%s)\n" "$(cat "$dir/etc/debian_version")")" @@ -266,6 +278,9 @@ Index: os-prober/os-probes/mounted/common/90linux-distro +elif [ -e "$dir/etc/devuan_version" ]; then + short="Devuan" + long="$(printf "Devuan GNU/Linux (%s)\n" "$(cat "$dir/etc/devuan_version")")" ++elif [ -e "$dir/etc/exherbo-release" ]; then ++ short="Exherbo" ++ long="Exherbo Linux" else exit 1 fi @@ -277,11 +292,9 @@ Index: os-prober/os-probes/mounted/common/90linux-distro + result "$partition:$long:$label:linux" +fi +exit 0 -Index: os-prober/os-prober -=================================================================== ---- os-prober.orig/os-prober -+++ os-prober/os-prober -@@ -186,6 +186,11 @@ for partition in $(partitions); do +--- a/os-prober ++++ b/os-prober +@@ -185,6 +185,11 @@ # be handled by 50mounted-tests so we can do a subvol only once. type=$(blkid -o value -s TYPE $mapped || true) if [ "$type" = btrfs ]; then diff --git a/os-prober-linux-distro-parse-os-release.patch b/os-prober-linux-distro-parse-os-release.patch index d8d7791..7a76e48 100644 --- a/os-prober-linux-distro-parse-os-release.patch +++ b/os-prober-linux-distro-parse-os-release.patch @@ -1,8 +1,10 @@ -Index: os-prober/os-probes/mounted/common/90linux-distro -=================================================================== ---- os-prober.orig/os-probes/mounted/common/90linux-distro -+++ os-prober/os-probes/mounted/common/90linux-distro -@@ -10,7 +10,18 @@ type="$3" +--- + os-probes/mounted/common/90linux-distro | 13 ++++++++++++- + 1 file changed, 12 insertions(+), 1 deletion(-) + +--- a/os-probes/mounted/common/90linux-distro ++++ b/os-probes/mounted/common/90linux-distro +@@ -10,7 +10,18 @@ uuid="$4" subvol="$5" @@ -21,4 +23,4 @@ Index: os-prober/os-probes/mounted/common/90linux-distro +elif [ -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')" - elif [ -e "$dir/etc/debian_version" ]; then + elif [ -e "$dir/usr/lib/os-release" ]; then diff --git a/os-prober-linux-secure-boot.patch b/os-prober-linux-secure-boot.patch index c728a00..0de8aef 100644 --- a/os-prober-linux-secure-boot.patch +++ b/os-prober-linux-secure-boot.patch @@ -5,11 +5,13 @@ Reference: bnc#810912 Recognize initrdefi and linuxefi too. Whether linux/initrd or linuxefi/initrdefi will be emitted is controlled by SECURE_BOOT setting in /etc/sysconfig/bootloader. -Index: os-prober-1.61/linux-boot-probes/mounted/common/40grub2 -=================================================================== ---- os-prober-1.61.orig/linux-boot-probes/mounted/common/40grub2 -+++ os-prober-1.61/linux-boot-probes/mounted/common/40grub2 -@@ -71,7 +71,7 @@ parse_grub_menu () { +--- + linux-boot-probes/mounted/common/40grub2 | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/linux-boot-probes/mounted/common/40grub2 ++++ b/linux-boot-probes/mounted/common/40grub2 +@@ -71,7 +71,7 @@ ignore_item=1 fi ;; @@ -18,12 +20,12 @@ Index: os-prober-1.61/linux-boot-probes/mounted/common/40grub2 # Hack alert: sed off any (hdn,n) but # assume the kernel is on the same # partition. -@@ -84,7 +84,7 @@ parse_grub_menu () { +@@ -84,7 +84,7 @@ kernel="/boot$kernel" fi ;; - initrd) + initrd|initrdefi) - initrd="$(echo "$2" | sed 's/(.*)//')" - # Initrd same. - if [ "$partition" != "$bootpart" ]; then + shift + initrd="" + for initrd_path in "$@"; do diff --git a/os-prober-multiple-initrd.patch b/os-prober-multiple-initrd.patch deleted file mode 100644 index ba40ce1..0000000 --- a/os-prober-multiple-initrd.patch +++ /dev/null @@ -1,32 +0,0 @@ -Index: os-prober/linux-boot-probes/mounted/common/40grub2 -=================================================================== ---- os-prober.orig/linux-boot-probes/mounted/common/40grub2 -+++ os-prober/linux-boot-probes/mounted/common/40grub2 -@@ -19,11 +19,11 @@ entry_result () { - # if path is not relative to subvolume make it relative - kernel=${kernel#${bsv}} - kernelfile=$kernel -- initrd=${initrd#${bsv}} -+ initrd=`echo $initrd | sed -e "s!^${bsv}!!" -e "s!\\(\\s\\)${bsv}!\\1!g"` - if [ "x$GRUB_FS" != "xbtrfs" -o "x${SUSE_BTRFS_SNAPSHOT_BOOTING}" != "xtrue" ]; then - # absolute path needed: prepend subvolume if $kernel isn't empty - kernel=${kernel:+${bsv}}${kernel} -- initrd=${initrd:+${bsv}}${initrd} -+ initrd=`echo $initrd | sed -e "s!\\(\\S\\+\\)!${bsv}\\1!g"` - fi - # assumed: rootsv != bootsv if rootsv isn't ancestor of bootsv - [ "$partition" != "$bootpart" -o "$rootsv" != "$bootsv" ] && kernelfile="/boot${kernelfile}" -@@ -105,10 +105,11 @@ parse_grub_menu () { - fi - ;; - initrd|initrdefi|initrd16) -- initrd="$(echo "$2" | sed 's/(.*)//')" -+ shift -+ initrd="$(echo "$@" | sed 's/(\S*)//g')" - # Initrd same. - if [ "$partition" != "$bootpart" -a "$type" != "btrfs" ]; then -- initrd="/boot$initrd" -+ initrd=`echo $initrd | sed -e 's!\(\S\+\)!/boot\1!g'` - fi - ;; - "}") diff --git a/os-prober.changes b/os-prober.changes index 4573079..144a541 100644 --- a/os-prober.changes +++ b/os-prober.changes @@ -1,3 +1,16 @@ +------------------------------------------------------------------- +Thu Dec 22 04:54:11 UTC 2022 - Michael Chang + +- update to 1.81 +- use %autosetup macro to unpack source and apply patch +- drop patch for upstream + * os-prober-multiple-initrd.patch +- rediff + * Improve-btrfs-handling-on-os-probing-for-grub2.patch + * os-prober-linux-distro-avoid-expensive-ld-file-test.patch + * os-prober-linux-distro-parse-os-release.patch + * os-prober-linux-secure-boot.patch + ------------------------------------------------------------------- Thu Jul 22 08:17:58 UTC 2021 - Michael Chang diff --git a/os-prober.spec b/os-prober.spec index bdeb9c7..116a977 100644 --- a/os-prober.spec +++ b/os-prober.spec @@ -1,7 +1,7 @@ # # spec file for package os-prober # -# Copyright (c) 2021 SUSE LLC +# Copyright (c) 2022 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -17,7 +17,7 @@ Name: os-prober -Version: 1.79 +Version: 1.81 Release: 0 Summary: Probes disks on the system for installed operating systems License: GPL-2.0-or-later @@ -66,8 +66,6 @@ Patch23: os-prober-linux-distro-avoid-expensive-ld-file-test.patch Patch24: os-prober-linux-distro-parse-os-release.patch # PATCH-FIX-OPENSUSE: Windows 10 is not listed in the grub menu (bsc#1076779) Patch25: os-prober-05efi-blkid.patch -# PATCH-FIX-OPENSUSE: UEFI Grub does not insert Arch Linux entry correctly (boo#1101942) -Patch26: os-prober-multiple-initrd.patch # PATCH-FIX-OPENSUSE: os-prober unconditionally pulls btrfsprogs (boo#1118279) Patch27: os-prober-make-btrfsprogs-optional.patch # PATCH-FIX-OPENSUSE: os-prober isn't compatible with transactional update (boo#1125729) @@ -97,33 +95,8 @@ in a generic machine-readable format. Support for new OSes and Linux distributions can be added easily. %prep -%setup -q +%autosetup -p1 cp %{SOURCE1} . -%patch0 -p1 -%patch1 -p1 -%patch3 -p1 -%patch5 -p1 -%patch7 -p1 -%patch8 -p1 -%patch9 -p1 -%patch10 -p1 -%patch11 -p1 -%patch12 -p1 -%patch13 -p1 -%patch14 -p1 -%patch17 -p1 -%patch18 -p1 -%patch19 -p1 -%patch21 -p1 -%patch22 -p1 -%patch23 -p1 -%patch24 -p1 -%patch25 -p1 -%patch26 -p1 -%patch27 -p1 -%patch28 -p1 -%patch29 -p1 -%patch30 -p1 find . -name \*.orig -delete %build