Zack Williams | 5b5d9a7 | 2020-11-06 13:59:06 -0700 | [diff] [blame] | 1 | #!ipxe |
| 2 | {# |
| 3 | SPDX-FileCopyrightText: © 2020 Open Networking Foundation <support@opennetworking.org> |
| 4 | SPDX-License-Identifier: Apache-2.0 |
| 5 | #} |
| 6 | |
| 7 | # variables |
| 8 | set menu_timeout 10000 |
| 9 | set menu_default exit |
| 10 | set http_server_url {{ pxeboot_web_server }} |
| 11 | |
| 12 | # menu |
| 13 | :start |
| 14 | menu ONF iPXE Boot Menu |
| 15 | item --gap -- ------------------------- System Info ------------------------------------ |
| 16 | item --gap -- MAC: ${net0/mac}, Serial Number: ${serial}, Chipset: ${net0/chip} |
| 17 | item --gap -- Manufacturer: ${manufacturer}, Product: ${product} |
| 18 | item --gap -- UUID: ${uuid} |
| 19 | item --gap -- ------------------------- Network Info ------------------------------------ |
| 20 | item --gap -- IP: ${net0/ip}, Netmask: ${net0/netmask}, Gateway: ${net0/gateway} |
| 21 | item --gap -- DNS Servers: ${net0/dns}, Domain: ${net0/domain} |
| 22 | item --gap -- DHCP Server: ${net0/dhcp-server} |
| 23 | item --gap -- ------------------------- Operating systems ------------------------------ |
| 24 | item --key u ub1804 Ubuntu 18.04 Installer |
| 25 | item --key u ub1804a Ubuntu 18.04 Installer (fully automatic) |
Zack Williams | 3fcd2c5 | 2021-03-02 21:44:52 -0700 | [diff] [blame^] | 26 | item --key u ub1804adt Ubuntu 18.04 Installer (fully automatic, debug, text) |
Zack Williams | 5b5d9a7 | 2020-11-06 13:59:06 -0700 | [diff] [blame] | 27 | item --gap -- ------------------------- Diagnostics ------------------------------------ |
| 28 | item --key m memtest Memtest |
| 29 | item --gap -- ------------------------- Other ------------------------------------------ |
| 30 | item --key c configure Configuration Menu |
| 31 | item --key s shell iPXE Shell |
| 32 | item --key r reboot Reboot |
| 33 | item --key x exit Exit iPXE and continue system boot |
| 34 | choose --timeout ${menu_timeout} --default ${menu_default} selected || goto cancel |
| 35 | set menu-timeout 0 |
| 36 | goto ${selected} |
| 37 | |
| 38 | # other functions |
| 39 | :cancel |
| 40 | echo Menu canceled, dropping to iPXE shell |
| 41 | goto shell |
| 42 | |
| 43 | :configure |
| 44 | config |
| 45 | set menu-timeout 0 |
| 46 | set submenu-timeout 0 |
| 47 | goto start |
| 48 | |
| 49 | :shell |
| 50 | echo Type 'exit' to get the back to the menu |
| 51 | shell |
| 52 | set menu-timeout 0 |
| 53 | set submenu-timeout 0 |
| 54 | goto start |
| 55 | |
| 56 | :failed |
| 57 | echo Booting failed, dropping to shell |
| 58 | goto shell |
| 59 | |
| 60 | :reboot |
| 61 | reboot |
| 62 | |
| 63 | :exit |
| 64 | exit |
| 65 | |
| 66 | # diagnostics |
| 67 | :memtest |
| 68 | echo Booting Memtest |
| 69 | kernel ${http_server_url}/memtest/memdisk |
| 70 | initrd ${http_server_url}/memtest/memtest.iso |
| 71 | imgargs memdisk iso raw |
| 72 | boot || goto failed |
| 73 | |
| 74 | # installers |
| 75 | |
| 76 | # Ubuntu 18.04 |
| 77 | :ub1804 |
| 78 | echo Booting Ubuntu 18.04 Installer |
| 79 | kernel ${http_server_url}/ubuntu1804/linux |
| 80 | initrd ${http_server_url}/ubuntu1804/initrd.gz |
Zack Williams | 5b5d9a7 | 2020-11-06 13:59:06 -0700 | [diff] [blame] | 81 | boot || goto failed |
| 82 | |
| 83 | # Ubuntu 18.04 autoinstall |
| 84 | # https://ipxe.org/appnote/debian_preseed |
| 85 | :ub1804a |
| 86 | echo Booting Ubuntu 18.04 Installer |
Zack Williams | db39414 | 2020-11-11 22:52:34 -0700 | [diff] [blame] | 87 | kernel ${http_server_url}/ubuntu1804/linux initrd=initrd.gz initrd=preseed.cfg |
Zack Williams | 5b5d9a7 | 2020-11-06 13:59:06 -0700 | [diff] [blame] | 88 | initrd ${http_server_url}/ubuntu1804/initrd.gz |
| 89 | initrd ${http_server_url}/ubuntu1804/${serial}_preseed.cfg preseed.cfg |
Zack Williams | 3fcd2c5 | 2021-03-02 21:44:52 -0700 | [diff] [blame^] | 90 | boot || goto failed |
| 91 | |
| 92 | # Ubuntu 18.04 autoinstall, text-mode, debug |
| 93 | :ub1804adt |
| 94 | echo Booting Ubuntu 18.04 Installer, text mode, debug |
| 95 | kernel ${http_server_url}/ubuntu1804/linux initrd=initrd.gz initrd=preseed.cfg DEBIAN_FRONTEND=text BOOT_DEBUG=2 |
| 96 | initrd ${http_server_url}/ubuntu1804/initrd.gz |
| 97 | initrd ${http_server_url}/ubuntu1804/${serial}_preseed.cfg preseed.cfg |
Zack Williams | 5b5d9a7 | 2020-11-06 13:59:06 -0700 | [diff] [blame] | 98 | boot || goto failed |