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

Reuse NixOS initrd #82

Merged
merged 15 commits into from
May 24, 2023
Merged

Reuse NixOS initrd #82

merged 15 commits into from
May 24, 2023

Conversation

astro
Copy link
Owner

@astro astro commented Apr 1, 2023

No longer requires a custom kernel build

  • Update build-vm.nix
  • Extend the checks
  • Wait for NixOS 23.05

Call for users who run on nixos-unstable: please test and leave emojis here!

@mikatammi
Copy link
Contributor

This looks like an interesting work, I'll need to find time to test this out.

I have only one wish, could we retain the functionality that we can build our custom kernel, eg. behind an option? We actually have usecases where we would like to run different custom kernels, meaning different versions, with different kernel configurations and patches in different microvms

I've been already doing some work to enable custom kernels in microvms, but have not yet done any PR

@astro
Copy link
Owner Author

astro commented Apr 19, 2023

I have only one wish, could we retain the functionality that we can build our custom kernel, eg. behind an option? We actually have usecases where we would like to run different custom kernels, meaning different versions, with different kernel configurations and patches in different microvms

With this you will be able to use normal NixOS configuration mechanisms, no more extra hoops to jump through.

I've been already doing some work to enable custom kernels in microvms, but have not yet done any PR

You should stop doing any kernel configuration that is specific to microvm.nix. Please test this. I want to merge it once the nixos-23.05 branch is born.

@Dan-Theriault
Copy link

I get a build failure trying to run this:

error: builder for '/nix/store/vj3i1c8n0h3w8psgkyf0az70sz1mx741-bash-5.2-p15-x86_64-elf.drv' failed with exit code 77;
       last 10 log lines:
       > checking build system type... x86_64-unknown-linux-gnu
       > checking host system type... x86_64-pc-elf
       >
       > Beginning configuration for bash-5.2-release for x86_64-pc-elf
       >
       > checking for x86_64-elf-gcc... x86_64-elf-gcc
       > checking whether the C compiler works... no
       > configure: error: in `/build/bash-5.2':
       > configure: error: C compiler cannot create executables
       > See `config.log' for more details
       For full logs, run 'nix log /nix/store/vj3i1c8n0h3w8psgkyf0az70sz1mx741-bash-5.2-p15-x86_64-elf.drv'.
error: 1 dependencies of derivation '/nix/store/iqp3glibnf2vfzh29k9d96rmlh4ac8xc-cargo.drv' failed to build
error: 1 dependencies of derivation '/nix/store/xa6d9la5iavcn4c75z3vsfzf5iyms6wj-rust-hypervisor-firmware-x86_64-elf-0.4.2.drv' failed to build
error: 1 dependencies of derivation '/nix/store/9v8dk14gamma7y5qffa6fv039f895gl6-microvm-run.drv' failed to build
error: 1 dependencies of derivation '/nix/store/kd1kq88ixllsi3p97wxkgjl9xnvpalrq-microvm-run.drv' failed to build
error: 1 dependencies of derivation '/nix/store/mr2vgnadg27g4j52njhx6vvw6ib8ax2d-microvm-run.drv' failed to build
error: 1 dependencies of derivation '/nix/store/yjy0kcrgpnlbck3l5x7nw08cxkivrivk-microvm-cloud-hypervisor-burnham.drv' failed to build
error: 1 dependencies of derivation '/nix/store/8d2cqi3qiqwv6k6i6ghakqs4drgj7pxs-microvm-cloud-hypervisor-marden.drv' failed to build
error: 1 dependencies of derivation '/nix/store/p7wsggnj8xdxyjjd9yr1458ibh6lh2ff-microvm-cloud-hypervisor-suncook.drv' failed to build
error: 1 dependencies of derivation '/nix/store/vx8mbzig1nwx5prhv5416cdxd5wgjxjp-unit-script-install-microvm-burnham-start.drv' failed to build
error: 1 dependencies of derivation '/nix/store/yk7yvq4639y8mg7jxhk7rfqifbs2gv89-unit-script-install-microvm-marden-start.drv' failed to build
error: 1 dependencies of derivation '/nix/store/5gw0qkn8zdnmf2fv2gl58i250bn3hciw-unit-script-install-microvm-suncook-start.drv' failed to build
error: 1 dependencies of derivation '/nix/store/70mls02dvvh9iayn27z2m3xqj9f1zl35-unit-install-microvm-burnham.service.drv' failed to build
error: 1 dependencies of derivation '/nix/store/cys0h4np6ma7jp7ym3l1f5nxrj8m3b2l-system-units.drv' failed to build
error (ignored): error: interrupted by the user
error: 1 dependencies of derivation '/nix/store/rbvmdsaq1fv5iacllizalsss4gdndfzn-etc.drv' failed to build
error: 1 dependencies of derivation '/nix/store/wxc9b1ywx11k2da8nich4qffcbdd2kaa-nixos-system-merrimack-23.05.20230419.645bc49.drv' failed to buil

@astro
Copy link
Owner Author

astro commented Apr 21, 2023

Yes, rust-hypervisor-firmware (required for cloud-hypervisor) has been broken in upstream nixpkgs but I have problems finding the breaking change using git bisect. and the drama unfolds here: NixOS/nixpkgs#228106

@hissssst
Copy link

Worked correctly with my simple qemu declarative setup. Great job ❤️

@astro astro merged commit 63f21e8 into main May 24, 2023
1 of 2 checks passed
@astro astro deleted the initrd branch May 24, 2023 20:45
@astro
Copy link
Owner Author

astro commented May 24, 2023

With nixos-23.05 having branched off, rust-hypervisor-firmware is now available to Flake users who want to stay on a stable branch. I hope this work makes life easier for everyone.

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.

None yet

4 participants