utils-pcbios.ipxe.j2 2.2 KB

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