1
0

k3os.ipxe.j2 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. #!ipxe
  2. # k3OS by Rancher
  3. # https://k3os.io/
  4. # https://github.com/rancher/k3os#configuration-reference
  5. goto ${menu} ||
  6. :k3os
  7. set os {{ releases.k3os.name }}
  8. set os_arch ${arch}
  9. iseq ${os_arch} x86_64 && set os_arch amd64 ||
  10. set k3os_mirror {{ releases.k3os.mirror }}
  11. isset ${k3os_version} || set k3os_version latest
  12. isset ${k3os_install_device} || set k3os_install_device /dev/sda
  13. menu ${os} by Rancher
  14. menu ${os} install
  15. item --gap k3OS:
  16. item k3os_boot ${space} Begin install ${os} ${k3os_version}
  17. item --gap Parameters:
  18. item k3os_version ${space} ${os} version: ${k3os_version}
  19. item k3os_install_device ${space} Set install device: ${k3os_install_device}
  20. item k3os_config_url ${space} Set config.yaml URL: ${k3os_config_url}
  21. item k3os_mirror ${space} Set mirror URL: ${k3os_mirror}
  22. choose --default ${menu} menu || goto k3os_exit
  23. echo ${cls}
  24. goto ${menu} ||
  25. goto k3os_exit
  26. :k3os_version
  27. menu ${os} version
  28. item latest ${space} latest
  29. item custom ${space} Set custom version
  30. choose --default ${version} version || goto k3os_exit
  31. echo ${cls}
  32. goto k3os_version_${version} ||
  33. goto k3os_exit
  34. :k3os_version_latest
  35. set k3os_version latest
  36. set k3os_base_url ${k3os_mirror}/latest/download
  37. goto k3os
  38. :k3os_version_custom
  39. clear k3os_version
  40. echo -n Please set k3OS version manually (in format vX.Y.Z): && read k3os_version
  41. set k3os_base_url ${k3os_mirror}/download/${k3os_version}
  42. clear menu
  43. goto k3os
  44. :k3os_install_device
  45. echo -n Please set desired install device: && read k3os_install_device
  46. clear menu
  47. goto k3os
  48. :k3os_mirror
  49. echo -n Set mirror URL: && read k3os_mirror
  50. clear menu
  51. goto k3os_version ||
  52. goto k3os_exit
  53. :k3os_config_url
  54. echo -n Set config.yaml URL: && read k3os_config_url
  55. clear menu
  56. goto k3os
  57. :k3os_boot
  58. isset ${k3os_base_url} || set k3os_base_url ${k3os_mirror}/latest/download
  59. set install_params k3os.install.silent=true k3os.mode=install k3os.install.config_url=${k3os_config_url} k3os.install.device=${k3os_install_device}
  60. set boot_params printk.devkmsg=on k3os.install.iso_url=${k3os_base_url}/k3os-${os_arch}.iso console=ttyS0 console=tty1
  61. imgfree
  62. kernel ${k3os_base_url}/k3os-vmlinuz-${os_arch} ${install_params} ${boot_params} {{ kernel_params }}
  63. initrd ${k3os_base_url}/k3os-initrd-${os_arch}
  64. echo
  65. echo MD5sums:
  66. md5sum k3os-vmlinuz-${os_arch} k3os-initrd-${os_arch}
  67. boot
  68. :k3os_exit
  69. clear menu
  70. exit 0