Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

qubes-vmm-xen: init at 4.19.0-5, qubes-seabios: init at 4.0.2 #341429

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
123 changes: 123 additions & 0 deletions pkgs/by-name/qu/qubes-seabios/package.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
{
lib,
stdenv,
stdenvNoCC,
fetchFromGitHub,
python3,
seabios,
}:
let
inherit (lib) concatStringsSep map;

version = "4.2.0";
src = fetchFromGitHub {
owner = "QubesOS";
repo = "qubes-seabios";
rev = "refs/tags/R${version}";
hash = "sha256-KEvdQ0VLJSnLRNuzMBWY0LFp9CN1EKq3K2v8Ud/vojc=";
};
mkBios =
{
config,
target ? "",
outBin,
name,
}:
stdenv.mkDerivation {
inherit version;
inherit (seabios) src;
pname = "qubes-seabios-${name}";

nativeBuildInputs = [
python3
];
buildPhase = ''
mkdir binaries

cp ${src}/${config} .config
make oldnoconfig
make V=1 ${target}
'';
installPhase = ''
mkdir $out
ls out
cp out/${outBin} $out/${name}
'';
};
mkVgaBios =
name:
mkBios {
config = "config.vga-${name}";
outBin = "vgabios.bin";
name = "vgabios-${name}.bin";
target = "out/vgabios.bin";
};
# For me the build is breaking if trying to build all packages in the same derivation,
# they are conflicting somehow. Building everything by itself, and then combining into a single dir.
seabioses = concatStringsSep "," [
(mkBios {
config = "config.seabios-128k";
outBin = "bios.bin";
name = "bios.bin";
})
(mkBios {
config = "config.seabios-256k";
outBin = "bios.bin";
name = "bios-256k.bin";
})
(mkBios {
config = "config.csm";
outBin = "Csm16.bin";
name = "bios-csm.bin";
})
(mkBios {
config = "config.coreboot";
outBin = "bios.bin.elf";
name = "bios-coreboot.bin";
})
(mkBios {
config = "config.seabios-microvm";
outBin = "bios.bin";
name = "bios-microvm.bin";
})
];
# Probably we don't need all of those... Building for completeness.
seavgabioses = concatStringsSep "," (
map mkVgaBios [
"bochs-display"
"cirrus"
"isavga"
"qxl"
"stdvga"
"ramfb"
"vmware"
"virtio"
"ati"
]
);

in
stdenvNoCC.mkDerivation (finalAttrs: {
name = "qubes-seabios";
inherit version;
unpackPhase = "true";
installPhase = ''
mkdir -p $out/share/{seabios,seavgabios}
cp {${seabioses}}/*.bin $out/share/seabios
cp {${seavgabioses}}/*.bin $out/share/seavgabios
'';
passthru.firmware = "${finalAttrs.finalPackage}/share/seabios/bios-256k.bin";
meta = {
inherit (seabios.meta) license mainProgram platforms;
description = "Qubes component: `seabios`";
longDescription = ''
Qubes OS' modified version of the SeaBIOS virtual machine firmware.
'';
homepage = "https://qubes-os.org";
downloadPage = "https://github.com/QubesOS/qubes-seabios";
maintainers = with lib.maintainers; [
lach
sigmasquadron
];
};
})
59 changes: 59 additions & 0 deletions pkgs/by-name/qu/qubes-vmm-xen/package.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
{
lib,
fetchpatch,
buildXenPackage,
qubes-seabios,
xen,
}:

let
version = "4.19.0";
upstreamVersion = version;
revision = "5";

qubesPatches = import ./patches.nix {
inherit fetchpatch version revision;
};
qubesPatchList = lib.lists.flatten (
with qubesPatches;
[
EFI_WORKAROUNDS
BACKPORTS
SECURITY_FIXES
UPSTREAMABLE_PATCHES
S0IX_SUPPORT
QUBES_SPECIFIC_PATCHES
REPRODUCIBLE_BUILDS
GVT-G
]
);
in

buildXenPackage.override { systemSeaBIOS = qubes-seabios; } {
pname = "qubes-vmm-xen";
inherit version upstreamVersion;
vendor = "qubes";

withSeaBIOS = true;
withOVMF = true;
withIPXE = false;

rev = "026c9fa29716b0ff0f8b7c687908e71ba29cf239";
hash = "sha256-Q6x+2fZ4ITBz6sKICI0NHGx773Rc919cl+wzI89UY+Q=";
patches = qubesPatchList;

meta = {
inherit (xen.meta) license mainProgram platforms;
description = "Qubes component: `vmm-xen`";
longDescription = ''
Qubes OS' modified version of the Xen Project Hypervisor.
Contains dozens of Qubes-specific patches, and is intended to power a Qubes OS Domain 0.
'';
homepage = "https://qubes-os.org";
downloadPage = "https://github.com/QubesOS/qubes-vmm-xen";
maintainers = with lib.maintainers; [
lach
sigmasquadron
];
};
}
Loading