1
0

centos.ipxe.j2 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. #!ipxe
  2. # CentOS Operating System
  3. # http://www.centos.org
  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. goto ${menu} ||
  7. :centos
  8. clear osversion
  9. set os {{ releases.centos.name }}
  10. set os_arch ${arch}
  11. iseq ${os_arch} x86_64 && set os_arch x86_64 ||
  12. iseq ${os_arch} arm64 && set os_arch aarch64 ||
  13. menu ${os} - ${os_arch}
  14. {% for item in releases.centos.versions %}
  15. item {{ item.code_name }} ${space} ${os} {{ item.name }}
  16. {% endfor %}
  17. isset ${osversion} || choose osversion || goto linux_menu
  18. echo ${cls}
  19. iseq ${os_arch} x86_64 && set dir ${centos_base_dir}/${osversion}/BaseOS/${os_arch}/os ||
  20. iseq ${os_arch} aarch64 && set dir altarch/${osversion}/BaseOS/${os_arch}/os ||
  21. set repo ${centos_mirror}/${dir}
  22. goto boottype
  23. :boottype
  24. set ova ${os} ${osversion}
  25. menu ${os} ${os_arch} boot type
  26. item graphical ${ova} graphical installer
  27. item text ${ova} text based installer
  28. item rescue ${ova} rescue
  29. item kickstart ${ova} set kickstart url [ ${ks_url} ]
  30. isset ${bt} || choose bt || goto centos
  31. echo ${cls}
  32. iseq ${bt} text && goto text ||
  33. iseq ${bt} rescue && goto rescue ||
  34. iseq ${bt} kickstart && goto kickstart ||
  35. iseq ${bt} kickstart_device && goto kickstart_device ||
  36. goto bootos_images
  37. :graphical
  38. set install_mode inst.graphical ||
  39. goto bootos_images
  40. :text
  41. set install_mode inst.text ||
  42. goto bootos_images
  43. :rescue
  44. set params inst.rescue ||
  45. goto bootos_images
  46. :kickstart
  47. echo -n Specify kickstart URL for ${os} ${osversion}: && read ks_url
  48. set params inst.ks=${ks_url} ||
  49. clear bt
  50. goto boottype
  51. :bootos_images
  52. imgfree
  53. iseq ${osversion} 9-stream && set centos_mirror http://mirror.rackspace.com/centos-stream ||
  54. iseq ${osversion} 9-stream && set dir ${osversion}/BaseOS/${os_arch}/os ||
  55. iseq ${osversion} 9-stream && set repo ${centos_mirror}/${dir} ||
  56. kernel ${centos_mirror}/${dir}/images/pxeboot/vmlinuz inst.repo=${repo} ${install_mode} ${params} ${ipparam} {{ kernel_params }}
  57. initrd ${centos_mirror}/${dir}/images/pxeboot/initrd.img
  58. echo
  59. echo MD5sums:
  60. md5sum vmlinuz initrd.img
  61. boot
  62. goto linux_menu
  63. :linux_menu
  64. clear menu
  65. exit 0