diff options
| author | diogo464 <[email protected]> | 2025-10-11 11:34:59 +0100 |
|---|---|---|
| committer | diogo464 <[email protected]> | 2025-10-11 11:34:59 +0100 |
| commit | 521218ce06fbb7bd518eb6a069406936079e3ec2 (patch) | |
| tree | 862e84ec23175119abb7652e197a4113e7fcc31b /menu.ipxe | |
| parent | 89db26c86bf48a4c527778fc254765a38b7e9085 (diff) | |
initial working version
Diffstat (limited to 'menu.ipxe')
| -rw-r--r-- | menu.ipxe | 121 |
1 files changed, 121 insertions, 0 deletions
diff --git a/menu.ipxe b/menu.ipxe new file mode 100644 index 0000000..cf4f20b --- /dev/null +++ b/menu.ipxe | |||
| @@ -0,0 +1,121 @@ | |||
| 1 | #!ipxe | ||
| 2 | |||
| 3 | :start | ||
| 4 | isset ${arch} && goto skip_arch_detect || | ||
| 5 | cpuid --ext 29 && set arch x86_64 || set arch i386 | ||
| 6 | iseq ${buildarch} arm64 && set arch arm64 || | ||
| 7 | :skip_arch_detect | ||
| 8 | chain --autofree boot.cfg || | ||
| 9 | echo Attempting to retrieve latest upstream version number... | ||
| 10 | chain --timeout 5000 https://boot.netboot.xyz/version.ipxe || | ||
| 11 | ntp 0.pool.ntp.org || | ||
| 12 | iseq ${cls} serial && goto ignore_cls || | ||
| 13 | set cls:hex 1b:5b:4a # ANSI clear screen sequence - "^[[J" | ||
| 14 | set cls ${cls:string} | ||
| 15 | :ignore_cls | ||
| 16 | |||
| 17 | :version_check | ||
| 18 | set latest_version 2.x | ||
| 19 | echo ${cls} | ||
| 20 | iseq ${version} ${latest_version} && goto version_up2date || | ||
| 21 | echo | ||
| 22 | echo Updated version of netboot.xyz is available: | ||
| 23 | echo | ||
| 24 | echo Running version.....${version} | ||
| 25 | echo Updated version.....${latest_version} | ||
| 26 | echo | ||
| 27 | echo Please download the latest version from netboot.xyz. | ||
| 28 | echo | ||
| 29 | echo Attempting to chain to latest version... | ||
| 30 | chain --autofree http://${boot_domain}/ipxe/${ipxe_disk} || | ||
| 31 | :version_up2date | ||
| 32 | |||
| 33 | isset ${menu} && goto ${menu} || | ||
| 34 | isset ${ip} || dhcp | ||
| 35 | |||
| 36 | :main_menu | ||
| 37 | clear menu | ||
| 38 | set space:hex 20:20 | ||
| 39 | set space ${space:string} | ||
| 40 | isset ${next-server} && menu ${site_name} v${version} - next-server: ${next-server} || menu ${site_name} | ||
| 41 | item --gap Default: | ||
| 42 | item local ${space} Boot from local hdd | ||
| 43 | item --gap Distributions: | ||
| 44 | iseq ${menu_linux} 1 && item linux ${space} Linux Network Installs (64-bit) || | ||
| 45 | iseq ${menu_linux_i386} 1 && item linux-i386 ${space} Linux Network Installs (32-bit) || | ||
| 46 | iseq ${menu_linux_arm} 1 && item linux-arm ${space} Linux Network Installs (arm64) || | ||
| 47 | iseq ${menu_live} 1 && item live ${space} Live CDs || | ||
| 48 | iseq ${menu_live_arm} 1 && item live-arm ${space} Live CDs || | ||
| 49 | iseq ${menu_bsd} 1 && item bsd ${space} BSD Installs || | ||
| 50 | iseq ${menu_unix} 1 && item unix ${space} Unix Network Installs || | ||
| 51 | iseq ${menu_freedos} 1 && item freedos ${space} FreeDOS || | ||
| 52 | iseq ${menu_windows} 1 && item windows ${space} Windows || | ||
| 53 | item --gap Tools: | ||
| 54 | iseq ${menu_utils} 1 && iseq ${platform} efi && item utils-efi ${space} Utilities (UEFI) || | ||
| 55 | iseq ${menu_utils} 1 && iseq ${platform} pcbios && iseq ${arch} x86_64 && item utils-pcbios-64 ${space} Utilities (64-bit) || | ||
| 56 | iseq ${menu_utils} 1 && iseq ${platform} pcbios && iseq ${arch} i386 && item utils-pcbios-32 ${space} Utilities (32-bit) || | ||
| 57 | iseq ${menu_utils_arm} 1 && item utils-arm ${space} Utilities (arm64) || | ||
| 58 | item change_arch ${space} Architecture: ${arch} | ||
| 59 | item shell ${space} iPXE shell | ||
| 60 | item netinfo ${space} Network card info | ||
| 61 | iseq ${menu_pci} 1 && item lspci ${space} PCI Device List || | ||
| 62 | item about ${space} About netboot.xyz | ||
| 63 | item --gap Signature Checks: | ||
| 64 | item sig_check ${space} netboot.xyz [ enabled: ${sigs_enabled} ] | ||
| 65 | isset ${github_user} && item --gap Custom Github Menu: || | ||
| 66 | isset ${github_user} && item custom-github ${space} ${github_user}'s Custom Menu || | ||
| 67 | isset ${custom_url} && item --gap Custom URL Menu: || | ||
| 68 | isset ${custom_url} && item custom-url ${space} Custom URL Menu || | ||
| 69 | isset ${menu} && set timeout 0 || set timeout ${boot_timeout} | ||
| 70 | choose --timeout ${timeout} --default ${menu} menu || goto local | ||
| 71 | echo ${cls} | ||
| 72 | goto ${menu} || | ||
| 73 | iseq ${sigs_enabled} true && goto verify_sigs || goto change_menu | ||
| 74 | |||
| 75 | :verify_sigs | ||
| 76 | imgverify ${menu}.ipxe ${sigs}${menu}.ipxe.sig || goto error | ||
| 77 | goto change_menu | ||
| 78 | |||
| 79 | :change_menu | ||
| 80 | chain ${menu}.ipxe || goto error | ||
| 81 | goto main_menu | ||
| 82 | |||
| 83 | :error | ||
| 84 | echo Error occurred, press any key to return to menu ... | ||
| 85 | prompt | ||
| 86 | goto main_menu | ||
| 87 | |||
| 88 | :local | ||
| 89 | echo Booting from local disks ... | ||
| 90 | exit 1 | ||
| 91 | |||
| 92 | :shell | ||
| 93 | echo Type "exit" to return to menu. | ||
| 94 | set menu main_menu | ||
| 95 | shell | ||
| 96 | goto main_menu | ||
| 97 | |||
| 98 | :change_arch | ||
| 99 | iseq ${arch} x86_64 && set arch i386 && set menu_linux_i386 1 && set menu_linux 0 && goto main_menu || | ||
| 100 | iseq ${arch} i386 && set arch x86_64 && set menu_linux_i386 0 && set menu_linux 1 && goto main_menu || | ||
| 101 | goto main_menu | ||
| 102 | |||
| 103 | :sig_check | ||
| 104 | iseq ${sigs_enabled} true && set sigs_enabled false || set sigs_enabled true | ||
| 105 | goto main_menu | ||
| 106 | |||
| 107 | :about | ||
| 108 | chain https://boot.netboot.xyz/about.ipxe || chain about.ipxe | ||
| 109 | goto main_menu | ||
| 110 | |||
| 111 | :custom-github | ||
| 112 | chain https://raw.githubusercontent.com/${github_user}/netboot.xyz-custom/master/custom.ipxe || goto error | ||
| 113 | goto main_menu | ||
| 114 | |||
| 115 | :custom-url | ||
| 116 | chain ${custom_url}/custom.ipxe || goto error | ||
| 117 | goto main_menu | ||
| 118 | |||
| 119 | :custom-user | ||
| 120 | chain custom/custom.ipxe | ||
| 121 | goto main_menu | ||
