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 --timeout 5000 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 lspci ${space} PCI Device List
  56. item about ${space} About netboot.xyz
  57. {% if sigs_menu | bool %}
  58. item --gap Signature Checks:
  59. {% if sigs_enabled | bool %}
  60. item sig_check ${space} {{ site_name }} [ enabled: ${sigs_enabled} ]
  61. {% endif %}
  62. {% if img_sigs_enabled | bool %}
  63. item img_sigs_check ${space} Images [ enabled: ${img_sigs_enabled} ]
  64. {% endif %}
  65. {% endif %}
  66. {% if custom_github_menus | bool %}
  67. isset ${github_user} && item --gap Custom Github Menu: ||
  68. isset ${github_user} && item custom-github ${space} ${github_user}'s Custom Menu ||
  69. {% endif %}
  70. {% if custom_generate_menus | bool %}
  71. item --gap Custom User Menus: ||
  72. item custom-user ${space} Custom User Menus
  73. {% endif %}
  74. isset ${menu} && set timeout 0 || set timeout {{ boot_timeout }}
  75. choose --timeout ${timeout} --default ${menu} menu || goto local
  76. echo ${cls}
  77. goto ${menu} ||
  78. iseq ${sigs_enabled} true && goto verify_sigs || goto change_menu
  79. :verify_sigs
  80. imgverify ${menu}.ipxe ${sigs}${menu}.ipxe.sig || goto error
  81. goto change_menu
  82. :change_menu
  83. chain ${menu}.ipxe || goto error
  84. goto main_menu
  85. :error
  86. echo Error occured, press any key to return to menu ...
  87. prompt
  88. goto main_menu
  89. :local
  90. echo Booting from local disks ...
  91. exit 0
  92. :shell
  93. echo Type "exit" to return to menu.
  94. set menu main_menu
  95. shell
  96. goto main_menu
  97. :changebits
  98. iseq ${arch} x86_64 && set arch i386 || set arch x86_64
  99. goto main_menu
  100. :sig_check
  101. iseq ${sigs_enabled} true && set sigs_enabled false || set sigs_enabled true
  102. goto main_menu
  103. :img_sigs_check
  104. iseq ${img_sigs_enabled} true && set img_sigs_enabled false || set img_sigs_enabled true
  105. goto main_menu
  106. :about
  107. chain https://boot.netboot.xyz/about.ipxe || chain about.ipxe
  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