1
0

menu.ipxe.j2 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  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. :version_check
  10. set latest_version 1.04
  11. echo ${cls}
  12. iseq ${version} ${latest_version} && goto version_up2date ||
  13. echo
  14. echo Updated version of {{ site_name }} is available:
  15. echo
  16. echo Running version.....${version}
  17. echo Updated version.....${latest_version}
  18. echo
  19. echo Please download the latest version from {{ site_name }}.
  20. echo
  21. echo Attempting to chain to latest version...
  22. chain --autofree http://${boot_domain}/ipxe/${ipxe_disk} ||
  23. :version_up2date
  24. isset ${arch} && goto skip_arch_detect ||
  25. cpuid --ext 29 && set arch x86_64 || set arch i386
  26. iseq ${buildarch} arm64 && set arch arm64 ||
  27. :skip_arch_detect
  28. isset ${menu} && goto ${menu} ||
  29. isset ${ip} || dhcp || echo DHCP failed
  30. :main_menu
  31. clear menu
  32. set space:hex 20:20
  33. set space ${space:string}
  34. iseq ${arch} x86_64 && set arch_a amd64 || set arch_a ${arch}
  35. menu ${site_name}
  36. item --gap Default:
  37. item local ${space} Boot from local hdd
  38. item --gap Distributions:
  39. iseq ${menu_linux} 1 && item linux ${space} Linux Network Installs ||
  40. iseq ${menu_live} 1 && item live ${space} Live CDs ||
  41. iseq ${menu_bsd} 1 && item bsd ${space} BSD Installs ||
  42. iseq ${menu_freedos} 1 && item freedos ${space} FreeDOS ||
  43. iseq ${menu_security} 1 && item security ${space} Security Related ||
  44. iseq ${menu_windows} 1 && item windows ${space} Windows ||
  45. item --gap Tools:
  46. iseq ${menu_utils} 1 && item utils-${platform} ${space} Utilities ||
  47. iseq ${arch} x86_64 && set bits 64 || set bits 32
  48. item changebits ${space} Architecture: ${arch} (${bits}bit)
  49. item shell ${space} iPXE shell
  50. item netinfo ${space} Network card info
  51. item --gap Signature Checks:
  52. item sig_check ${space} netboot.xyz [ enabled: ${sigs_enabled} ]
  53. item img_sigs_check ${space} Images [ enabled: ${img_sigs_enabled} ]
  54. isset ${github_user} && item --gap Custom Menu: ||
  55. isset ${github_user} && item nbxyz-custom ${space} ${github_user}'s Custom Menu ||
  56. isset ${menu} && set timeout 0 || set timeout {{ boot_timeout }}
  57. choose --timeout ${timeout} --default ${menu} menu || goto local
  58. echo ${cls}
  59. goto ${menu} ||
  60. iseq ${sigs_enabled} true && goto verify_sigs || goto change_menu
  61. :verify_sigs
  62. imgverify ${menu}.ipxe ${sigs}${menu}.ipxe.sig || goto error
  63. goto change_menu
  64. :change_menu
  65. chain ${menu}.ipxe || goto error
  66. goto main_menu
  67. :error
  68. echo Error occured, press any key to return to menu ...
  69. prompt
  70. goto main_menu
  71. :local
  72. echo Booting from local disks ...
  73. exit 0
  74. :shell
  75. echo Type "exit" to return to menu.
  76. set menu main_menu
  77. shell
  78. goto main_menu
  79. :changebits
  80. iseq ${arch} x86_64 && set arch i386 || set arch x86_64
  81. goto main_menu
  82. :sig_check
  83. iseq ${sigs_enabled} true && set sigs_enabled false || set sigs_enabled true
  84. goto main_menu
  85. :img_sigs_check
  86. iseq ${img_sigs_enabled} true && set img_sigs_enabled false || set img_sigs_enabled true
  87. goto main_menu
  88. :nbxyz-custom
  89. chain https://raw.githubusercontent.com/${github_user}/netboot.xyz-custom/master/custom.ipxe || goto error
  90. goto main_menu