blob: a654db01f6cc1b5bfb2d09320638f6b75efb386d [file] [log] [blame]
Zack Williams5b5d9a72020-11-06 13:59:06 -07001#!ipxe
2{#
3SPDX-FileCopyrightText: © 2020 Open Networking Foundation <support@opennetworking.org>
4SPDX-License-Identifier: Apache-2.0
5#}
6
7# variables
8set menu_timeout 10000
9set menu_default exit
10set http_server_url {{ pxeboot_web_server }}
11
12# menu
13:start
14menu ONF iPXE Boot Menu
Zack Williamsa5a10bc2021-04-06 11:58:44 -070015item --gap -- ------------------------- System and Network Info ------------------------
Zack Williams5b5d9a72020-11-06 13:59:06 -070016item --gap -- MAC: ${net0/mac}, Serial Number: ${serial}, Chipset: ${net0/chip}
17item --gap -- Manufacturer: ${manufacturer}, Product: ${product}
18item --gap -- UUID: ${uuid}
Zack Williams5b5d9a72020-11-06 13:59:06 -070019item --gap -- IP: ${net0/ip}, Netmask: ${net0/netmask}, Gateway: ${net0/gateway}
20item --gap -- DNS Servers: ${net0/dns}, Domain: ${net0/domain}
21item --gap -- DHCP Server: ${net0/dhcp-server}
22item --gap -- ------------------------- Operating systems ------------------------------
Zack Williams92f3c202021-08-24 23:04:47 -070023{% if "debian10" in pxeboot_boot_images %}
Zack Williamsa5a10bc2021-04-06 11:58:44 -070024item --key d deb10 Debian 10 Installer
25item --key f deb10f Debian 10 Installer (nonfree firmware)
Zack Williams92f3c202021-08-24 23:04:47 -070026{% endif %}
27{% if "debian11" in pxeboot_boot_images %}
28item --key g deb11 Debian 11 Installer
29item --key h deb11f Debian 11 Installer (nonfree firmware)
30{% endif %}
31{% if "ubuntu1804" in pxeboot_boot_images %}
Zack Williams5b5d9a72020-11-06 13:59:06 -070032item --key u ub1804 Ubuntu 18.04 Installer
Zack Williams6f70f4d2021-06-07 12:54:07 -070033item --key a ub1804as Ubuntu 18.04 Installer (fully automatic, serial)
Zack Williams92f3c202021-08-24 23:04:47 -070034item --key m ub1804am Ubuntu 18.04 Installer (fully automatic, MAC)
Zack Williamsa5a10bc2021-04-06 11:58:44 -070035item --key t ub1804adt Ubuntu 18.04 Installer (fully automatic, debug, text)
Zack Williams92f3c202021-08-24 23:04:47 -070036{% endif %}
37{% if "ubuntu2004" in pxeboot_boot_images %}
38item --key v ub2004 Ubuntu 20.04 Installer
39{% endif %}
40{% if "openbsd70" in pxeboot_boot_images %}
41item --key o openbsd70 OpenBSD 7.0 Installer
42{% endif %}
43{% if "memtest" in pxeboot_boot_images %}
Zack Williams5b5d9a72020-11-06 13:59:06 -070044item --key m memtest Memtest
Zack Williams92f3c202021-08-24 23:04:47 -070045{% endif %}
46item --gap -- ------------------------- Utilities --------------------------------------
Zack Williams5b5d9a72020-11-06 13:59:06 -070047item --key c configure Configuration Menu
48item --key s shell iPXE Shell
49item --key r reboot Reboot
50item --key x exit Exit iPXE and continue system boot
51choose --timeout ${menu_timeout} --default ${menu_default} selected || goto cancel
52set menu-timeout 0
53goto ${selected}
54
Zack Williams92f3c202021-08-24 23:04:47 -070055# Utility functions
Zack Williams5b5d9a72020-11-06 13:59:06 -070056:cancel
57echo Menu canceled, dropping to iPXE shell
58goto shell
59
60:configure
61config
62set menu-timeout 0
63set submenu-timeout 0
64goto start
65
66:shell
67echo Type 'exit' to get the back to the menu
68shell
69set menu-timeout 0
70set submenu-timeout 0
71goto start
72
73:failed
74echo Booting failed, dropping to shell
75goto shell
76
77:reboot
78reboot
79
80:exit
81exit
82
83# diagnostics
Zack Williams92f3c202021-08-24 23:04:47 -070084{% if "memtest" in pxeboot_boot_images %}
85
86# memtest
Zack Williams5b5d9a72020-11-06 13:59:06 -070087:memtest
88echo Booting Memtest
Zack Williams92f3c202021-08-24 23:04:47 -070089kernel ${http_server_url}/utils/memdisk
Zack Williams5b5d9a72020-11-06 13:59:06 -070090initrd ${http_server_url}/memtest/memtest.iso
91imgargs memdisk iso raw
92boot || goto failed
Zack Williams92f3c202021-08-24 23:04:47 -070093{% endif %}
Zack Williams5b5d9a72020-11-06 13:59:06 -070094
95# installers
Zack Williams92f3c202021-08-24 23:04:47 -070096{% if "debian10" in pxeboot_boot_images %}
Zack Williams5b5d9a72020-11-06 13:59:06 -070097
Zack Williamsa5a10bc2021-04-06 11:58:44 -070098# Debian 10
99:deb10
100echo Booting Debian 10 Installer
101kernel ${http_server_url}/debian10/linux
102initrd ${http_server_url}/debian10/initrd.gz
103boot || goto failed
104
105# Debian 10 with nonfree firmware
106:deb10f
107echo Booting Debian 10 Installer with nonfree firmware
108kernel ${http_server_url}/debian10/linux initrd=initrd.gz initrd=firmware.cpio.gz
109initrd ${http_server_url}/debian10/initrd.gz
110initrd ${http_server_url}/debian10/firmware.cpio.gz
111boot || goto failed
Zack Williams92f3c202021-08-24 23:04:47 -0700112{% endif %}
113{% if "debian11" in pxeboot_boot_images %}
114
115# Debian 11
116:deb11
117echo Booting Debian 11 Installer
118kernel ${http_server_url}/debian11/linux
119initrd ${http_server_url}/debian11/initrd.gz
120boot || goto failed
121
122# Debian 11 with nonfree firmware
123:deb11f
124echo Booting Debian 11 Installer with nonfree firmware
125kernel ${http_server_url}/debian11/linux initrd=initrd.gz initrd=firmware.cpio.gz
126initrd ${http_server_url}/debian11/initrd.gz
127initrd ${http_server_url}/debian11/firmware.cpio.gz
128boot || goto failed
129{% endif %}
130{% if "ubuntu1804" in pxeboot_boot_images %}
Zack Williamsa5a10bc2021-04-06 11:58:44 -0700131
Zack Williams5b5d9a72020-11-06 13:59:06 -0700132# Ubuntu 18.04
133:ub1804
134echo Booting Ubuntu 18.04 Installer
135kernel ${http_server_url}/ubuntu1804/linux
136initrd ${http_server_url}/ubuntu1804/initrd.gz
Zack Williams5b5d9a72020-11-06 13:59:06 -0700137boot || goto failed
138
Zack Williams6f70f4d2021-06-07 12:54:07 -0700139# Ubuntu 18.04 autoinstall, serial
Zack Williams5b5d9a72020-11-06 13:59:06 -0700140# https://ipxe.org/appnote/debian_preseed
Zack Williams6f70f4d2021-06-07 12:54:07 -0700141:ub1804as
142echo Booting Ubuntu 18.04 Installer (autoinstall, serial)
Zack Williamsdb394142020-11-11 22:52:34 -0700143kernel ${http_server_url}/ubuntu1804/linux initrd=initrd.gz initrd=preseed.cfg
Zack Williams5b5d9a72020-11-06 13:59:06 -0700144initrd ${http_server_url}/ubuntu1804/initrd.gz
145initrd ${http_server_url}/ubuntu1804/${serial}_preseed.cfg preseed.cfg
Zack Williams3fcd2c52021-03-02 21:44:52 -0700146boot || goto failed
147
Zack Williams6f70f4d2021-06-07 12:54:07 -0700148# Ubuntu 18.04 autoinstall, MAC
149# https://ipxe.org/appnote/debian_preseed
150:ub1804am
151echo Booting Ubuntu 18.04 Installer (autoinstall, MAC)
152kernel ${http_server_url}/ubuntu1804/linux initrd=initrd.gz initrd=preseed.cfg
153initrd ${http_server_url}/ubuntu1804/initrd.gz
154initrd ${http_server_url}/ubuntu1804/${net0/mac}_preseed.cfg preseed.cfg
155boot || goto failed
Zack Williams92f3c202021-08-24 23:04:47 -0700156{% if pxeboot_image_debug %}
Zack Williams6f70f4d2021-06-07 12:54:07 -0700157
Zack Williams3fcd2c52021-03-02 21:44:52 -0700158# Ubuntu 18.04 autoinstall, text-mode, debug
159:ub1804adt
160echo Booting Ubuntu 18.04 Installer, text mode, debug
161kernel ${http_server_url}/ubuntu1804/linux initrd=initrd.gz initrd=preseed.cfg DEBIAN_FRONTEND=text BOOT_DEBUG=2
162initrd ${http_server_url}/ubuntu1804/initrd.gz
163initrd ${http_server_url}/ubuntu1804/${serial}_preseed.cfg preseed.cfg
Zack Williams5b5d9a72020-11-06 13:59:06 -0700164boot || goto failed
Zack Williams92f3c202021-08-24 23:04:47 -0700165{% endif %}
166{% endif %}
167{% if "ubuntu2004" in pxeboot_boot_images %}
168
169# Ubuntu 18.04
170:ub2004
171echo Booting Ubuntu 20.04 Installer
172kernel ${http_server_url}/ubuntu2004/linux
173initrd ${http_server_url}/ubuntu2004/initrd.gz
174boot || goto failed
175{% endif %}
176{% if "openbsd70" in pxeboot_boot_images %}
177
178# OpenBSD 7.0
179:openbsd70
180echo Booting OpenBSD 7.0
181kernel ${http_server_url}/utils/memdisk
182initrd ${http_server_url}/openbsd70/cd70.iso
183imgargs memdisk iso raw
184boot || goto failed
185{% endif %}