generate_disks_arm.yml 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  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: iPXE Workaround for arm
  26. shell: sed -i '/WORKAROUND_CFLAGS/d' arch/arm64/Makefile
  27. args:
  28. chdir: "{{ ipxe_source_dir }}/src"
  29. tags:
  30. - skip_ansible_lint
  31. - name: Compile iPXE bootloaders for EFI arm64
  32. shell: |
  33. make clean
  34. make CROSS_COMPILE=aarch64-linux-gnu- \
  35. ARCH=arm64 \
  36. EMBED={{ bootloader_filename }} \
  37. TRUST={{ trust_files }} \
  38. bin-arm64-efi/ipxe.efi \
  39. bin-arm64-efi/snp.efi \
  40. bin-arm64-efi/snponly.efi
  41. args:
  42. chdir: "{{ ipxe_source_dir }}/src"
  43. tags:
  44. - skip_ansible_lint
  45. when: ipxe_debug_enabled | bool == false
  46. - name: Compile iPXE bootloader for EFI arm64 with debug flags
  47. shell: |
  48. make clean
  49. make CROSS_COMPILE=aarch64-linux-gnu- \
  50. ARCH=arm64 \
  51. DEBUG={{ ipxe_debug_options }} \
  52. EMBED={{ bootloader_filename }} \
  53. TRUST={{ trust_files }} \
  54. bin-arm64-efi/snp.efi
  55. args:
  56. chdir: "{{ ipxe_source_dir }}/src"
  57. tags:
  58. - skip_ansible_lint
  59. when: ipxe_debug_enabled | bool
  60. - name: Copy iPXE arm64 EFI builds to http directory
  61. ansible.builtin.copy:
  62. src: "{{ ipxe_source_dir }}/src/{{ item.src }}"
  63. dest: "{{ netbootxyz_root }}/ipxe/{{ item.dest }}"
  64. remote_src: true
  65. with_items:
  66. - {src: "bin-arm64-efi/ipxe.efi", dest: "{{ bootloader_filename }}-arm64.efi"}
  67. - {src: "bin-arm64-efi/snp.efi", dest: "{{ bootloader_filename }}-arm64-snp.efi"}
  68. - {src: "bin-arm64-efi/snponly.efi", dest: "{{ bootloader_filename }}-arm64-snponly.efi"}
  69. when: bootloader_filename != "netboot.xyz-metal"
  70. - name: Copy iPXE arm64 EFI builds to http directory for Equinix Metal
  71. ansible.builtin.copy:
  72. src: "{{ ipxe_source_dir }}/src/{{ item.src }}"
  73. dest: "{{ netbootxyz_root }}/ipxe/{{ item.dest }}"
  74. remote_src: true
  75. with_items:
  76. - {src: "bin-arm64-efi/snp.efi", dest: "{{ bootloader_filename }}-arm64.efi"}
  77. when: bootloader_filename == "netboot.xyz-metal"