1
0

menu.ipxe.j2 3.7 KB

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