SHA256
1
0
forked from pool/os-prober
os-prober/efi-20microsoft
Marcus Meissner 81111d8d75 Accepting request 147193 from home:arvidjaar:bnc775610
- add support for chainloading another UEFI bootloader (bnc#775610)
  * 05efi - top level driver to search ESP
  * efi-20microsoft - support Microsoft UEFI bootloader
  * efi-10elilo - support ELILO UEFI bootloader (Agnelo de la Crotche)
- skip legacy Microsoft bootloader on UEFI (bnc#775610)

OBS-URL: https://build.opensuse.org/request/show/147193
OBS-URL: https://build.opensuse.org/package/show/Base:System/os-prober?expand=0&rev=9
2013-01-05 14:42:18 +00:00

29 lines
616 B
Bash

#!/bin/sh
# Detects Microsoft bootloader on a EFI System Partition
. /usr/share/os-prober/common.sh
efi="$1"
found=
for microsoft in $(item_in_dir microsoft "$efi"); do
for boot in $(item_in_dir boot "$efi/$microsoft"); do
bcd=$(item_in_dir bcd "$efi/$microsoft/$boot")
bootmgfw=$(item_in_dir bootmgfw.efi "$efi/$microsoft/$boot")
if [ -n "$bcd" -a -n "$bootmgfw" ]; then
long="Windows Boot Manager"
short=Windows
path="$microsoft/$boot/$bootmgfw"
found=true
break
fi
done
done
if [ -n "$found" ]; then
label="$(count_next_label "$short")"
result "${path}:${long}:${label}"
fi
exit 0