3
0
Fork 0
forked from mirrors/nixpkgs

nixos/qemu-vm: fix useBootLoader builds on aarch64-linux

The aarch64-linux kernel and initrd recently eclipsed 60M, causing the
boot disk image build to run out of space and fail. Double the size of
the image to 120M to fix the issue.

The disk image is stored in expandable qcow2 format, so only the space
actually used by files in the image is consumed. Therefore, other
architectures are not unfairly penalized, and the output size does not
suddenly double.

This also fixes NixOS tests which use this option, like systemd-boot's.
This commit is contained in:
Thomas Watson 2023-01-19 23:21:15 -06:00
parent d12040e858
commit 8736edfd95

View file

@ -211,7 +211,7 @@ let
''
mkdir $out
diskImage=$out/disk.img
${qemu}/bin/qemu-img create -f qcow2 $diskImage "60M"
${qemu}/bin/qemu-img create -f qcow2 $diskImage "120M"
${if cfg.useEFIBoot then ''
efiVars=$out/efi-vars.fd
cp ${cfg.efi.variables} $efiVars
@ -225,7 +225,7 @@ let
+ " -drive if=pflash,format=raw,unit=1,file=$efiVars");
}
''
# Create a /boot EFI partition with 60M and arbitrary but fixed GUIDs for reproducibility
# Create a /boot EFI partition with 120M and arbitrary but fixed GUIDs for reproducibility
${pkgs.gptfdisk}/bin/sgdisk \
--set-alignment=1 --new=1:34:2047 --change-name=1:BIOSBootPartition --typecode=1:ef02 \
--set-alignment=512 --largest-new=2 --change-name=2:EFISystem --typecode=2:ef00 \