Installer test: Fix booting from SCSI
This is required by the GRUB 1 test.
This commit is contained in:
parent
6563dd251f
commit
f93d8425c3
|
@ -62,7 +62,7 @@ let
|
||||||
extraDisks=""
|
extraDisks=""
|
||||||
${flip concatMapStrings cfg.emptyDiskImages (size: ''
|
${flip concatMapStrings cfg.emptyDiskImages (size: ''
|
||||||
${pkgs.qemu_kvm}/bin/qemu-img create -f qcow2 "empty$idx.qcow2" "${toString size}M"
|
${pkgs.qemu_kvm}/bin/qemu-img create -f qcow2 "empty$idx.qcow2" "${toString size}M"
|
||||||
extraDisks="$extraDisks -drive index=$idx,file=$(pwd)/empty$idx.qcow2,if=virtio,werror=report"
|
extraDisks="$extraDisks -drive index=$idx,file=$(pwd)/empty$idx.qcow2,if=${cfg.qemu.diskInterface},werror=report"
|
||||||
idx=$((idx + 1))
|
idx=$((idx + 1))
|
||||||
'')}
|
'')}
|
||||||
|
|
||||||
|
@ -76,14 +76,14 @@ let
|
||||||
-virtfs local,path=$TMPDIR/xchg,security_model=none,mount_tag=xchg \
|
-virtfs local,path=$TMPDIR/xchg,security_model=none,mount_tag=xchg \
|
||||||
-virtfs local,path=''${SHARED_DIR:-$TMPDIR/xchg},security_model=none,mount_tag=shared \
|
-virtfs local,path=''${SHARED_DIR:-$TMPDIR/xchg},security_model=none,mount_tag=shared \
|
||||||
${if cfg.useBootLoader then ''
|
${if cfg.useBootLoader then ''
|
||||||
-drive index=0,id=drive1,file=$NIX_DISK_IMAGE,if=virtio,cache=writeback,werror=report \
|
-drive index=0,id=drive1,file=$NIX_DISK_IMAGE,if=${cfg.qemu.diskInterface},cache=writeback,werror=report \
|
||||||
-drive index=1,id=drive2,file=$TMPDIR/disk.img,media=disk \
|
-drive index=1,id=drive2,file=$TMPDIR/disk.img,media=disk \
|
||||||
${if cfg.useEFIBoot then ''
|
${if cfg.useEFIBoot then ''
|
||||||
-pflash $TMPDIR/bios.bin \
|
-pflash $TMPDIR/bios.bin \
|
||||||
'' else ''
|
'' else ''
|
||||||
''}
|
''}
|
||||||
'' else ''
|
'' else ''
|
||||||
-drive index=0,id=drive1,file=$NIX_DISK_IMAGE,if=virtio,cache=writeback,werror=report \
|
-drive index=0,id=drive1,file=$NIX_DISK_IMAGE,if=${cfg.qemu.diskInterface},cache=writeback,werror=report \
|
||||||
-kernel ${config.system.build.toplevel}/kernel \
|
-kernel ${config.system.build.toplevel}/kernel \
|
||||||
-initrd ${config.system.build.toplevel}/initrd \
|
-initrd ${config.system.build.toplevel}/initrd \
|
||||||
-append "$(cat ${config.system.build.toplevel}/kernel-params) init=${config.system.build.toplevel}/init regInfo=${regInfo} ${kernelConsole} $QEMU_KERNEL_PARAMS" \
|
-append "$(cat ${config.system.build.toplevel}/kernel-params) init=${config.system.build.toplevel}/init regInfo=${regInfo} ${kernelConsole} $QEMU_KERNEL_PARAMS" \
|
||||||
|
@ -207,7 +207,7 @@ in
|
||||||
virtualisation.bootDevice =
|
virtualisation.bootDevice =
|
||||||
mkOption {
|
mkOption {
|
||||||
type = types.str;
|
type = types.str;
|
||||||
default = "/dev/vda";
|
example = "/dev/vda";
|
||||||
description =
|
description =
|
||||||
''
|
''
|
||||||
The disk to be used for the root filesystem.
|
The disk to be used for the root filesystem.
|
||||||
|
@ -318,6 +318,17 @@ in
|
||||||
to keep the default runtime behaviour.
|
to keep the default runtime behaviour.
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
diskInterface =
|
||||||
|
mkOption {
|
||||||
|
default = "virtio";
|
||||||
|
example = "scsi";
|
||||||
|
type = types.str;
|
||||||
|
description = ''
|
||||||
|
The interface used for the virtual hard disks
|
||||||
|
(<literal>virtio</literal> or <literal>scsi</literal>).
|
||||||
|
'';
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
virtualisation.useBootLoader =
|
virtualisation.useBootLoader =
|
||||||
|
@ -393,6 +404,12 @@ in
|
||||||
fi
|
fi
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
boot.initrd.availableKernelModules =
|
||||||
|
optional (cfg.qemu.diskInterface == "scsi") "sym53c8xx";
|
||||||
|
|
||||||
|
virtualisation.bootDevice =
|
||||||
|
mkDefault (if cfg.qemu.diskInterface == "scsi" then "/dev/sda" else "/dev/vda");
|
||||||
|
|
||||||
virtualisation.pathsInNixDB = [ config.system.build.toplevel ];
|
virtualisation.pathsInNixDB = [ config.system.build.toplevel ];
|
||||||
|
|
||||||
virtualisation.qemu.options = [ "-vga std" "-usbdevice tablet" ];
|
virtualisation.qemu.options = [ "-vga std" "-usbdevice tablet" ];
|
||||||
|
|
|
@ -175,7 +175,10 @@ let
|
||||||
# installer. This ensures the target disk (/dev/vda) is
|
# installer. This ensures the target disk (/dev/vda) is
|
||||||
# the same during and after installation.
|
# the same during and after installation.
|
||||||
virtualisation.emptyDiskImages = [ 512 ];
|
virtualisation.emptyDiskImages = [ 512 ];
|
||||||
virtualisation.bootDevice = "/dev/vdb";
|
virtualisation.bootDevice =
|
||||||
|
if grubVersion == 1 then "/dev/sdb" else "/dev/vdb";
|
||||||
|
virtualisation.qemu.diskInterface =
|
||||||
|
if grubVersion == 1 then "scsi" else "virtio";
|
||||||
|
|
||||||
hardware.enableAllFirmware = mkForce false;
|
hardware.enableAllFirmware = mkForce false;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue