summaryrefslogtreecommitdiffstats
path: root/client/shared
diff options
context:
space:
mode:
authorIrina Gómez <irinagomez@us.es>2019-03-28 12:13:32 +0100
committerIrina Gómez <irinagomez@us.es>2019-03-28 12:13:32 +0100
commitd61c5e5659a4c1ef7cdcfa0fc788b616d6c2cb45 (patch)
tree67aeee2dc932955c5a35a2fe0f11ee9bf80b7023 /client/shared
parent5fd45d159c150abfd1c878f613a43ab9d1cbe610 (diff)
#802 #890 ogGrubInstallMbr detects Windows loader en ESP and saves de ogbootloader into directory 'grub'·
Diffstat (limited to 'client/shared')
-rwxr-xr-xclient/shared/lib/os-probes/mounted/efi/31part-x-y28
-rwxr-xr-xclient/shared/scripts/grubSyntax27
2 files changed, 54 insertions, 1 deletions
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
@@ -342,6 +349,24 @@ EOF
}
EOF
;;
+ efi)
+
+ found_other_os=1
+ EFIPATH=${DEVICE#*@}
+ DEVICE=${DEVICE%@*}
+ onstr="$(gettext_printf "(on %s)" "${DEVICE}")"
+ cat << EOF
+menuentry '$(echo "${LONGNAME} $onstr" | grub_quote)' --class windows --class os \$menuentry_id_option 'osprober-efi-$(grub_get_device_id "${DEVICE}")' {
+EOF
+ save_default_entry | sed -e "s/^/\t/"
+#ADV prepare_grub_to_access_device ${DEVICE} | sed -e "s/^/\t/"
+ OG_prepare_grub_to_access_device ${DEVICE} | sed -e "s/^/\t/"
+
+ cat <<EOF
+ chainloader ${EFIPATH}
+}
+EOF
+ ;;
linux)
KERNELPARAM=""
#linuxprobed detecta todos los kernels de una partición.