Skip to content

Commit

Permalink
Add vanilla Linux kernel build
Browse files Browse the repository at this point in the history
Currently we only build kernel with the dma patch. Some clients
use virtio 1.0 and they do not need this patch. To solve this we
want to build a vanilla kernel.

Change-Id: Ie624481827a4e74e761b530e6ce5e4dce8153509
  • Loading branch information
dingelish committed Jun 6, 2024
1 parent cc04343 commit 3b747da
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@
# reproducibility.
# Note that building a package via nix is not by itself a guarantee of
# reproducibility; see https://reproducible.nixos.org.
linux_kernel = pkgs.linuxManualConfig {
# Common kernel configuration
commonLinuxKernelConfig = {
# To allow reproducibility, the following options need to be configured:
# - CONFIG_MODULE_SIG is not set
# - CONFIG_MODULE_SIG_ALL is not set
Expand All @@ -49,11 +50,16 @@
version = linux_kernel_version;
src = linux_kernel_src;
allowImportFromDerivation = true;
};
# Patched kernel
linux_kernel = pkgs.linuxManualConfig (commonLinuxKernelConfig // {
kernelPatches = [{
name = "virtio-dma";
patch = ./oak_containers_kernel/patches/virtio-dma.patch;
}];
};
});
# Vanilla kernel
vanilla_linux_kernel = pkgs.linuxManualConfig commonLinuxKernelConfig;
androidSdk =
(pkgs.androidenv.composeAndroidPackages {
platformVersions = [ "30" ];
Expand Down Expand Up @@ -101,7 +107,7 @@
};
in
{
packages = { inherit linux_kernel; };
packages = { inherit linux_kernel; inherit vanilla_linux_kernel; };
formatter = pkgs.nixpkgs-fmt;
# We define a recursive set of shells, so that we can easily create a shell with a subset
# of the dependencies for specific CI steps, without having to pull everything all the time.
Expand Down Expand Up @@ -184,6 +190,7 @@
containers = with pkgs; mkShell {
shellHook = ''
export LINUX_KERNEL="${linux_kernel}"
export VANILLA_LINUX_KERNEL="${vanilla_linux_kernel}"
'';
inputsFrom = [
base
Expand Down Expand Up @@ -214,6 +221,7 @@
bzImageProvenance = with pkgs; mkShell {
shellHook = ''
export LINUX_KERNEL="${linux_kernel}"
export VANILLA_LINUX_KERNEL="${vanilla_linux_kernel}"
'';
inputsFrom = [
rust
Expand Down

0 comments on commit 3b747da

Please sign in to comment.