diff options
author | Irina Gómez <irinagomez@us.es> | 2019-04-17 12:34:38 +0200 |
---|---|---|
committer | Irina Gómez <irinagomez@us.es> | 2019-04-17 12:34:38 +0200 |
commit | 528ff4ca943d3f439d18d6d467c699329bece768 (patch) | |
tree | d2ecfeb8a6478141e2414f2ad9b94a6b6fb29dc4 /server | |
parent | b00e622946cb37fb20e00f27d43f9fef37ec260e (diff) |
#802 #888 PXE templates search the ogLive in cache, in ISODIR or default directory. New templates for disk and default PXE.
Diffstat (limited to 'server')
-rw-r--r-- | server/tftpboot/grub/default | 61 | ||||
-rw-r--r-- | server/tftpboot/grub/templates/10 | 19 | ||||
-rw-r--r-- | server/tftpboot/grub/templates/19pxeADMIN | 34 | ||||
-rw-r--r-- | server/tftpboot/grub/templates/pxe | 32 |
4 files changed, 140 insertions, 6 deletions
diff --git a/server/tftpboot/grub/default b/server/tftpboot/grub/default new file mode 100644 index 00000000..8691d0e4 --- /dev/null +++ b/server/tftpboot/grub/default @@ -0,0 +1,61 @@ +# 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='' +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 + 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 + 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 + 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 + 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 + +# Timeout +if [ "$root" != "" ]; then + set timeout=5 + set label="OpenGnsys ha detectado: $label" +else + # para evitar mensajes de error. + set root="(hd0,gpt1)" +fi + +menuentry "$label" { + eval "$chain" +} diff --git a/server/tftpboot/grub/templates/10 b/server/tftpboot/grub/templates/10 new file mode 100644 index 00000000..b133f59b --- /dev/null +++ b/server/tftpboot/grub/templates/10 @@ -0,0 +1,19 @@ +##NO-TOCAR-ESTA-LINEA 1hd +set timeout=0 + +# Compruebo si existe rEFInd +set root='' +search --file --set root /EFI/refind/grubx64.efi +if [ "$root" == "" ]; then + set label="rEFInd no está instalado" + set chain="" +else + set label="rEFInd" + set chain="chainloader /EFI/refind/grubx64.efi" +fi + +menuentry "$label" { + root='hd0,gpt1' + eval "$chain" + boot +} diff --git a/server/tftpboot/grub/templates/19pxeADMIN b/server/tftpboot/grub/templates/19pxeADMIN index 7ab4770d..83b7fd64 100644 --- a/server/tftpboot/grub/templates/19pxeADMIN +++ b/server/tftpboot/grub/templates/19pxeADMIN @@ -1,5 +1,33 @@ ##NO-TOCAR-ESTA-LINEA ogLiveAdmin +set timeout=0 +set timeout_style=hidden + set ISODIR=ogLive -linux (tftp)/$ISODIR/ogvmlinuz ro boot=oginit quiet splash vga=788 irqpoll acpi=on og2nd=sqfs ogprotocol=smb ogactiveadmin=true ogdebug=true ogtmpfs=15 oglivedir=$ISODIR INFOHOST -initrd (tftp)/$ISODIR/oginitrd.img -boot + +# Si existe ogLive en CACHE lo inicio, si no el de la red +set root='' +search --file --set root /boot/$ISODIR/ogvmlinuz +if [ "$root" == "" ]; then + set default=1; +else + set default=0; +fi + +menuentry "OgLive CACHE" { + linux /boot/$ISODIR/ogvmlinuz ro boot=oginit quiet splash vga=788 irqpoll acpi=on og2nd=sqfs ogprotocol=smb ogactiveadmin=true ogdebug=true ogupdateinitrd=true ogtmpfs=15 oglivedir=$ISODIR INFOHOST + initrd /boot/$ISODIR/oginitrd.img + boot +} + +menuentry "OgLive $ISODIR" { + # Si no existe el ogLive de ISODIR en la red, inicio ogLive por defecto + for DIR in $ISODIR ogLive; do + if linux (tftp)/$DIR/ogvmlinuz ro boot=oginit quiet splash vga=788 irqpoll acpi=on og2nd=sqfs ogprotocol=smb ogactiveadmin=true ogdebug=true ogtmpfs=15 oglivedir=$ISODIR INFOHOST ; then + set DIR=$DIR + break + fi + done + + initrd (tftp)/$DIR/oginitrd.img + boot +} diff --git a/server/tftpboot/grub/templates/pxe b/server/tftpboot/grub/templates/pxe index db695291..60881f43 100644 --- a/server/tftpboot/grub/templates/pxe +++ b/server/tftpboot/grub/templates/pxe @@ -1,7 +1,33 @@ ##NO-TOCAR-ESTA-LINEA ogLive +set timeout=0 +set timeout_style=hidden + set ISODIR=ogLive -linux (tftp)/$ISODIR/ogvmlinuz ro boot=oginit quiet splash vga=788 irqpoll acpi=on og2nd=sqfs ogprotocol=smb ogactiveadmin=false ogdebug=false ogtmpfs=15 oglivedir=$ISODIR INFOHOST -initrd (tftp)/$ISODIR/oginitrd.img -boot +# Si existe ogLive en CACHE lo inicio, si no el de la red +set root='' +search --file --set root /boot/$ISODIR/ogvmlinuz +if [ "$root" == "" ]; then + set default=1; +else + set default=0; +fi + +menuentry "OgLive CACHE" { + linux /boot/$ISODIR/ogvmlinuz ro boot=oginit quiet splash vga=788 irqpoll acpi=on og2nd=sqfs ogprotocol=smb ogactiveadmin=false ogdebug=false ogupdateinitrd=true ogtmpfs=15 oglivedir=$ISODIR INFOHOST + initrd /boot/$ISODIR/oginitrd.img + boot +} + +menuentry "OgLive $ISODIR" { + # Si no existe el ogLive de ISODIR en la red, inicio ogLive por defecto + for DIR in $ISODIR ogLive; do + if linux (tftp)/$DIR/ogvmlinuz ro boot=oginit quiet splash vga=788 irqpoll acpi=on og2nd=sqfs ogprotocol=smb ogactiveadmin=false ogdebug=false ogtmpfs=15 oglivedir=$ISODIR INFOHOST ; then + set DIR=$DIR + break + fi + done + initrd (tftp)/$DIR/oginitrd.img + boot +} |