utils-pcbios.ipxe.j2 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. #!ipxe
  2. menu Utilities
  3. item --gap Utilities:
  4. {% for key, value in utilitiespcbios.items() | sort(attribute='1.name') %}
  5. {% if value.enabled %}
  6. item {{ key }} ${space} {{ value.name }}
  7. {% endif %}
  8. {% endfor %}
  9. item --gap netboot.xyz tools:
  10. item nbxyz-custom ${space} Set Github username [user: ${github_user}]
  11. item testdistro ${space} Test Distribution ISO
  12. item nbxyz ${space} netboot.xyz endpoints
  13. choose --default ${menu} menu || goto utils_exit
  14. echo ${cls}
  15. goto ${menu} ||
  16. chain ${menu}.ipxe || goto utils_exit
  17. goto utils_exit
  18. {% for key, value in utilitiespcbios.items() | sort %}
  19. {% if value.enabled | bool and value.type == "memdisk" %}
  20. :{{ key }}
  21. set util_path {{ value.util_path }}
  22. set util_file {{ value.util_path | basename }}
  23. set util_version {{ value.version }}
  24. goto boot_{{ value.type }}
  25. {% endif %}
  26. {% endfor %}
  27. {% for key, value in utilitiespcbios.items() | sort %}
  28. {% if value.enabled | bool and value.type == "direct" %}
  29. :{{ key }}
  30. imgfree
  31. kernel {{ value.kernel }}
  32. initrd {{ value.initrd }}
  33. boot
  34. goto utils_exit
  35. {% endif %}
  36. {% endfor %}
  37. :boot_memdisk
  38. imgfree
  39. kernel ${memdisk} iso raw
  40. initrd --name ${util_file} ${util_path}
  41. echo
  42. echo MD5sums:
  43. md5sum memdisk ${util_file}
  44. boot
  45. goto utils_exit
  46. :memtest
  47. imgfree
  48. kernel {{ utilitiespcbios.memtest.util_path }}
  49. boot
  50. goto utils_exit
  51. :nbxyz-custom
  52. echo EXPERIMENTAL
  53. echo
  54. echo Make sure you have a fork of https://github.com/netbootxyz/netboot.xyz-custom.
  55. echo You can then customize your fork as needed and set up your own custom options.
  56. echo Once your username is set, a custom option will appear on the main menu.
  57. echo
  58. echo -n Please enter your Github username: ${} && read github_user
  59. goto utils_exit
  60. :testdistro
  61. echo This option will allow you to test booting an ISO using memdisk. Please
  62. echo specify the URL of the ISO you want to test and it will automatically
  63. echo attempt to load the ISO using memdisk.
  64. echo -n URL: ${} && read distro_iso
  65. kernel ${memdisk} iso raw
  66. initrd ${distro_iso}
  67. boot
  68. goto utils_exit
  69. :utils_exit
  70. clear menu
  71. exit 0