os-prober/os-prober-40grub-check-grub2.patch
Michael Chang 0e7560730a Accepting request 320020 from home:arvidjaar:grub2-next
- add os-prober-40grub-check-grub2.patch
  * also skip legacy grub if /boot/grub2/grub.cfg is present, not only
    /boot/grub/grub.cfg

OBS-URL: https://build.opensuse.org/request/show/320020
OBS-URL: https://build.opensuse.org/package/show/Base:System/os-prober?expand=0&rev=58
2015-08-03 03:05:51 +00:00

20 lines
887 B
Diff

From: Andrei Borzenkov <arvidjaar@gmail.com>
Subject: Also skip legacy grub if grub2 is found
Check for grub.cfg also in /boot/grub2, not only in /boot/grub.
Index: os-prober/linux-boot-probes/mounted/x86/40grub
===================================================================
--- os-prober.orig/linux-boot-probes/mounted/x86/40grub
+++ os-prober/linux-boot-probes/mounted/x86/40grub
@@ -95,7 +95,9 @@ fi
if [ "$grubconf" ] && \
([ ! -e "$mpoint/boot/grub/grub.cfg" ] || \
- [ "$mpoint/boot/grub/$grubconf" -nt "$mpoint/boot/grub/grub.cfg" ]); then
+ [ "$mpoint/boot/grub/$grubconf" -nt "$mpoint/boot/grub/grub.cfg" ]) && \
+ ([ ! -e "$mpoint/boot/grub2/grub.cfg" ] || \
+ [ "$mpoint/boot/grub/$grubconf" -nt "$mpoint/boot/grub2/grub.cfg" ]); then
debug "parsing $grubconf"
parse_grub_menu "$mpoint" "$partition" "$bootpart" < "$mpoint/boot/grub/$grubconf"
fi