anchor.diff:          ''-append "$(cat ${config.system.build.toplevel}/kernel-params) init=${config.system.build.toplevel}/init regInfo=${regInfo}/registration ${consoles} $QEMU_KERNEL_PARAMS"''
         ])
         (mkIf cfg.useEFIBoot [
  -        "-pflash $TMPDIR/bios.bin"
  +        "-drive if=pflash,format=raw,unit=0,readonly,file=${efiFirmware}"
  +        "-drive if=pflash,format=raw,unit=1,file=$TMPDIR/EFI_VARS.fd"
         ])
         (mkIf (cfg.bios != null) [
           "-bios ${cfg.bios}/bios.bin"
  
positive.code:   addDeviceNames =
      imap1 (idx: drive: drive // { device = driveDeviceName idx; });
  
    # Shell script to start the VM.
    startVM =
      ''
  
negative.code:         ${qemu}/bin/qemu-img create -f qcow2 -b ${bootDisk}/disk.img $TMPDIR/disk.img || exit 1
  
          ${if cfg.useEFIBoot then ''
            # VM needs writable EFI vars
            cp ${bootDisk}/EFI_VARS.fd $TMPDIR || exit 1
            chmod 0644 $TMPDIR/EFI_VARS.fd || exit 1
          '' else ''
          ''}
        '' else ''
  