From 815da4652dc1389fd1b345c4f1b0bdccd3c7e5979cc633392fe3943b95fcb54a Mon Sep 17 00:00:00 2001 From: Andrei Borzenkov Date: Wed, 3 Oct 2018 13:55:29 +0000 Subject: [PATCH] Accepting request 639715 from home:michael-chang:branches:Base:System - UEFI Grub does not insert Arch Linux entry correctly (boo#1101942) * os-prober-multiple-initrd.patch OBS-URL: https://build.opensuse.org/request/show/639715 OBS-URL: https://build.opensuse.org/package/show/Base:System/os-prober?expand=0&rev=85 --- os-prober-multiple-initrd.patch | 32 ++++++++++++++++++++++++++++++++ os-prober.changes | 6 ++++++ os-prober.spec | 7 +++++-- 3 files changed, 43 insertions(+), 2 deletions(-) create mode 100644 os-prober-multiple-initrd.patch diff --git a/os-prober-multiple-initrd.patch b/os-prober-multiple-initrd.patch new file mode 100644 index 0000000..ba40ce1 --- /dev/null +++ b/os-prober-multiple-initrd.patch @@ -0,0 +1,32 @@ +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 338b4e3..824edf9 100644 --- a/os-prober.changes +++ b/os-prober.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Tue Jul 31 09:16:55 UTC 2018 - mchang@suse.com + +- UEFI Grub does not insert Arch Linux entry correctly (boo#1101942) + * os-prober-multiple-initrd.patch + ------------------------------------------------------------------- Thu Jun 14 07:11:24 UTC 2018 - josef.moellers@suse.com diff --git a/os-prober.spec b/os-prober.spec index 9dc1a13..318c0af 100644 --- a/os-prober.spec +++ b/os-prober.spec @@ -1,7 +1,7 @@ # # spec file for package os-prober # -# Copyright (c) 2018 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -20,7 +20,7 @@ Name: os-prober Version: 1.74 Release: 0 Summary: Probes disks on the system for installed operating systems -License: GPL-2.0+ +License: GPL-2.0-or-later Group: System/Boot Url: http://kitenet.net/~joey/code/os-prober/ Source0: http://ftp.de.debian.org/debian/pool/main/o/os-prober/%{name}_%{version}.tar.xz @@ -66,6 +66,8 @@ 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 Requires: /bin/grep Requires: /bin/sed Requires: /sbin/modprobe @@ -109,6 +111,7 @@ cp %{SOURCE1} . %patch23 -p1 %patch24 -p1 %patch25 -p1 +%patch26 -p1 find . -name \*.orig -delete %build