centos.ipxe.j2 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  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. menu ${os} - ${arch}
  11. {% for item in releases.centos.versions %}
  12. item {{ item.code_name }} ${space} ${os} {{ item.name }}
  13. {% endfor %}
  14. isset ${osversion} || choose osversion || goto linux_menu
  15. echo ${cls}
  16. set dir ${centos_base_dir}/${osversion}/BaseOS/${arch}/os
  17. iseq ${osversion} 7 && set dir ${centos_base_dir}/${osversion}/os/${arch} ||
  18. set repo ${centos_mirror}/${dir}
  19. goto boottype
  20. :boottype
  21. set ova ${os} ${osversion}
  22. menu ${os} ${arch} boot type
  23. item graphical ${ova} graphical installer
  24. item text ${ova} text based installer
  25. item rescue ${ova} rescue
  26. item kickstart ${ova} set kickstart url [ ${ksurl} ]
  27. item kickstart_device ${ova} set ksdevice [ ${ksdevice} ]
  28. isset ${bt} || choose bt || goto centos
  29. echo ${cls}
  30. iseq ${bt} text && goto text ||
  31. iseq ${bt} rescue && goto rescue ||
  32. iseq ${bt} kickstart && goto kickstart ||
  33. iseq ${bt} kickstart_device && goto kickstart_device ||
  34. goto bootos_images
  35. :text
  36. set params text ||
  37. goto bootos_images
  38. :rescue
  39. set params rescue ||
  40. goto bootos_images
  41. :kickstart
  42. echo -n Specify kickstart URL for ${os} ${osversion}: && read ksurl
  43. set params inst.ks=${ksurl} ||
  44. clear bt
  45. goto boottype
  46. :kickstart_device
  47. echo -n Specify ksdevice param for ${os} ${osversion}: && read ksdevice
  48. set ksdevice ${ksdevice} ||
  49. clear bt
  50. goto boottype
  51. :bootos_images
  52. imgfree
  53. kernel ${centos_mirror}/${dir}/images/pxeboot/vmlinuz repo=${repo} ${params} ${ipparam} initrd=initrd.img ${cmdline}
  54. initrd ${centos_mirror}/${dir}/images/pxeboot/initrd.img
  55. echo
  56. echo MD5sums:
  57. md5sum vmlinuz initrd.img
  58. boot
  59. goto linux_menu
  60. :linux_menu
  61. clear menu
  62. exit 0