centos.ipxe.j2 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  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. iseq ${os_arch} x86_64 && iseq ${osversion} 7 && set dir ${centos_base_dir}/${osversion}/os/${os_arch} ||
  22. iseq ${os_arch} aarch64 && iseq ${osversion} 7 && set dir altarch/${osversion}/os/${os_arch} ||
  23. set repo ${centos_mirror}/${dir}
  24. goto boottype
  25. :boottype
  26. set ova ${os} ${osversion}
  27. menu ${os} ${os_arch} boot type
  28. item graphical ${ova} graphical installer
  29. item text ${ova} text based installer
  30. item rescue ${ova} rescue
  31. item kickstart ${ova} set kickstart url [ ${ks_url} ]
  32. isset ${bt} || choose bt || goto centos
  33. echo ${cls}
  34. iseq ${bt} text && goto text ||
  35. iseq ${bt} rescue && goto rescue ||
  36. iseq ${bt} kickstart && goto kickstart ||
  37. iseq ${bt} kickstart_device && goto kickstart_device ||
  38. goto bootos_images
  39. :graphical
  40. set install_mode inst.graphical ||
  41. goto bootos_images
  42. :text
  43. set install_mode inst.text ||
  44. goto bootos_images
  45. :rescue
  46. set params inst.rescue ||
  47. goto bootos_images
  48. :kickstart
  49. echo -n Specify kickstart URL for ${os} ${osversion}: && read ks_url
  50. set params inst.ks=${ks_url} ||
  51. clear bt
  52. goto boottype
  53. :bootos_images
  54. imgfree
  55. iseq ${osversion} 9-stream && set centos_mirror http://mirror.rackspace.com/centos-stream ||
  56. iseq ${osversion} 9-stream && set dir ${osversion}/BaseOS/${os_arch}/os ||
  57. iseq ${osversion} 9-stream && set repo ${centos_mirror}/${dir} ||
  58. kernel ${centos_mirror}/${dir}/images/pxeboot/vmlinuz inst.repo=${repo} ${install_mode} ${params} ${ipparam} {{ kernel_params }}
  59. initrd ${centos_mirror}/${dir}/images/pxeboot/initrd.img
  60. echo
  61. echo MD5sums:
  62. md5sum vmlinuz initrd.img
  63. boot
  64. goto linux_menu
  65. :linux_menu
  66. clear menu
  67. exit 0