Merge pull request #88574 from JJJollyjim/qemu-vm-qboot-opt

nixos/qemu-vm: add option to use qboot

Changed files
+32 -1
nixos
modules
virtualisation
tests
pkgs
applications
virtualization
qboot
+15
nixos/modules/virtualisation/qemu-vm.nix
···
'';
};
+
virtualisation.bios =
+
mkOption {
+
default = null;
+
type = types.nullOr types.package;
+
description =
+
''
+
An alternate BIOS (such as <package>qboot</package>) with which to start the VM.
+
Should containin a file named <literal>bios.bin</literal>.
+
If <literal>null</literal>, QEMU's builtin SeaBIOS will be used.
+
'';
+
};
+
};
config = {
···
])
(mkIf cfg.useEFIBoot [
"-pflash $TMPDIR/bios.bin"
+
])
+
(mkIf (cfg.bios != null) [
+
"-bios ${cfg.bios}/bios.bin"
])
(mkIf (!cfg.graphics) [
"-nographic"
+1
nixos/tests/all-tests.nix
···
prosody = handleTest ./xmpp/prosody.nix {};
prosodyMysql = handleTest ./xmpp/prosody-mysql.nix {};
proxy = handleTest ./proxy.nix {};
+
qboot = handleTestOn ["x86_64-linux" "i686-linux"] ./qboot.nix {};
quagga = handleTest ./quagga.nix {};
quorum = handleTest ./quorum.nix {};
rabbitmq = handleTest ./rabbitmq.nix {};
+13
nixos/tests/qboot.nix
···
+
import ./make-test-python.nix ({ pkgs, ...} : {
+
name = "qboot";
+
+
machine = { ... }: {
+
virtualisation.bios = pkgs.qboot;
+
};
+
+
testScript =
+
''
+
start_all()
+
machine.wait_for_unit("multi-user.target")
+
'';
+
})
+3 -1
pkgs/applications/virtualization/qboot/default.nix
···
-
{ stdenv, meson, ninja, fetchFromGitHub }:
+
{ stdenv, meson, ninja, fetchFromGitHub, nixosTests }:
stdenv.mkDerivation {
name = "qboot-20200423";
···
'';
hardeningDisable = [ "stackprotector" "pic" ];
+
+
passthru.tests = { qboot = nixosTests.qboot; };
meta = {
description = "A simple x86 firmware for booting Linux";