utils-pcbios-64.ipxe.j2 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. #!ipxe
  2. :utils_menu
  3. menu Utilities
  4. item --gap Utilities:
  5. {% for key, value in utilitiespcbios64.items() | sort(attribute='1.name') %}
  6. {% if value.enabled %}
  7. item {{ key }} ${space} {{ value.name }}
  8. {% endif %}
  9. {% endfor %}
  10. item --gap netboot.xyz tools:
  11. item cmdline ${space} Kernel cmdline params: [${cmdline}]
  12. item nbxyz_custom_url ${space} Set custom menu [url: ${custom_url}]
  13. item nbxyz_custom_github ${space} Set Github username [user: ${github_user}]
  14. item testdistro ${space} Test Distribution ISO
  15. item nbxyz ${space} netboot.xyz endpoints
  16. choose --default ${menu} menu || goto utils_exit
  17. echo ${cls}
  18. goto ${menu} ||
  19. chain ${menu}.ipxe || goto utils_exit
  20. goto utils_exit
  21. {% for key, value in utilitiespcbios64.items() | sort %}
  22. {% if value.enabled | bool and value.type == "memdisk" %}
  23. :{{ key }}
  24. set util_path {{ value.util_path }}
  25. set util_file {{ value.util_path | basename }}
  26. set util_version {{ value.version }}
  27. goto boot_{{ value.type }}
  28. {% endif %}
  29. {% endfor %}
  30. {% for key, value in utilitiespcbios64.items() | sort %}
  31. {% if value.enabled | bool and value.type == "direct" %}
  32. :{{ key }}
  33. imgfree
  34. kernel {{ value.kernel }}
  35. initrd {{ value.initrd }}
  36. boot
  37. goto utils_exit
  38. {% endif %}
  39. {% endfor %}
  40. :boot_memdisk
  41. imgfree
  42. kernel ${memdisk} iso raw
  43. initrd --name ${util_file} ${util_path}
  44. echo
  45. echo MD5sums:
  46. md5sum memdisk ${util_file}
  47. boot
  48. goto utils_exit
  49. :cmdline
  50. echo If you want to change the default kernel command line parameters
  51. echo you can override the defaults here.
  52. echo
  53. echo Currently set to: ${cmdline}
  54. echo
  55. echo -n Enter cmdline parameters: ${} && read cmdline
  56. goto utils_menu
  57. :memtest86legacy
  58. :memtest86plus
  59. imgfree
  60. kernel {{ utilitiespcbios64.memtest86plus.util_path }}
  61. boot
  62. goto utils_menu
  63. :nbxyz_custom_url
  64. echo If you have a customized menu you would like to load into netboot.xyz
  65. echo set the base path url to your custom ipxe files here.
  66. echo It will look for custom.ipxe in that path as the entry point.
  67. echo
  68. echo -n Please enter your custom http url here: ${} && read custom_url
  69. goto utils_menu
  70. :nbxyz_custom_github
  71. echo Make sure you have a fork of https://github.com/netbootxyz/netboot.xyz-custom.
  72. echo You can then customize your fork as needed and set up your own custom options.
  73. echo Once your username is set, a custom option will appear on the main menu.
  74. echo
  75. echo -n Please enter your Github username: ${} && read github_user
  76. goto utils_menu
  77. :testdistro
  78. echo This option will allow you to test booting an ISO using memdisk. Please
  79. echo specify the URL of the ISO you want to test and it will automatically
  80. echo attempt to load the ISO using memdisk.
  81. echo -n URL: ${} && read distro_iso
  82. kernel ${memdisk} iso raw
  83. initrd ${distro_iso}
  84. boot
  85. goto utils_menu
  86. :utils_exit
  87. clear menu
  88. exit 0