瀏覽代碼

Support building images on other architectures

This unconditionally cross compiles all iPXE images. This has the effect
that the build will always produce the correct output for a defined
architecture regardless of host architecture.

syslinux is x86 architecture dependent. It doesn't seem to be used in
the build process, so the packages are removed from the list of required
packages.

Signed-off-by: Felix Kaechele <felix@kaechele.ca>
Felix Kaechele 1 年之前
父節點
當前提交
f02180f497

+ 6 - 2
roles/netbootxyz/tasks/generate_disks_efi.yml

@@ -27,7 +27,9 @@
 - name: Compile iPXE bootloader for EFI
 - name: Compile iPXE bootloader for EFI
   ansible.builtin.shell: |
   ansible.builtin.shell: |
     make clean
     make clean
-    make EMBED={{ bootloader_filename }} \
+    make CROSS_COMPILE=x86_64-linux-gnu- \
+         ARCH=x86_64 \
+         EMBED={{ bootloader_filename }} \
          TRUST={{ trust_files }} \
          TRUST={{ trust_files }} \
          bin-x86_64-efi/ipxe.efi \
          bin-x86_64-efi/ipxe.efi \
          bin-x86_64-efi/snp.efi \
          bin-x86_64-efi/snp.efi \
@@ -39,7 +41,9 @@
 - name: Compile iPXE bootloader for EFI with debug flags
 - name: Compile iPXE bootloader for EFI with debug flags
   ansible.builtin.shell: |
   ansible.builtin.shell: |
     make clean
     make clean
-    make EMBED={{ bootloader_filename }} \
+    make CROSS_COMPILE=x86_64-linux-gnu- \
+         ARCH=x86_64 \
+         EMBED={{ bootloader_filename }} \
          DEBUG={{ ipxe_debug_options }} \
          DEBUG={{ ipxe_debug_options }} \
          TRUST={{ trust_files }} \
          TRUST={{ trust_files }} \
          bin-x86_64-efi/ipxe.efi \
          bin-x86_64-efi/ipxe.efi \

+ 6 - 2
roles/netbootxyz/tasks/generate_disks_legacy.yml

@@ -23,7 +23,9 @@
 - name: Compile iPXE bootloader for Legacy BIOS
 - name: Compile iPXE bootloader for Legacy BIOS
   ansible.builtin.shell: |
   ansible.builtin.shell: |
     make clean
     make clean
-    make EMBED={{ bootloader_filename }} \
+    make CROSS_COMPILE=x86_64-linux-gnu- \
+         ARCH=x86_64 \
+         EMBED={{ bootloader_filename }} \
          TRUST={{ trust_files }} \
          TRUST={{ trust_files }} \
          bin/ipxe.dsk \
          bin/ipxe.dsk \
          bin/ipxe.pdsk \
          bin/ipxe.pdsk \
@@ -37,7 +39,9 @@
 - name: Compile iPXE bootloader for Legacy BIOS with debug flags
 - name: Compile iPXE bootloader for Legacy BIOS with debug flags
   ansible.builtin.shell: |
   ansible.builtin.shell: |
     make clean
     make clean
-    make EMBED={{ bootloader_filename }} \
+    make CROSS_COMPILE=x86_64-linux-gnu- \
+         ARCH=x86_64 \
+         EMBED={{ bootloader_filename }} \
          DEBUG={{ ipxe_debug_options }} \
          DEBUG={{ ipxe_debug_options }} \
          TRUST={{ trust_files }} \
          TRUST={{ trust_files }} \
          bin/ipxe.dsk \
          bin/ipxe.dsk \

+ 6 - 2
roles/netbootxyz/tasks/generate_disks_linux.yml

@@ -27,7 +27,9 @@
 - name: Compile iPXE Linux bootloader for Legacy BIOS
 - name: Compile iPXE Linux bootloader for Legacy BIOS
   ansible.builtin.shell: |
   ansible.builtin.shell: |
     make clean
     make clean
-    make EMBED={{ bootloader_filename }} \
+    make CROSS_COMPILE=x86_64-linux-gnu- \
+         ARCH=x86_64 \
+         EMBED={{ bootloader_filename }} \
          TRUST={{ trust_files }} \
          TRUST={{ trust_files }} \
          bin-x86_64-linux/slirp.linux
          bin-x86_64-linux/slirp.linux
   args:
   args:
@@ -37,7 +39,9 @@
 - name: Compile iPXE Linux bootloader for Legacy BIOS with debug flags
 - name: Compile iPXE Linux bootloader for Legacy BIOS with debug flags
   ansible.builtin.shell: |
   ansible.builtin.shell: |
     make clean
     make clean
-    make EMBED={{ bootloader_filename }} \
+    make CROSS_COMPILE=x86_64-linux-gnu- \
+         ARCH=x86_64 \
+         EMBED={{ bootloader_filename }} \
          DEBUG={{ ipxe_debug_options }} \
          DEBUG={{ ipxe_debug_options }} \
          TRUST={{ trust_files }} \
          TRUST={{ trust_files }} \
          bin-x86_64-linux/slirp.linux
          bin-x86_64-linux/slirp.linux

+ 2 - 2
roles/netbootxyz/vars/debian.yml

@@ -3,15 +3,15 @@ netbootxyz_packages:
   - apache2
   - apache2
   - binutils-dev
   - binutils-dev
   - binutils-aarch64-linux-gnu
   - binutils-aarch64-linux-gnu
+  - binutils-x86-64-linux-gnu
   - dosfstools
   - dosfstools
   - figlet
   - figlet
   - gcc-aarch64-linux-gnu
   - gcc-aarch64-linux-gnu
+  - gcc-x86-64-linux-gnu
   - build-essential
   - build-essential
   - genisoimage
   - genisoimage
   - git
   - git
   - isolinux
   - isolinux
   - liblzma-dev
   - liblzma-dev
   - libslirp-dev
   - libslirp-dev
-  - syslinux
-  - syslinux-common
   - toilet
   - toilet

+ 0 - 1
roles/netbootxyz/vars/redhat.yml

@@ -8,6 +8,5 @@ netbootxyz_packages:
   - httpd
   - httpd
   - libslirp-devel
   - libslirp-devel
   - minizip-devel
   - minizip-devel
-  - syslinux
   - xz-devel
   - xz-devel
   - make
   - make

+ 2 - 2
roles/netbootxyz/vars/ubuntu.yml

@@ -3,17 +3,17 @@ netbootxyz_packages:
   - apache2
   - apache2
   - binutils-dev
   - binutils-dev
   - binutils-aarch64-linux-gnu
   - binutils-aarch64-linux-gnu
+  - binutils-x86-64-linux-gnu
   - dosfstools
   - dosfstools
   - figlet
   - figlet
   - gcc-aarch64-linux-gnu
   - gcc-aarch64-linux-gnu
+  - gcc-x86-64-linux-gnu
   - build-essential
   - build-essential
   - genisoimage
   - genisoimage
   - git
   - git
   - isolinux
   - isolinux
   - liblzma-dev
   - liblzma-dev
   - libslirp-dev
   - libslirp-dev
-  - syslinux
-  - syslinux-common
   - toilet
   - toilet
 
 
 pipxe_packages:
 pipxe_packages: