From d61c5e5659a4c1ef7cdcfa0fc788b616d6c2cb45 Mon Sep 17 00:00:00 2001 From: Irina Gómez Date: Thu, 28 Mar 2019 12:13:32 +0100 Subject: #802 #890 ogGrubInstallMbr detects Windows loader en ESP and saves de ogbootloader into directory 'grub'· MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client/shared/lib/os-probes/mounted/efi/31part-x-y | 28 ++++++++++++++++++++++ client/shared/scripts/grubSyntax | 27 ++++++++++++++++++++- 2 files changed, 54 insertions(+), 1 deletion(-) create mode 100755 client/shared/lib/os-probes/mounted/efi/31part-x-y (limited to 'client/shared') diff --git a/client/shared/lib/os-probes/mounted/efi/31part-x-y b/client/shared/lib/os-probes/mounted/efi/31part-x-y new file mode 100755 index 00000000..349c36d8 --- /dev/null +++ b/client/shared/lib/os-probes/mounted/efi/31part-x-y @@ -0,0 +1,28 @@ +#!/bin/sh +# OG: Detects Microsoft bootloader on a EFI System Partition in directory Part-xx-yy (#802 #888) + +. /usr/share/os-prober/common.sh + +efi="$1" + +found= +for microsoft in $(item_in_dir Part-..-.. "$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 diff --git a/client/shared/scripts/grubSyntax b/client/shared/scripts/grubSyntax index 2c82e2e9..aa1adb2e 100755 --- a/client/shared/scripts/grubSyntax +++ b/client/shared/scripts/grubSyntax @@ -8,6 +8,7 @@ set -e #Antonio Doblas Viso #Universidad de Málaga #@version 1.1.1 - En los parámetros del kernel se sustituye el UUID por el dispositivo. +#@version 1.1.1 - Detecta cargador de Windows en directorio Part-xx-yy dentro de ESP (#802 #888) DISK= PART= @@ -32,7 +33,13 @@ fi grub_probe=${grub_probe:-$OGBIN/grub-probe1.99_$(arch)} #librerias del osProber para kernel antiguos: detecta e identifica sistema operativos. -grub-install --version | grep 1.99 && cp -r /opt/opengnsys/lib/os-probes/* /usr/lib/os-probes/ +if grub-install --version | grep 1.99 ; then + cp -r /opt/opengnsys/lib/os-probes/* /usr/lib/os-probes/ +else + # Librería os-probe para cargador de microsoft en dir part-x-y (uefi) + OSPROBE_MS_PART="/opt/opengnsys/lib/os-probes/mounted/efi/31part-x-y" + [ -f $OSPROBE_MS_PART ] && cp $OSPROBE_MS_PART /usr/lib/os-probes/mounted/efi +fi #Autoreconocimiento del ogLive en cache @@ -340,6 +347,24 @@ EOF cat <