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

Define patch as a Nix overlay #1

Closed
wants to merge 3 commits into from

Conversation

juliuskoskela
Copy link
Contributor

This is a draft proposal. Discussion on module integration to Ghaf can be found here and should be taken into consideration when evaluating this PR.

Overview

Integrate bpmp virtualization into Ghaf. This integration includes kernel patches, kernel overlays and kernel configurations as well as device tree configurations.

In Ghaf the kernel and device tree are configured in the hardware module. More precisely the hardware device tree is set here (line42). Kernel patches and configurations are set in the same file (lines19-38).

The device tree is hashed and copied to /dtbs/ in the boot configuration.

Kernel overlay example

An example to use as a template for configuring and building the kernel can be found here.

The example defines an overlay which applies a kernel patch as well as kernel configuration (as a nix expression) on top of the requested kernel package (line 10) in nixpkgs (note that instead if linuxPackages_latest we would use the appropriate kernel for example linuxPackages_5_10).

memshare_6.2.patch is the Linux kernel patch we want to apply.
memsharevm-kernel.nix defines kernel configurations and includes the patch.
overlay_config.nix defines the above as an overlay over a specific kernel version.
default.nix extends the kernel with the memsharevm-kernel overlay as a part of its build process (consumer).

The overlay can be applied to a kernel build as demonstrated in this default.nix.
boot.kernelPackages =
pkgs.linuxPackages_latest.extend (_: _: {
kernel = pkgs.memsharevm-kernel;
});

Repository: https://github.com/jpruiz84/bpmp-virt
Template: https://github.com/jkuro-tii/ghaf/tree/main/microvmConfigurations/memshare

juliuskoskela and others added 3 commits May 12, 2023 17:52
Signed-off-by: Julius Koskela <[email protected]>
Signed-off-by: Julius Koskela <[email protected]>
@juliuskoskela
Copy link
Contributor Author

Closed as we didn't go with the overlay method.

jpruiz84 pushed a commit that referenced this pull request Oct 18, 2023
Implement building with Nix flake
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant