menu.ipxe 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  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} 1.04 && goto version_up2date ||
  12. iseq ${version} ${latest_version} && goto version_up2date ||
  13. echo
  14. echo Updated version of netboot.xyz 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 netboot.xyz.
  20. echo
  21. echo Attempting to chain to latest version...
  22. chain --autofree http://${boot_domain}/ipxe/netboot.xyz-dhcp-undionly.kpxe ||
  23. :version_up2date
  24. isset ${arch} && goto skip_arch_detect ||
  25. cpuid --ext 29 && set arch x86_64 || set arch i386
  26. :skip_arch_detect
  27. isset ${menu} && goto ${menu} ||
  28. isset ${ip} || dhcp || echo DHCP failed
  29. :main_menu
  30. clear menu
  31. set space:hex 20:20
  32. set space ${space:string}
  33. iseq ${arch} i386 && set arch5 i586 || set arch5 ${arch}
  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 Installers:
  39. item linux ${space} Linux Installers
  40. item bsd ${space} BSD Installers
  41. item freedos ${space} FreeDOS Installers
  42. item hypervisor ${space} Hypervisor Installers
  43. item --gap Tools:
  44. item utils ${space} Utilities
  45. item shell ${space} iPXE shell
  46. item netinfo ${space} Network card info
  47. item sig_check ${space} netboot.xyz Signature Checks [ enabled: ${sigs_enabled} ]
  48. item img_sigs_check ${space} Image Signature Checks [ enabled: ${img_sigs_enabled} ]
  49. isset ${github_user} && item --gap Custom Menu: ||
  50. isset ${github_user} && item nbxyz-custom ${space} ${github_user}'s Custom Menu ||
  51. isset ${menu} && set timeout 0 || set timeout 300000
  52. choose --timeout ${timeout} --default ${menu} menu || goto local
  53. echo ${cls}
  54. goto ${menu} ||
  55. iseq ${sigs_enabled} true && goto verify_sigs || goto change_menu
  56. :verify_sigs
  57. imgverify ${menu}.ipxe ${sigs}${menu}.ipxe.sig || goto error
  58. goto change_menu
  59. :change_menu
  60. chain ${menu}.ipxe || goto error
  61. goto main_menu
  62. :error
  63. echo Error occured, press any key to return to menu ...
  64. prompt
  65. goto main_menu
  66. :local
  67. echo Booting from local disks ...
  68. exit 0
  69. :reload
  70. echo Reloading menu.ipxe ...
  71. chain menu.ipxe
  72. :netinfo
  73. menu Network info
  74. item --gap MAC:
  75. item mac ${space} ${netX/mac}
  76. item --gap IP/mask:
  77. item ip ${space} ${netX/ip}/${netX/netmask}
  78. item --gap Gateway:
  79. item gw ${space} ${netX/gateway}
  80. item --gap Domain:
  81. item domain ${space} ${netX/domain}
  82. item --gap DNS:
  83. item dns ${space} ${netX/dns}
  84. item --gap DHCP server:
  85. item dhcpserver ${space} ${netX/dhcp-server}
  86. item --gap Next-server:
  87. item nextserver ${space} ${next-server}
  88. item --gap Filename:
  89. item filename ${space} ${netX/filename}
  90. choose empty ||
  91. goto main_menu
  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. :nbxyz-custom
  107. chain https://raw.githubusercontent.com/${github_user}/netboot.xyz-custom/master/custom.ipxe || goto error
  108. goto main_menu