generate_disks_arm.yml 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  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 -j{{ make_num_jobs }} \
  33. CROSS_COMPILE=aarch64-linux-gnu- \
  34. ARCH=arm64 \
  35. EMBED={{ bootloader_filename }} \
  36. TRUST={{ trust_files }} \
  37. bin-arm64-efi/ipxe.efi \
  38. bin-arm64-efi/snp.efi \
  39. bin-arm64-efi/snponly.efi
  40. args:
  41. chdir: "{{ ipxe_source_dir }}/src"
  42. when: ipxe_debug_enabled | bool == false
  43. - name: Compile iPXE bootloader for EFI arm64 with debug flags
  44. ansible.builtin.shell: |
  45. make clean
  46. make -j{{ make_num_jobs }} \
  47. CROSS_COMPILE=aarch64-linux-gnu- \
  48. ARCH=arm64 \
  49. DEBUG={{ ipxe_debug_options }} \
  50. EMBED={{ bootloader_filename }} \
  51. TRUST={{ trust_files }} \
  52. bin-arm64-efi/snp.efi
  53. args:
  54. chdir: "{{ ipxe_source_dir }}/src"
  55. when: ipxe_debug_enabled | bool
  56. - name: Copy iPXE arm64 EFI builds to http directory
  57. ansible.builtin.copy:
  58. src: "{{ ipxe_source_dir }}/src/{{ item.src }}"
  59. dest: "{{ netbootxyz_root }}/ipxe/{{ item.dest }}"
  60. remote_src: true
  61. with_items:
  62. - {src: "bin-arm64-efi/ipxe.efi", dest: "{{ bootloader_filename }}-arm64.efi"}
  63. - {src: "bin-arm64-efi/snp.efi", dest: "{{ bootloader_filename }}-arm64-snp.efi"}
  64. - {src: "bin-arm64-efi/snponly.efi", dest: "{{ bootloader_filename }}-arm64-snponly.efi"}