1
0

menu.ipxe.j2 3.3 KB

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