utils-pcbios-64.ipxe.j2 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  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. imgfree
  59. kernel {{ utilitiespcbios64.memtest86legacy.util_path }}
  60. boot
  61. goto utils_menu
  62. :memtest86plus
  63. imgfree
  64. kernel {{ utilitiespcbios64.memtest86plus.util_path }}
  65. boot
  66. goto utils_menu
  67. :nbxyz_custom_url
  68. echo If you have a customized menu you would like to load into netboot.xyz
  69. echo set the base path url to your custom ipxe files here.
  70. echo It will look for custom.ipxe in that path as the entry point.
  71. echo
  72. echo -n Please enter your custom http url here: ${} && read custom_url
  73. goto utils_menu
  74. :nbxyz_custom_github
  75. echo Make sure you have a fork of https://github.com/netbootxyz/netboot.xyz-custom.
  76. echo You can then customize your fork as needed and set up your own custom options.
  77. echo Once your username is set, a custom option will appear on the main menu.
  78. echo
  79. echo -n Please enter your Github username: ${} && read github_user
  80. goto utils_menu
  81. :testdistro
  82. echo This option will allow you to test booting an ISO using memdisk. Please
  83. echo specify the URL of the ISO you want to test and it will automatically
  84. echo attempt to load the ISO using memdisk.
  85. echo -n URL: ${} && read distro_iso
  86. kernel ${memdisk} iso raw
  87. initrd ${distro_iso}
  88. boot
  89. goto utils_menu
  90. :utils_exit
  91. clear menu
  92. exit 0