menu.ipxe 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  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. isset ${arch} && goto skip_arch_detect ||
  9. cpuid --ext 29 && set arch x86_64 || set arch i386
  10. :skip_arch_detect
  11. isset ${menu} && goto ${menu} ||
  12. isset ${ip} || dhcp || echo DHCP failed
  13. :main_menu
  14. clear menu
  15. set space:hex 20:20
  16. set space ${space:string}
  17. iseq ${arch} i386 && set arch5 i586 || set arch5 ${arch}
  18. iseq ${arch} x86_64 && set arch_a amd64 || set arch_a ${arch}
  19. menu ${site_name}
  20. item --gap Default:
  21. item local ${space} Boot from local hdd
  22. item --gap Operating Systems:
  23. item linux ${space} Linux Based
  24. item bsd ${space} BSD Based
  25. item --gap Tools:
  26. item utils ${space} Utilities
  27. item shell ${space} iPXE shell
  28. item netinfo ${space} Network card info
  29. isset ${menu} && set timeout 0 || set timeout 300000
  30. choose --timeout ${timeout} --default ${menu} menu || goto local
  31. echo ${cls}
  32. goto ${menu} ||
  33. chain ${menu}.ipxe || goto error
  34. goto main_menu
  35. :error
  36. echo Error occured, press any key to return to menu ...
  37. prompt
  38. goto main_menu
  39. :local
  40. echo Booting from local disks ...
  41. exit 0
  42. :reload
  43. echo Reloading menu.ipxe ...
  44. chain menu.ipxe
  45. :netinfo
  46. menu Network info
  47. item --gap MAC:
  48. item mac ${space} ${netX/mac}
  49. item --gap IP/mask:
  50. item ip ${space} ${netX/ip}/${netX/netmask}
  51. item --gap Gateway:
  52. item gw ${space} ${netX/gateway}
  53. item --gap Domain:
  54. item domain ${space} ${netX/domain}
  55. item --gap DNS:
  56. item dns ${space} ${netX/dns}
  57. item --gap DHCP server:
  58. item dhcpserver ${space} ${netX/dhcp-server}
  59. item --gap Next-server:
  60. item nextserver ${space} ${next-server}
  61. item --gap Filename:
  62. item filename ${space} ${netX/filename}
  63. choose empty ||
  64. goto main_menu
  65. :shell
  66. echo Type "exit" to return to menu.
  67. set menu main_menu
  68. shell
  69. goto main_menu
  70. :changebits
  71. iseq ${arch} x86_64 && set arch i386 || set arch x86_64
  72. goto main_menu
  73. # OS
  74. :linux
  75. chain linux.ipxe
  76. goto main_menu
  77. :bsd
  78. chain bsd.ipxe
  79. goto main_menu
  80. :hypervisors
  81. chain hypervisors.ipxe
  82. goto main_menu
  83. :utils
  84. chain utils.ipxe
  85. goto main_menu