refs #1046 adds new templates to boot by disk and partition. Adds grub.exe to boot disk/partition in BIOS mode. Adds a new default.ipxe that unifies BIOS and UEFI mode

docker_install
Qindel 2024-11-04 08:36:53 +00:00
parent e96f6b1d39
commit 710fe4c237
9 changed files with 160 additions and 32 deletions

BIN
tftpboot/grub.exe 100644

Binary file not shown.

View File

@ -1,12 +0,0 @@
#!ipxe
set timeout 0
set timeout-style hidden
set ISODIR ogLive
set default 0
set kernelargs ro boot=oginit quiet splash irqpoll acpi=on og2nd=sqfs ogprotocol=smb ogactiveadmin=true ogdebug=true ogtmpfs=15 oglivedir=${ISODIR} LANG=es_ES.UTF-8 ip=192.168.2.11:192.168.2.1:192.168.2.1:255.255.255.0:pc11:eth0:none group=Aula_virtual ogrepo=192.168.2.1 oglive=192.168.2.1 oglog=192.168.2.1 ogshare=192.168.2.1 ogprof=false vga=788
kernel tftp://172.17.8.71/ogLive/ogvmlinuz ${kernelargs}
initrd tftp://172.17.8.71/ogLive/oginitrd.img
boot

View File

@ -1,14 +1,103 @@
#!ipxe
set timeout 0
set timeout-style hidden
set ISODIR ogLive
set default 0
set kernelargs ro boot=oginit quiet splash irqpoll acpi=on og2nd=sqfs ogprotocol=smb ogactiveadmin=true ogdebug=true ogtmpfs=15 oglivedir=${ISODIR} LANG=es_ES.UTF-8 ip=192.168.2.11:192.168.2.1:192.168.2.1:255.255.255.0:pc11:eth0:none group=Aula_virtual ogrepo=192.168.2.1 oglive=192.168.2.1 oglog=192.168.2.1 ogshare=192.168.2.1 ogprof=false vga=788
echo "OgLive $ISODIR"
ifopen net0
route
kernel tftp://SERVERIP/ogLive/ogvmlinuz ${kernelargs}
initrd tftp://SERVERIP/ogLive/oginitrd.img
boot
# Detectar si se está ejecutando en modo UEFI o BIOS
iseq ${platform} efi && goto uefi_menu || goto bios_mbr
:bios_mbr
echo "Running in BIOS mode - Booting MBR"
chain tftp://172.17.8.61/grub.exe --config-file="title MBR;chainloader (hd0)+1;rootnoverify (hd0);boot" || echo "Failed to boot MBR in BIOS mode"
exit
:uefi_menu
echo "Running in UEFI mode - Searching boot loaders"
set detected no
# Buscar y configurar opciones de arranque
echo "Searching Grub"
sanboot --no-describe --drive 0 --filename \EFI\grub\Boot\grubx64.efi && goto add_grub
:add_grub
set detected yes
echo "Grub found"
goto boot_grub
:boot_grub
echo "Booting Grub"
sanboot --no-describe --drive 0 --filename \EFI\grub\Boot\grubx64.efi || echo "Failed to boot Grub"
exit
:refind
echo "Searching rEFInd"
sanboot --no-describe --drive 0 --filename \EFI\refind\shimx64.efi.signed && goto add_refind
:add_refind
set detected yes
echo "rEFInd found"
goto boot_refind
:boot_refind
echo "Booting rEFInd"
sanboot --no-describe --drive 0 --filename \EFI\refind\shimx64.efi.signed || echo "Failed to boot rEFInd"
exit
:part_01_02
echo "Searching Part-01-02"
sanboot --no-describe --drive 0 --filename \EFI\Part-01-02\Boot\ogloader.efi && goto add_part_01_02
:add_part_01_02
set detected yes
echo "Part-01-02 found"
goto boot_part_01_02
:boot_part_01_02
echo "Booting Part-01-02"
sanboot --no-describe --drive 0 --filename \EFI\Part-01-02\Boot\ogloader.efi || echo "Failed to boot Part-01-02"
exit
:part_01_03
echo "Searching Part-01-03"
sanboot --no-describe --drive 0 --filename \EFI\Part-01-03\Boot\ogloader.efi && goto add_part_01_03
:add_part_01_03
set detected yes
echo "Part-01-03 found"
goto boot_part_01_03
:boot_part_01_03
echo "Booting Part-01-03"
sanboot --no-describe --drive 0 --filename \EFI\Part-01-03\Boot\ogloader.efi || echo "Failed to boot Part-01-03"
exit
:microsoft
echo "Searching Microsoft"
sanboot --no-describe --drive 0 --filename \EFI\Microsoft\Boot\bootmgfw.efi && goto add_microsoft
:add_microsoft
set detected yes
echo "Microsoft Boot Manager found"
goto boot_microsoft
:boot_microsoft
echo "Booting Microsoft Boot Manager"
sanboot --no-describe --drive 0 --filename \EFI\Microsoft\Boot\bootmgfw.efi || echo "Failed to boot Microsoft Boot Manager"
exit
:ubuntu
echo "Searching Ubuntu"
sanboot --no-describe --drive 0 --filename \EFI\ubuntu\grubx64.efi && goto add_ubuntu
:add_ubuntu
set detected yes
echo "Ubuntu found"
goto boot_ubuntu
:boot_ubuntu
echo "Booting Ubuntu"
sanboot --no-describe --drive 0 --filename \EFI\ubuntu\grubx64.efi || echo "Failed to boot Ubuntu"
exit
:no_os_detected
iseq ${detected} no && echo "OpenGnsys no ha detectado ningún sistema operativo en este equipo"
exit

View File

@ -0,0 +1,15 @@
#!ipxe
# Detectar si se está ejecutando en modo UEFI o BIOS
iseq ${platform} efi && goto uefi_boot || goto bios_boot
:bios_boot
echo "Running in BIOS mode - Booting first disk"
chain http://__SERVERIP__/tftpboot/grub.exe --config-file="title FirstHardDisk;chainloader (hd0)+1;rootnoverify (hd0);boot" || echo "Failed to boot in BIOS mode"
exit
:uefi_boot
echo "Running in UEFI mode - Booting first disk"
sanboot --no-describe --drive 0 --filename \EFI\grub\Boot\grubx64.efi || echo "Failed to boot in UEFI mode"
exit

View File

@ -0,0 +1,15 @@
#!ipxe
# Detectar si se está ejecutando en modo UEFI o BIOS
iseq ${platform} efi && goto uefi_boot || goto bios_boot
:bios_boot
echo "Running in BIOS mode - Booting first disk, first partition"
chain http://__SERVERIP__/tftpboot/grub.exe --config-file="title FirstHardDisk-FirstPartition;root (hd0,0);chainloader (hd0,0)+1;boot" || echo "Failed to boot in BIOS mode"
exit
:uefi_boot
echo "Running in UEFI mode - Booting first disk, first partition"
sanboot --no-describe --drive 0 --filename \EFI\Part-01-01\Boot\ogloader.efi || echo "Failed to boot in UEFI mode"
exit

View File

@ -0,0 +1,15 @@
#!ipxe
# Detectar si se está ejecutando en modo UEFI o BIOS
iseq ${platform} efi && goto uefi_boot || goto bios_boot
:bios_boot
echo "Running in BIOS mode - Booting first disk, second partition"
chain http://__SERVERIP__/tftpboot/grub.exe --config-file="title FirstHardDisk-SecondPartition;root (hd0,1);chainloader (hd0,1)+1;boot" || echo "Failed to boot in BIOS mode"
exit
:uefi_boot
echo "Running in UEFI mode - Booting first disk, second partition"
sanboot --no-describe --drive 0 --filename \EFI\Part-01-02\Boot\ogloader.efi || echo "Failed to boot in UEFI mode"
exit

View File

@ -0,0 +1,15 @@
#!ipxe
# Detectar si se está ejecutando en modo UEFI o BIOS
iseq ${platform} efi && goto uefi_boot || goto bios_boot
:bios_boot
echo "Running in BIOS mode - Booting first disk, third partition"
chain http://__SERVERIP__/tftpboot/grub.exe --config-file="title FirstHardDisk-ThirdPartition;root (hd0,2);chainloader (hd0,2)+1;boot" || echo "Failed to boot in BIOS mode"
exit
:uefi_boot
echo "Running in UEFI mode - Booting first disk, third partition"
sanboot --no-describe --drive 0 --filename \EFI\Part-01-03\Boot\ogloader.efi || echo "Failed to boot in UEFI mode"
exit

View File

@ -1,9 +0,0 @@
#!ipxe
set timeout 0
set timeout-style hidden
set ISODIR ogLive
set default 0
set kernelargs __INFOHOST__
kernel tftp://__SERVERIP__/ogLive/ogvmlinuz ${kernelargs}
initrd tftp://__SERVERIP__/ogLive/oginitrd.img