Merge pull request #124415 from misuzu/aarch64-boot-test

nixos/boot: test on aarch64

authored by Guillaume Girol and committed by GitHub 5a4320c4 86bb1290

+48 -21
+6 -1
nixos/lib/test-driver/test-driver.py
··· 292 net_frontend += "," + args["netFrontendArgs"] 293 294 start_command = ( 295 - "qemu-kvm -m 384 " + net_backend + " " + net_frontend + " $QEMU_OPTS " 296 ) 297 298 if "hda" in args:
··· 292 net_frontend += "," + args["netFrontendArgs"] 293 294 start_command = ( 295 + args.get("qemuBinary", "qemu-kvm") 296 + + " -m 384 " 297 + + net_backend 298 + + " " 299 + + net_frontend 300 + + " $QEMU_OPTS " 301 ) 302 303 if "hda" in args:
+1 -1
nixos/tests/all-tests.nix
··· 43 bitcoind = handleTest ./bitcoind.nix {}; 44 bittorrent = handleTest ./bittorrent.nix {}; 45 blockbook-frontend = handleTest ./blockbook-frontend.nix {}; 46 - boot = handleTestOn ["x86_64-linux"] ./boot.nix {}; # syslinux is unsupported on aarch64 47 boot-stage1 = handleTest ./boot-stage1.nix {}; 48 borgbackup = handleTest ./borgbackup.nix {}; 49 botamusique = handleTest ./botamusique.nix {};
··· 43 bitcoind = handleTest ./bitcoind.nix {}; 44 bittorrent = handleTest ./bittorrent.nix {}; 45 blockbook-frontend = handleTest ./blockbook-frontend.nix {}; 46 + boot = handleTestOn ["x86_64-linux" "aarch64-linux"] ./boot.nix {}; 47 boot-stage1 = handleTest ./boot-stage1.nix {}; 48 borgbackup = handleTest ./borgbackup.nix {}; 49 botamusique = handleTest ./botamusique.nix {};
+22 -14
nixos/tests/boot.nix
··· 4 }: 5 6 with import ../lib/testing-python.nix { inherit system pkgs; }; 7 with pkgs.lib; 8 9 let ··· 21 22 makeBootTest = name: extraConfig: 23 let 24 - machineConfig = pythonDict ({ qemuFlags = "-m 768"; } // extraConfig); 25 in 26 makeTest { 27 inherit iso; ··· 61 ]; 62 }; 63 machineConfig = pythonDict ({ 64 qemuFlags = "-boot order=n -m 2000"; 65 netBackendArgs = "tftp=${ipxeBootDir},bootfile=netboot.ipxe"; 66 } // extraConfig); ··· 75 machine.shutdown() 76 ''; 77 }; 78 in { 79 - 80 - biosCdrom = makeBootTest "bios-cdrom" { 81 cdrom = "${iso}/iso/${iso.isoName}"; 82 }; 83 84 - biosUsb = makeBootTest "bios-usb" { 85 usb = "${iso}/iso/${iso.isoName}"; 86 }; 87 88 - uefiCdrom = makeBootTest "uefi-cdrom" { 89 cdrom = "${iso}/iso/${iso.isoName}"; 90 - bios = "${pkgs.OVMF.fd}/FV/OVMF.fd"; 91 }; 92 93 - uefiUsb = makeBootTest "uefi-usb" { 94 usb = "${iso}/iso/${iso.isoName}"; 95 - bios = "${pkgs.OVMF.fd}/FV/OVMF.fd"; 96 }; 97 98 biosNetboot = makeNetbootTest "bios" {}; 99 - 100 - uefiNetboot = makeNetbootTest "uefi" { 101 - bios = "${pkgs.OVMF.fd}/FV/OVMF.fd"; 102 - # Custom ROM is needed for EFI PXE boot. I failed to understand exactly why, because QEMU should still use iPXE for EFI. 103 - netFrontendArgs = "romfile=${pkgs.ipxe}/ipxe.efirom"; 104 - }; 105 }
··· 4 }: 5 6 with import ../lib/testing-python.nix { inherit system pkgs; }; 7 + with import ../lib/qemu-flags.nix { inherit pkgs; }; 8 with pkgs.lib; 9 10 let ··· 22 23 makeBootTest = name: extraConfig: 24 let 25 + machineConfig = pythonDict ({ 26 + qemuBinary = qemuBinary pkgs.qemu_test; 27 + qemuFlags = "-m 768"; 28 + } // extraConfig); 29 in 30 makeTest { 31 inherit iso; ··· 65 ]; 66 }; 67 machineConfig = pythonDict ({ 68 + qemuBinary = qemuBinary pkgs.qemu_test; 69 qemuFlags = "-boot order=n -m 2000"; 70 netBackendArgs = "tftp=${ipxeBootDir},bootfile=netboot.ipxe"; 71 } // extraConfig); ··· 80 machine.shutdown() 81 ''; 82 }; 83 + uefiBinary = { 84 + x86_64-linux = "${pkgs.OVMF.fd}/FV/OVMF.fd"; 85 + aarch64-linux = "${pkgs.OVMF.fd}/FV/QEMU_EFI.fd"; 86 + }.${pkgs.stdenv.hostPlatform.system}; 87 in { 88 + uefiCdrom = makeBootTest "uefi-cdrom" { 89 cdrom = "${iso}/iso/${iso.isoName}"; 90 + bios = uefiBinary; 91 }; 92 93 + uefiUsb = makeBootTest "uefi-usb" { 94 usb = "${iso}/iso/${iso.isoName}"; 95 + bios = uefiBinary; 96 }; 97 98 + uefiNetboot = makeNetbootTest "uefi" { 99 + bios = uefiBinary; 100 + # Custom ROM is needed for EFI PXE boot. I failed to understand exactly why, because QEMU should still use iPXE for EFI. 101 + netFrontendArgs = "romfile=${pkgs.ipxe}/ipxe.efirom"; 102 + }; 103 + } // optionalAttrs (pkgs.stdenv.hostPlatform.system == "x86_64-linux") { 104 + biosCdrom = makeBootTest "bios-cdrom" { 105 cdrom = "${iso}/iso/${iso.isoName}"; 106 }; 107 108 + biosUsb = makeBootTest "bios-usb" { 109 usb = "${iso}/iso/${iso.isoName}"; 110 }; 111 112 biosNetboot = makeNetbootTest "bios" {}; 113 }
+19 -5
pkgs/tools/misc/ipxe/default.nix
··· 1 - { stdenv, lib, fetchFromGitHub, perl, cdrkit, syslinux, xz, openssl, gnu-efi, mtools 2 , embedScript ? null 3 , additionalTargets ? {} 4 }: ··· 8 "bin-x86_64-efi/ipxe.efi" = null; 9 "bin-x86_64-efi/ipxe.efirom" = null; 10 "bin-x86_64-efi/ipxe.usb" = "ipxe-efi.usb"; 11 - } // { 12 "bin/ipxe.dsk" = null; 13 "bin/ipxe.usb" = null; 14 "bin/ipxe.iso" = null; 15 "bin/ipxe.lkrn" = null; 16 "bin/undionly.kpxe" = null; 17 }; 18 in 19 ··· 21 pname = "ipxe"; 22 version = "1.21.1"; 23 24 - nativeBuildInputs = [ perl cdrkit syslinux xz openssl gnu-efi mtools ]; 25 26 src = fetchFromGitHub { 27 owner = "ipxe"; ··· 37 38 makeFlags = 39 [ "ECHO_E_BIN_ECHO=echo" "ECHO_E_BIN_ECHO_E=echo" # No /bin/echo here. 40 "ISOLINUX_BIN_LIST=${syslinux}/share/syslinux/isolinux.bin" 41 "LDLINUX_C32=${syslinux}/share/syslinux/ldlinux.c32" 42 ] ++ lib.optional (embedScript != null) "EMBED=${embedScript}"; ··· 62 buildFlags = lib.attrNames targets; 63 64 installPhase = '' 65 mkdir -p $out 66 ${lib.concatStringsSep "\n" (lib.mapAttrsToList (from: to: 67 if to == null ··· 71 # Some PXE constellations especially with dnsmasq are looking for the file with .0 ending 72 # let's provide it as a symlink to be compatible in this case. 73 ln -s undionly.kpxe $out/undionly.kpxe.0 74 ''; 75 76 enableParallelBuilding = true; ··· 78 meta = with lib; 79 { description = "Network boot firmware"; 80 homepage = "https://ipxe.org/"; 81 - license = licenses.gpl2; 82 maintainers = with maintainers; [ ehmry ]; 83 - platforms = [ "x86_64-linux" "i686-linux" ]; 84 }; 85 }
··· 1 + { stdenv, lib, fetchFromGitHub, perl, cdrkit, xz, openssl, gnu-efi, mtools 2 + , syslinux ? null 3 , embedScript ? null 4 , additionalTargets ? {} 5 }: ··· 9 "bin-x86_64-efi/ipxe.efi" = null; 10 "bin-x86_64-efi/ipxe.efirom" = null; 11 "bin-x86_64-efi/ipxe.usb" = "ipxe-efi.usb"; 12 + } // lib.optionalAttrs (stdenv.isi686 || stdenv.isx86_64) { 13 "bin/ipxe.dsk" = null; 14 "bin/ipxe.usb" = null; 15 "bin/ipxe.iso" = null; 16 "bin/ipxe.lkrn" = null; 17 "bin/undionly.kpxe" = null; 18 + } // lib.optionalAttrs stdenv.isAarch32 { 19 + "bin-arm32-efi/ipxe.efi" = null; 20 + "bin-arm32-efi/ipxe.efirom" = null; 21 + "bin-arm32-efi/ipxe.usb" = "ipxe-efi.usb"; 22 + } // lib.optionalAttrs stdenv.isAarch64 { 23 + "bin-arm64-efi/ipxe.efi" = null; 24 + "bin-arm64-efi/ipxe.efirom" = null; 25 + "bin-arm64-efi/ipxe.usb" = "ipxe-efi.usb"; 26 }; 27 in 28 ··· 30 pname = "ipxe"; 31 version = "1.21.1"; 32 33 + nativeBuildInputs = [ perl cdrkit xz openssl gnu-efi mtools ] ++ lib.optional (stdenv.isi686 || stdenv.isx86_64) syslinux; 34 35 src = fetchFromGitHub { 36 owner = "ipxe"; ··· 46 47 makeFlags = 48 [ "ECHO_E_BIN_ECHO=echo" "ECHO_E_BIN_ECHO_E=echo" # No /bin/echo here. 49 + ] ++ lib.optionals (stdenv.isi686 || stdenv.isx86_64) [ 50 "ISOLINUX_BIN_LIST=${syslinux}/share/syslinux/isolinux.bin" 51 "LDLINUX_C32=${syslinux}/share/syslinux/ldlinux.c32" 52 ] ++ lib.optional (embedScript != null) "EMBED=${embedScript}"; ··· 72 buildFlags = lib.attrNames targets; 73 74 installPhase = '' 75 + runHook preInstall 76 + 77 mkdir -p $out 78 ${lib.concatStringsSep "\n" (lib.mapAttrsToList (from: to: 79 if to == null ··· 83 # Some PXE constellations especially with dnsmasq are looking for the file with .0 ending 84 # let's provide it as a symlink to be compatible in this case. 85 ln -s undionly.kpxe $out/undionly.kpxe.0 86 + 87 + runHook postInstall 88 ''; 89 90 enableParallelBuilding = true; ··· 92 meta = with lib; 93 { description = "Network boot firmware"; 94 homepage = "https://ipxe.org/"; 95 + license = licenses.gpl2Only; 96 maintainers = with maintainers; [ ehmry ]; 97 + platforms = platforms.linux; 98 }; 99 }