rhel.ipxe.j2 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. #!ipxe
  2. # Redhat Enterprise Linux (RHEL)
  3. # https://www.redhat.com
  4. isset ${dhcp-server} && set ipparam ip=dhcp || set ipparam ip=${ip}::${gateway}:${netmask}:::none nameserver=${dns}
  5. set ipparam BOOTIF=${netX/mac} ${ipparam}
  6. set rhel_arch x86_64
  7. goto ${menu} ||
  8. :rhel
  9. set os Red Hat Enterprise Linux
  10. clear rhel_version
  11. menu ${os}
  12. item --gap Installers
  13. item rhel_install ${space} ${os} Graphical Install
  14. item rhel_install_text ${space} ${os} Text Install
  15. item --gap Options:
  16. item arch_set ${space} Architecture [ ${rhel_arch} ]
  17. item url_set ${space} Base URL [ ${rhel_base_url} ]
  18. choose rhel_version || goto rhel_exit
  19. goto ${rhel_version}
  20. :arch_set
  21. iseq ${rhel_arch} x86_64 && set rhel_arch i386 || set rhel_arch x86_64
  22. goto rhel
  23. :url_set
  24. echo Set the HTTP URL of an extracted RHEL ISO without the trailing slash:
  25. echo e.g. http://www.mydomain.com/rhel/7
  26. echo
  27. echo -n URL: ${} && read rhel_base_url
  28. echo
  29. echo netboot.xyz will attempt to load the following files:
  30. echo ${rhel_base_url}/os/${rhel_arch}/images/pxeboot/vmlinuz
  31. echo ${rhel_base_url}/os/${rhel_arch}/images/pxeboot/initrd.img
  32. echo
  33. prompt Press any key to return to RHEL Menu...
  34. goto rhel
  35. :rhel_install_text
  36. set params text
  37. goto rhel_install
  38. :rhel_install
  39. isset ${rhel_base_url} && goto boot || echo URL not set... && goto url_set
  40. goto boot
  41. :boot
  42. imgfree
  43. kernel ${rhel_base_url}/os/${rhel_arch}/images/pxeboot/vmlinuz repo=${rhel_base_url}/os/${rhel_arch} ${ipparam} ${params} initrd=initrd.img ${cmdline}
  44. initrd ${rhel_base_url}/os/${rhel_arch}/images/pxeboot/initrd.img
  45. md5sum vmlinuz initrd.img
  46. boot
  47. goto rhel
  48. :rhel_exit
  49. exit 0