File tree Expand file tree Collapse file tree
nixos/modules/virtualisation Expand file tree Collapse file tree Original file line number Diff line number Diff line change 8181
8282 drivesCmdLine = drives : concatStringsSep " " ( imap1 driveCmdline drives ) ;
8383
84+
8485 # Creates a device name from a 1-based a numerical index, e.g.
8586 # * `driveDeviceName 1` -> `/dev/vda`
8687 # * `driveDeviceName 2` -> `/dev/vdb`
99100 addDeviceNames =
100101 imap1 ( idx : drive : drive // { device = driveDeviceName idx ; } ) ;
101102
102- efiPrefix = "${ pkgs . OVMF . fd } /FV/OVMF" ;
103+ efiPrefix =
104+ if ( pkgs . stdenv . isi686 || pkgs . stdenv . isx86_64 ) then "${ pkgs . OVMF . fd } /FV/OVMF"
105+ else if pkgs . stdenv . isAarch64 then "${ pkgs . OVMF . fd } /FV/AAVMF"
106+ else throw "No EFI firmware available for platform" ;
103107 efiFirmware = "${ efiPrefix } _CODE.fd" ;
104108 efiVars = "${ efiPrefix } _VARS.fd" ;
105109
176180 ''
177181 mkdir $out
178182 diskImage=$out/disk.img
179- ${ qemu } /bin/qemu-img create -f qcow2 $diskImage "40M "
183+ ${ qemu } /bin/qemu-img create -f qcow2 $diskImage "60M "
180184 ${ if cfg . useEFIBoot then ''
181185 efiVars=$out/EFI_VARS.fd
182186 cp ${ efiVars } $efiVars
191195 + " -drive if=pflash,format=raw,unit=1,file=$efiVars" ) ;
192196 }
193197 ''
194- # Create a /boot EFI partition with 40M and arbitrary but fixed GUIDs for reproducibility
198+ # Create a /boot EFI partition with 60M and arbitrary but fixed GUIDs for reproducibility
195199 ${ pkgs . gptfdisk } /bin/sgdisk \
196200 --set-alignment=1 --new=1:34:2047 --change-name=1:BIOSBootPartition --typecode=1:ef02 \
197201 --set-alignment=512 --largest-new=2 --change-name=2:EFISystem --typecode=2:ef00 \
You can’t perform that action at this time.
0 commit comments