menu.ipxe.j2 3.5 KB

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