generate_disks_arm.yml 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. ---
  2. - name: Copy netboot.xyz local EFI iPXE configs
  3. ansible.builtin.copy:
  4. src: "ipxe/local/{{ item }}"
  5. dest: "{{ ipxe_source_dir }}/src/config/local/{{ item }}"
  6. with_items:
  7. - colour.h
  8. - console.h
  9. - crypto.h
  10. - name: Copy netboot.xyz general.h.efi iPXE config
  11. ansible.builtin.copy:
  12. src: "ipxe/local/general.h.efi"
  13. dest: "{{ ipxe_source_dir }}/src/config/local/general.h"
  14. - name: Set trust file to ipxe ca
  15. ansible.builtin.set_fact:
  16. trust_files: "{{ cert_dir }}/{{ ipxe_ca_filename }}"
  17. when: not generate_signatures
  18. - name: Combine trust files if set
  19. ansible.builtin.set_fact:
  20. trust_files: "{{ cert_dir }}/{{ ipxe_ca_filename }},{{ cert_dir }}/{{ cert_file_filename }}"
  21. when: generate_signatures | bool
  22. # iPXE workaround
  23. # http://lists.ipxe.org/pipermail/ipxe-devel/2018-August/006254.html
  24. # apply patch to fix arm64 builds on amd64 builds
  25. - name: Workaround in iPXE for arm
  26. ansible.builtin.shell: sed -i '/WORKAROUND_CFLAGS/d' arch/arm64/Makefile
  27. args:
  28. chdir: "{{ ipxe_source_dir }}/src"
  29. - name: Compile iPXE bootloaders for EFI arm64
  30. ansible.builtin.shell: |
  31. make clean
  32. make CROSS_COMPILE=aarch64-linux-gnu- \
  33. ARCH=arm64 \
  34. EMBED={{ bootloader_filename }} \
  35. TRUST={{ trust_files }} \
  36. bin-arm64-efi/ipxe.efi \
  37. bin-arm64-efi/snp.efi \
  38. bin-arm64-efi/snponly.efi
  39. args:
  40. chdir: "{{ ipxe_source_dir }}/src"
  41. when: ipxe_debug_enabled | bool == false
  42. - name: Compile iPXE bootloader for EFI arm64 with debug flags
  43. ansible.builtin.shell: |
  44. make clean
  45. make CROSS_COMPILE=aarch64-linux-gnu- \
  46. ARCH=arm64 \
  47. DEBUG={{ ipxe_debug_options }} \
  48. EMBED={{ bootloader_filename }} \
  49. TRUST={{ trust_files }} \
  50. bin-arm64-efi/snp.efi
  51. args:
  52. chdir: "{{ ipxe_source_dir }}/src"
  53. when: ipxe_debug_enabled | bool
  54. - name: Copy iPXE arm64 EFI builds to http directory
  55. ansible.builtin.copy:
  56. src: "{{ ipxe_source_dir }}/src/{{ item.src }}"
  57. dest: "{{ netbootxyz_root }}/ipxe/{{ item.dest }}"
  58. remote_src: true
  59. with_items:
  60. - {src: "bin-arm64-efi/ipxe.efi", dest: "{{ bootloader_filename }}-arm64.efi"}
  61. - {src: "bin-arm64-efi/snp.efi", dest: "{{ bootloader_filename }}-arm64-snp.efi"}
  62. - {src: "bin-arm64-efi/snponly.efi", dest: "{{ bootloader_filename }}-arm64-snponly.efi"}
  63. when: bootloader_filename != "netboot.xyz-metal"
  64. - name: Copy iPXE arm64 EFI builds to http directory for Equinix Metal
  65. ansible.builtin.copy:
  66. src: "{{ ipxe_source_dir }}/src/{{ item.src }}"
  67. dest: "{{ netbootxyz_root }}/ipxe/{{ item.dest }}"
  68. remote_src: true
  69. with_items:
  70. - {src: "bin-arm64-efi/snp.efi", dest: "{{ bootloader_filename }}-arm64.efi"}
  71. when: bootloader_filename == "netboot.xyz-metal"