151 lines
3.6 KiB
Plaintext
151 lines
3.6 KiB
Plaintext
#!ipxe
|
|
|
|
# embedded ipxe script for netbooting from various sources
|
|
|
|
echo Activating first network device.
|
|
echo Commencing network boot.
|
|
:dhcp
|
|
dhcp net0 || goto dhcp
|
|
|
|
|
|
# configuration
|
|
## console
|
|
colour --basic 9 4
|
|
colour --basic 6 1
|
|
|
|
## variables
|
|
set iscsi_portal 10.1.5.2
|
|
|
|
## iscsi targets
|
|
set iqn-discovery-esxi iscsi:${iscsi_portal}::::iqn.2000-01.com.synology:spacedock.discovery-esxi.e84d7761fd
|
|
set iqn-ghost-windows81 iscsi:${iscsi_portal}::::iqn.2000-01.com.synology:spacedock.ghost-windows81.e84d7761fd
|
|
set iqn-ghost-archlinux iscsi:${iscsi_portal}::::iqn.2000-01.com.synology:spacedock.ghost-archlinux.e84d7761fd
|
|
set iqn-ghost-antergos iscsi:${iscsi_portal}::::iqn.2000-01.com.synology:spacedock.ghost-antergos.e84d7761fd
|
|
|
|
|
|
# jump to ip specific config
|
|
:custom
|
|
goto ${net0/ip} || goto menu
|
|
|
|
# print main boot menu
|
|
:menu
|
|
menu Boot options:
|
|
item --gap MAC Address: ${net0/mac}
|
|
item --gap IP Address: ${net0/ip}
|
|
item --gap Netmask: ${net0/netmask}
|
|
item --gap Gateway: ${net0/gateway}
|
|
item --gap DNS: ${net0/dns}
|
|
item
|
|
item localboot Boot from local disks
|
|
item
|
|
item aecat Boot from https://boot.aec.at
|
|
item netbootxyz Boot from https://boot.netboot.xyz
|
|
item
|
|
item advanced Advanced iPXE options
|
|
|
|
choose target && goto ${target}
|
|
goto menu
|
|
|
|
:advanced
|
|
menu Advanced iPXE options:
|
|
item --gap MAC Address: ${net0/mac}
|
|
item --gap IP Address: ${net0/ip}
|
|
item --gap Netmask: ${net0/netmask}
|
|
item --gap Gateway: ${net0/gateway}
|
|
item --gap DNS: ${net0/dns}
|
|
item
|
|
item reboot Reboot system
|
|
item exit Exit and continue local boot
|
|
item dhcp Renew IP address
|
|
item shell Drop to iPXE shell
|
|
item settings Open settings dialog
|
|
|
|
choose target && goto ${target}
|
|
goto advanced
|
|
|
|
:exit
|
|
exit
|
|
|
|
:config
|
|
config || goto menu
|
|
goto menu
|
|
|
|
:reboot
|
|
echo Rebooting system
|
|
sleep 2
|
|
reboot
|
|
|
|
:shell
|
|
shell
|
|
|
|
# boot options
|
|
## boot from local disks
|
|
:localboot
|
|
echo Booting from local disks
|
|
sleep 2
|
|
sanboot --no-describe --drive 0x80 || goto menu
|
|
|
|
## boot.aec.at
|
|
:aecat
|
|
echo Booting from the Ars Electronica Netboot Server (https://boot.aec.at)
|
|
sleep 2
|
|
set conn_type https
|
|
chain --autofree https://boot.aec.at/menu.ipxe || echo HTTPS failed... attempting HTTP...
|
|
set conn_type http
|
|
chain --autofree http://boot.aec.at/menu.ipxe || goto menu
|
|
|
|
## netboot.xyz
|
|
:netbootxyz
|
|
echo Booting from netboot.xyz (https://boot.netboot.xyz)
|
|
sleep 2
|
|
set conn_type https
|
|
chain --autofree https://boot.netboot.xyz/menu.ipxe || echo HTTPS failed... attempting HTTP...
|
|
set conn_type http
|
|
chain --autofree http://boot.netboot.xyz/menu.ipxe || goto menu
|
|
|
|
## GHOST - Windows 8.1
|
|
:windows81
|
|
echo Booting into Windows 8.1 from ISCSI.
|
|
set net0/keep-san 1
|
|
sleep 1
|
|
sanboot --keep ${iqn-ghost-windows81} || goto menu
|
|
|
|
## GHOST - Archlinux
|
|
:archlinux
|
|
echo Booting into Archlinux from ISCSI.
|
|
set net0/keep-san 1
|
|
sleep 1
|
|
sanboot --keep ${iqn-ghost-archlinux} || goto menu
|
|
|
|
## GHOST - Antergos
|
|
:antergos
|
|
echo Booting into Antergos from ISCSI.
|
|
set net0/keep-san 1
|
|
sleep 1
|
|
sanboot --keep ${iqn-ghost-antergos} || goto menu
|
|
|
|
## Custom boot for 10.1.5.4 (discovery_iscsi)
|
|
:10.1.5.4
|
|
echo Booting into VMWare ESXi 6.5 from ISCSI.
|
|
set net0/keep-san 1
|
|
sanboot --keep ${iqn-discovery-esxi} || goto menu
|
|
|
|
## Custom boot for 10.1.5.3 (ghost_iscsi)
|
|
:10.1.5.3
|
|
menu GHOST boot options
|
|
item --gap MAC Address: ${net0/mac}
|
|
item --gap IP Address: ${net0/ip}
|
|
item --gap Netmask: ${net0/netmask}
|
|
item
|
|
item antergos Boot into Antergos
|
|
item archlinux Boot into Archlinux
|
|
item windows81 Boot into Windows 8.1
|
|
item
|
|
item advanced Advanced iPXE options
|
|
item
|
|
|
|
choose target && goto ${target}
|
|
goto ${net0/ip} || goto menu
|
|
|
|
|