menu.ipxe.j2 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. #!ipxe
  2. :start
  3. chain --autofree boot.ipxe ||
  4. iseq ${cls} serial && goto ignore_cls ||
  5. set cls:hex 1b:5b:4a # ANSI clear screen sequence - "^[[J"
  6. set cls ${cls:string}
  7. :ignore_cls
  8. :version_check
  9. set latest_version 1.04
  10. echo ${cls}
  11. iseq ${version} ${latest_version} && goto version_up2date ||
  12. echo
  13. echo Updated version of netboot.xyz is available:
  14. echo
  15. echo Running version.....${version}
  16. echo Updated version.....${latest_version}
  17. echo
  18. echo Please download the latest version from netboot.xyz.
  19. echo
  20. echo Attempting to chain to latest version...
  21. chain --autofree http://${boot_domain}/ipxe/${ipxe_disk} ||
  22. :version_up2date
  23. isset ${arch} && goto skip_arch_detect ||
  24. cpuid --ext 29 && set arch x86_64 || set arch i386
  25. iseq ${buildarch} arm64 && set arch arm64 ||
  26. :skip_arch_detect
  27. isset ${menu} && goto ${menu} ||
  28. isset ${ip} || dhcp || echo DHCP failed
  29. :main_menu
  30. clear menu
  31. set space:hex 20:20
  32. set space ${space:string}
  33. iseq ${arch} x86_64 && set arch_a amd64 || set arch_a ${arch}
  34. menu ${site_name}
  35. item --gap Default:
  36. item local ${space} Boot from local hdd
  37. item --gap Distributions:
  38. iseq ${menu_live} 1 && item live ${space} Live CDs ||
  39. iseq ${menu_linux} 1 && item linux ${space} Linux Network Installs ||
  40. iseq ${menu_bsd} 1 && item bsd ${space} BSD Installs ||
  41. iseq ${menu_freedos} 1 && item freedos ${space} FreeDOS ||
  42. iseq ${menu_security} 1 && item security ${space} Security Related ||
  43. iseq ${menu_windows} 1 && item windows ${space} Windows ||
  44. item --gap Tools:
  45. iseq ${menu_utils} 1 && item utils ${space} Utilities ||
  46. iseq ${arch} x86_64 && set bits 64 || set bits 32
  47. item changebits ${space} Architecture: ${arch} (${bits}bit)
  48. item shell ${space} iPXE shell
  49. item netinfo ${space} Network card info
  50. item --gap Signature Checks:
  51. item sig_check ${space} netboot.xyz [ enabled: ${sigs_enabled} ]
  52. item img_sigs_check ${space} Images [ enabled: ${img_sigs_enabled} ]
  53. isset ${github_user} && item --gap Custom Menu: ||
  54. isset ${github_user} && item nbxyz-custom ${space} ${github_user}'s Custom Menu ||
  55. isset ${menu} && set timeout 0 || set timeout 300000
  56. choose --timeout ${timeout} --default ${menu} menu || goto local
  57. echo ${cls}
  58. goto ${menu} ||
  59. iseq ${sigs_enabled} true && goto verify_sigs || goto change_menu
  60. :verify_sigs
  61. imgverify ${menu}.ipxe ${sigs}${menu}.ipxe.sig || goto error
  62. goto change_menu
  63. :change_menu
  64. chain ${menu}.ipxe || goto error
  65. goto main_menu
  66. :error
  67. echo Error occured, press any key to return to menu ...
  68. prompt
  69. goto main_menu
  70. :local
  71. echo Booting from local disks ...
  72. exit 0
  73. :shell
  74. echo Type "exit" to return to menu.
  75. set menu main_menu
  76. shell
  77. goto main_menu
  78. :changebits
  79. iseq ${arch} x86_64 && set arch i386 || set arch x86_64
  80. goto main_menu
  81. :sig_check
  82. iseq ${sigs_enabled} true && set sigs_enabled false || set sigs_enabled true
  83. goto main_menu
  84. :img_sigs_check
  85. iseq ${img_sigs_enabled} true && set img_sigs_enabled false || set img_sigs_enabled true
  86. goto main_menu
  87. :nbxyz-custom
  88. chain https://raw.githubusercontent.com/${github_user}/netboot.xyz-custom/master/custom.ipxe || goto error
  89. goto main_menu