forked from pool/os-prober
32 lines
1.1 KiB
Diff
32 lines
1.1 KiB
Diff
|
From: Andrey Borzenkov <arvidjaar@gmail.com>
|
||
|
Date: Fri Jan 4 09:46:56 UTC 2013
|
||
|
Subject: skip legacy Microsoft bootloader on UEFI system
|
||
|
|
||
|
References: bnc#775610
|
||
|
Patch-Mainline: no
|
||
|
|
||
|
Sometimes Windows installs both legacy BIOS and UEFI bootloaders.
|
||
|
Attempt to chainload legacy bootloader on UEFI system fails. Skip
|
||
|
adding legacy bootloader in this case.
|
||
|
|
||
|
TODO: this probably should be implemented as runtime check. But it
|
||
|
does the right thing in majority of cases. If mixed legacy/UEFI
|
||
|
boot will be used frequently, it can be revisited.
|
||
|
Index: os-prober/os-probes/mounted/x86/20microsoft
|
||
|
===================================================================
|
||
|
--- os-prober.orig/os-probes/mounted/x86/20microsoft
|
||
|
+++ os-prober/os-probes/mounted/x86/20microsoft
|
||
|
@@ -7,6 +7,12 @@ partition="$1"
|
||
|
mpoint="$2"
|
||
|
type="$3"
|
||
|
|
||
|
+# This script looks for legacy BIOS bootloaders only. Skip if running UEFI
|
||
|
+if [ -d /sys/firmware/efi ]; then
|
||
|
+ debug "Skipping legacy bootloaders on UEFI system"
|
||
|
+ exit 1
|
||
|
+fi
|
||
|
+
|
||
|
# Weed out stuff that doesn't apply to us
|
||
|
case "$type" in
|
||
|
ntfs|ntfs-3g) debug "$1 is a NTFS partition" ;;
|