menu.ipxe 2.1 KB

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