# Busca cargadores existentes por orden de prioridad e # inicia el primero que encuentra. # Si no existe ningún cargador de arranque muestre mensaje de error. set timeout=0 # Valor si no detecto ningún sistema set label="OpenGnsys: Ningún cargador de arranque detectado." set chain="" # Compruebo si existen distintos cargadores. set root='' echo "Searching rEFInd" search --file --set root /EFI/refind/grubx64.efi if [ "$root" != "" ]; then set label="rEFInd" set chain="chainloader /EFI/refind/grubx64.efi" fi if [ "$root" == "" ]; then echo "Searching Part-01-02" search --file --set root /EFI/Part-01-02/Boot/ogloader.efi if [ "$root" != "" ]; then set label="Part-01-02" set chain="chainloader /EFI/Part-01-02/Boot/ogloader.efi" fi fi if [ "$root" == "" ]; then echo "Searching Part-01-03" search --file --set root /EFI/Part-01-03/Boot/ogloader.efi if [ "$root" != "" ]; then set label="Part-01-03" set chain="chainloader /EFI/Part-01-03/Boot/ogloader.efi" fi fi if [ "$root" == "" ]; then echo "Searching Microsoft" search --file --set root /EFI/Microsoft/Boot/bootmgfw.efi if [ "$root" != "" ]; then set label="Microsoft" set chain="chainloader /EFI/Microsoft/Boot/bootmgfw.efi" fi fi if [ "$root" == "" ]; then echo "Searching Ubuntu" search --file --set root /EFI/ubuntu/grubx64.efi if [ "$root" != "" ]; then set label="Ubuntu" set chain="chainloader /EFI/ubuntu/grubx64.efi" fi fi if [ "$root" != "" ]; then set label="OpenGnsys ha detectado: $label" else # para evitar mensajes de error. set root="(hd0,gpt1)" fi menuentry "$label" { eval "$chain" }