From f122171fed5d411730d59ffb5db14fd7306e1654 Mon Sep 17 00:00:00 2001 From: Xesxen Date: Mon, 28 Oct 2024 16:46:58 +0100 Subject: [PATCH] Add EFI floppy images --- roles/netbootxyz/defaults/main.yml | 8 ++++++++ roles/netbootxyz/tasks/generate_disks_efi.yml | 14 ++++++++++++++ roles/netbootxyz/vars/debian.yml | 1 + roles/netbootxyz/vars/ubuntu.yml | 1 + 4 files changed, 24 insertions(+) diff --git a/roles/netbootxyz/defaults/main.yml b/roles/netbootxyz/defaults/main.yml index 4d2bb1be1f..97365dd0b7 100644 --- a/roles/netbootxyz/defaults/main.yml +++ b/roles/netbootxyz/defaults/main.yml @@ -88,6 +88,14 @@ bootloaders: ipxe_bin: snponly.efi output_bin: -snponly.efi type: DHCP-snponly + - desc: DHCP EFI Floppy boot image file, uses built-in iPXE NIC drivers + ipxe_bin: ipxe.efi.dsk + output_bin: .efi.dsk + type: Floppy + - desc: EFI Floppy image w/ Simple Network Protocol, attempts to boot all net devices + ipxe_bin: snp.efi.dsk + output_bin: -snp.efi.dsk + type: Floppy-snp cert_dir: /etc/netbootxyz/certs cert_file_filename: ca-netboot-xyz.crt checksums_filename: '{{ site_name }}-sha256-checksums.txt' diff --git a/roles/netbootxyz/tasks/generate_disks_efi.yml b/roles/netbootxyz/tasks/generate_disks_efi.yml index dec250b30d..623437c1bb 100644 --- a/roles/netbootxyz/tasks/generate_disks_efi.yml +++ b/roles/netbootxyz/tasks/generate_disks_efi.yml @@ -51,6 +51,18 @@ chdir: "{{ ipxe_source_dir }}/src" when: ipxe_debug_enabled | bool +- name: Generate iPXE floppy images for EFI + ansible.builtin.shell: | + truncate -s 1440k bin-x86_64-efi/ipxe.efi.dsk + mformat -i bin-x86_64-efi/ipxe.efi.dsk -f 1440 :: + mmd -i bin-x86_64-efi/ipxe.efi.dsk ::EFI + mmd -i bin-x86_64-efi/ipxe.efi.dsk ::EFI/BOOT + cp bin-x86_64-efi/ipxe.efi.dsk bin-x86_64-efi/snp.efi.dsk + mcopy -i bin-x86_64-efi/ipxe.efi.dsk bin-x86_64-efi/ipxe.efi ::EFI/BOOT/BOOTX64.EFI + mcopy -i bin-x86_64-efi/snp.efi.dsk bin-x86_64-efi/snp.efi ::EFI/BOOT/BOOTX64.EFI + args: + chdir: "{{ ipxe_source_dir }}/src" + - name: Copy iPXE EFI builds to http directory ansible.builtin.copy: src: "{{ ipxe_source_dir }}/src/{{ item.src }}" @@ -60,3 +72,5 @@ - {src: "bin-x86_64-efi/ipxe.efi", dest: "{{ bootloader_filename }}.efi"} - {src: "bin-x86_64-efi/snp.efi", dest: "{{ bootloader_filename }}-snp.efi"} - {src: "bin-x86_64-efi/snponly.efi", dest: "{{ bootloader_filename }}-snponly.efi"} + - {src: "bin-x86_64-efi/ipxe.efi.dsk", dest: "{{ bootloader_filename }}.efi.dsk"} + - {src: "bin-x86_64-efi/snp.efi.dsk", dest: "{{ bootloader_filename }}-snp.efi.dsk"} diff --git a/roles/netbootxyz/vars/debian.yml b/roles/netbootxyz/vars/debian.yml index b59709d1ef..db66a21219 100644 --- a/roles/netbootxyz/vars/debian.yml +++ b/roles/netbootxyz/vars/debian.yml @@ -15,3 +15,4 @@ netbootxyz_packages: - syslinux - syslinux-common - toilet + - mtools diff --git a/roles/netbootxyz/vars/ubuntu.yml b/roles/netbootxyz/vars/ubuntu.yml index 41258563e0..1d2788e916 100644 --- a/roles/netbootxyz/vars/ubuntu.yml +++ b/roles/netbootxyz/vars/ubuntu.yml @@ -15,6 +15,7 @@ netbootxyz_packages: - syslinux - syslinux-common - toilet + - mtools pipxe_packages: - acpica-tools