utils-pcbios.ipxe.j2 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. #!ipxe
  2. menu Utilities - Image Sig Checks: [${img_sigs_enabled}]
  3. item --gap Utilities:
  4. {% for key, value in utilities.items() | sort(attribute='1.name') %}
  5. {% if value.enabled | bool and value.menu == "pcbios" %}
  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 testpr ${space} Test forked netboot.xyz branch or hash
  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 utilities.items() | sort %}
  19. {% if value.enabled | bool and value.menu == "pcbios" %}
  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. :boot_memdisk
  28. imgfree
  29. kernel ${memdisk} iso raw
  30. initrd --name ${util_file} ${util_path}
  31. echo
  32. echo MD5sums:
  33. md5sum memdisk ${util_file}
  34. iseq ${img_sigs_enabled} true && goto verify_sigs || goto skip_sigs
  35. :verify_sigs
  36. echo
  37. echo Checking signatures...
  38. imgverify memdisk ${sigs}memdisk.sig || goto error
  39. imgverify ${util_file} ${sigs}${menu}/${util_file}.sig || goto error
  40. echo Signatures verified!
  41. echo
  42. :skip_sigs
  43. boot
  44. goto utils_exit
  45. :boot_memtest
  46. chain https://${util_path} && goto main_menu ||
  47. goto utils_exit
  48. :nbxyz-custom
  49. echo EXPERIMENTAL
  50. echo
  51. echo Make sure you have a fork of https://github.com/antonym/netboot.xyz-custom.
  52. echo You can then customize your fork as needed and set up your own custom options.
  53. echo Once your username is set, a custom option will appear on the main menu.
  54. echo
  55. echo -n Please enter your Github username: ${} && read github_user
  56. goto utils_exit
  57. :testdistro
  58. echo This option will allow you to test booting an ISO using memdisk. Please
  59. echo specify the URL of the ISO you want to test and it will automatically
  60. echo attempt to load the ISO using memdisk.
  61. echo -n URL: ${} && read distro_iso
  62. kernel ${memdisk} iso raw
  63. initrd ${distro_iso}
  64. boot
  65. goto utils_exit
  66. :testpr
  67. clear github_user
  68. clear github_branch_or_hash
  69. echo This will chainload into a testing branch of netboot.xyz. You'll need to enter
  70. echo your Github username and the first part of the commit hash of the commit you want
  71. echo to test or the branch name. This assumes you are testing from a forked netboot.xyz
  72. echo repo.
  73. echo
  74. echo -n Specify Github username: ${} && read github_user
  75. echo -n Specify Github branch name or commit hash ( i.e. my_feature or 30b7ca ): ${} && read github_branch_or_hash
  76. echo
  77. echo Attempting to chainload branch or hash:
  78. chain --autofree https://raw.githubusercontent.com/${github_user}/netboot.xyz/${github_branch_or_hash}/src/menu.ipxe || echo Unable to find Github branch or hash... && sleep 5 && goto utils_exit
  79. goto utils_exit
  80. :utils_exit
  81. clear menu
  82. exit 0