menu.ipxe 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. #!ipxe
  2. :start
  3. chain --autofree boot.cfg ||
  4. iseq ${cls} serial && goto ignore_cls ||
  5. set cls:hex 1b:5b:4a # ANSI clear screen sequence - "^[[J"
  6. set cls ${cls:string}
  7. :ignore_cls
  8. :version_check
  9. set latest_version 1.03
  10. echo ${cls}
  11. iseq ${version} ${latest_version} && goto version_up2date ||
  12. echo
  13. echo Updated version of netboot.xyz is available:
  14. echo
  15. echo Running version.....${version}
  16. echo Updated version.....${latest_version}
  17. echo
  18. echo Please download the latest version from netboot.xyz.
  19. echo
  20. echo Attempting to chain to latest version...
  21. chain --autofree http://${boot_domain}/ipxe/netboot.xyz-dhcp-undionly.kpxe ||
  22. :version_up2date
  23. isset ${arch} && goto skip_arch_detect ||
  24. cpuid --ext 29 && set arch x86_64 || set arch i386
  25. :skip_arch_detect
  26. isset ${menu} && goto ${menu} ||
  27. isset ${ip} || dhcp || echo DHCP failed
  28. :main_menu
  29. clear menu
  30. set space:hex 20:20
  31. set space ${space:string}
  32. iseq ${arch} i386 && set arch5 i586 || set arch5 ${arch}
  33. iseq ${arch} x86_64 && set arch_a amd64 || set arch_a ${arch}
  34. menu ${site_name}
  35. item --gap Default:
  36. item local ${space} Boot from local hdd
  37. item --gap Installers:
  38. item linux ${space} Linux Installers
  39. item bsd ${space} BSD Installers
  40. item freedos ${space} FreeDOS Installers
  41. item hypervisor ${space} Hypervisor Installers
  42. item --gap Tools:
  43. item utils ${space} Utilities
  44. item shell ${space} iPXE shell
  45. item netinfo ${space} Network card info
  46. item sig_check ${space} netboot.xyz Signature Checks [ enabled: ${sigs_enabled} ]
  47. item img_sigs_check ${space} Image Signature Checks [ enabled: ${img_sigs_enabled} ]
  48. isset ${github_user} && item --gap Custom Menu: ||
  49. isset ${github_user} && item nbxyz-custom ${space} ${github_user}'s Custom Menu ||
  50. isset ${menu} && set timeout 0 || set timeout 300000
  51. choose --timeout ${timeout} --default ${menu} menu || goto local
  52. echo ${cls}
  53. goto ${menu} ||
  54. iseq ${sigs_enabled} true && goto verify_sigs || goto change_menu
  55. :verify_sigs
  56. imgverify ${menu}.ipxe ${sigs}${menu}.ipxe.sig || goto error
  57. goto change_menu
  58. :change_menu
  59. chain ${menu}.ipxe || goto error
  60. goto main_menu
  61. :error
  62. echo Error occured, press any key to return to menu ...
  63. prompt
  64. goto main_menu
  65. :local
  66. echo Booting from local disks ...
  67. exit 0
  68. :reload
  69. echo Reloading menu.ipxe ...
  70. chain menu.ipxe
  71. :netinfo
  72. menu Network info
  73. item --gap MAC:
  74. item mac ${space} ${netX/mac}
  75. item --gap IP/mask:
  76. item ip ${space} ${netX/ip}/${netX/netmask}
  77. item --gap Gateway:
  78. item gw ${space} ${netX/gateway}
  79. item --gap Domain:
  80. item domain ${space} ${netX/domain}
  81. item --gap DNS:
  82. item dns ${space} ${netX/dns}
  83. item --gap DHCP server:
  84. item dhcpserver ${space} ${netX/dhcp-server}
  85. item --gap Next-server:
  86. item nextserver ${space} ${next-server}
  87. item --gap Filename:
  88. item filename ${space} ${netX/filename}
  89. choose empty ||
  90. goto main_menu
  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. :nbxyz-custom
  106. chain https://raw.githubusercontent.com/${github_user}/netboot.xyz-custom/master/custom.ipxe || goto error
  107. goto main_menu