boot.cfg.j2 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. #!ipxe
  2. :global_vars
  3. # set site name
  4. set site_name {{ site_name }}
  5. # set boot domain
  6. set boot_domain {{ boot_domain }}
  7. # set location of memdisk
  8. set memdisk {{ memdisk_location }}
  9. # set location of custom netboot.xyz live assets, override in local-vars.ipxe
  10. isset ${live_endpoint} || set live_endpoint {{ live_endpoint }}
  11. # signature check enabled?
  12. set sigs_enabled {{ sigs_enabled | default(false) | bool | lower }}
  13. # set location of signatures for sources
  14. set sigs {{ sigs_location }}
  15. # set location of latest iPXE
  16. iseq ${platform} efi && set ipxe_disk netboot.xyz-snponly.efi || set ipxe_disk netboot.xyz-undionly.kpxe
  17. # set default boot timeout
  18. isset ${boot_timeout} || set boot_timeout {{ boot_timeout }}
  19. ##################
  20. # official mirrors
  21. ##################
  22. :mirrors
  23. {% for key, value in releases.items() | sort(attribute='1.name') %}
  24. {% if value.mirror is defined and value.base_dir is defined %}
  25. ### {{ value.name }}
  26. set {{ key }}_mirror {{ value.mirror }}
  27. set {{ key }}_base_dir {{ value.base_dir }}
  28. {% endif %}
  29. {% endfor %}
  30. #################################################
  31. # determine architectures and enable menu options
  32. #################################################
  33. :architectures
  34. set menu_linux 1
  35. set menu_bsd 1
  36. set menu_unix 1
  37. set menu_freedos 1
  38. set menu_live 1
  39. set menu_pci 1
  40. set menu_windows 1
  41. set menu_utils 1
  42. iseq ${arch} i386 && goto i386 ||
  43. iseq ${arch} x86_64 && goto x86_64 ||
  44. iseq ${arch} arm64 && goto arm64 ||
  45. goto architectures_end
  46. :x86_64
  47. set menu_linux_i386 0
  48. iseq ${platform} efi && goto efi ||
  49. goto architectures_end
  50. :i386
  51. set menu_linux 0
  52. set menu_linux_i386 1
  53. set menu_bsd 1
  54. set menu_unix 0
  55. set menu_freedos 1
  56. set menu_live 0
  57. set menu_windows 0
  58. set menu_utils 1
  59. iseq ${platform} efi && goto efi ||
  60. goto architectures_end
  61. :arm64
  62. set menu_linux 0
  63. set menu_linux_arm 1
  64. set menu_unix 0
  65. set menu_freedos 0
  66. set menu_live 0
  67. set menu_live_arm 1
  68. set menu_windows 0
  69. set menu_utils 0
  70. set menu_utils_arm 1
  71. set menu_pci 0
  72. iseq ${platform} efi && goto efi ||
  73. goto architectures_end
  74. :efi
  75. set menu_bsd 0
  76. set menu_freedos 0
  77. set menu_unix 0
  78. set menu_pci 0
  79. goto architectures_end
  80. :architectures_end
  81. goto clouds
  82. ###################################
  83. # set iPXE cloud provider specifics
  84. ###################################
  85. :clouds
  86. iseq ${ipxe_cloud_config} gce && goto gce ||
  87. iseq ${ipxe_cloud_config} metal && goto metal ||
  88. iseq ${ipxe_cloud_config} packet && goto metal ||
  89. goto clouds_end
  90. :gce
  91. set cmdline console=ttyS0,115200n8
  92. goto clouds_end
  93. :metal
  94. iseq ${arch} i386 && goto metal_x86_64 ||
  95. iseq ${arch} x86_64 && goto metal_x86_64 ||
  96. iseq ${arch} arm64 && goto metal_arm64 ||
  97. goto clouds_end
  98. :metal_x86_64
  99. set cmdline console=ttyS1,115200n8
  100. iseq ${platform} efi && set ipxe_disk netboot.xyz-metal-snp.efi || set ipxe_disk netboot.xyz-metal.kpxe
  101. set menu_linux_i386 0
  102. set menu_freedos 0
  103. set menu_windows 0
  104. iseq ${platform} efi && set menu_pci 0 ||
  105. goto clouds_end
  106. :metal_arm64
  107. set cmdline console=ttyAMA0,115200
  108. set ipxe_disk netboot.xyz-metal-arm64-snp.efi
  109. set menu_bsd 0
  110. set menu_freedos 0
  111. set menu_live 0
  112. set menu_windows 0
  113. set menu_utils 0
  114. set menu_pci 0
  115. goto clouds_end
  116. :clouds_end
  117. goto end
  118. :end
  119. exit