1
0

menu.ipxe.j2 4.2 KB

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