520 Commits

Author SHA1 Message Date
SandaruKasa ed3265a13f various: address lint-short-path-literals 2026-06-15 01:09:32 +03:00
Philip Taron e741e98346 vmTools: point in-VM module loading at kernelModules too
The previous commit split the module tree out of `kernel` into a new
`kernelModules` argument, but only updated the initrd modules closure.
Two other places still referenced `kernel` for modules:

* `MODULE_DIR` in stage2Init, which backs both the kernel automatic
  module loader (/proc/sys/kernel/modprobe) and any explicit modprobe
  run inside the VM;
* the `/lib` symlinks in extractFs and extractMTDfs.

Before the split these pointed at the aggregated tree whenever callers
overrode `kernel` with one, so e.g. `modprobe zfs` inside the VM found
the out-of-tree module. Verified by running modprobe of a module
present only in `kernelModules` inside runInLinuxVM: it fails with
"FATAL: Module zfs not found" before this change and succeeds after.

Assisted-by: Claude Code (claude-fable-5)
2026-06-11 09:55:27 -07:00
r-vdp 68d32ed6cb vmTools: fix img collision with pkgs.img, add kernelModules arg
Commit 31d1d80b3f ("lib/systems: move kernel configuration out of
the platform structure") changed all-packages.nix from

  vmTools = callPackage ../build-support/vm {
    img = stdenv.hostPlatform.linux-kernel.target;
  };

to

  vmTools = callPackage ../build-support/vm { };

and changed the function default to `img ? kernel.target`. Since
`pkgs.img` exists, `callPackage` now auto-fills the `img` argument
with that attribute and the default is never used.
Anything going through `runInLinuxVM` (make-disk-image,
nixosTests.bootspec.*, etc.) then fails with:

  qemu: could not open kernel file
  '/nix/store/...-linux-.../...-img-0.5.11': No such file or directory

Rename `img` to `kernelImage` so it no longer collides with a
top-level package.

The same commit also broke callers that override `kernel` with an
`aggregateModules` tree (the in-tree zfs image builders, disko), since
that has no `.target`. The single `kernel` argument was being used for
two unrelated things: the boot image for `qemu -kernel` and the module
tree for the initrd. Split the latter out into a new `kernelModules`
argument (defaulting to `kernel`), point the zfs image builders at it,
and throw a clear error explaining the migration when `kernel.target`
is missing.
2026-06-11 18:21:30 +03:00
Alyssa Ross 2d18606282 lib/systems: move kernel configuration out of the platform structure (#530133) 2026-06-10 17:39:49 +00:00
Emily 31d1d80b3f lib/systems: move kernel configuration out of the platform structure
Currently, you need to override `stdenv.hostPlatform` to request a
compressed kernel on AArch64, and the kernel configuration is split
between the central structured configuration and string snippets in
platform definitions. This has consequently made the latter bitrot
terribly. Since the platform‐specific logic is now very limited after
cleaning up the detritus, we can move it into the kernel derivation
and expose the relevant configuration there for anyone who wants to
customize it further or needs to read it out.

Co-authored-by: zowoq <59103226+zowoq@users.noreply.github.com>
2026-06-10 11:17:38 +10:00
Varun Biniwale c73f751b5d vmTools: update Ubuntu 26.04 commit hashes
Not sure why they changed but they (hopefully) shouldn't change again.
2026-05-27 09:33:20 -07:00
Varun Biniwale fe37bcee22 vmTools: add Ubuntu 26.04 "Resolute" (amd64) disk image
Adds `ubuntu2604x86_64` to the VM disk image definitions using a
snapshot from 2026-05-15, along with a corresponding test target
`testUbuntu2604x86_64Image` in test.nix.
2026-05-26 13:48:24 -07:00
Colin 86ada36e02 build-support/vm: fix unpopulated debsGrouped after structuredAttrs refactor
debsGrouped was a nested array, like `[ [ drv1 drv2 ] [ drv3 ] ... ]`.
that doesn't map to any bash item, so it would live only in the json attrs.

the `for component in "${debsGrouped[@]}"; ...` part of buildCommand
was thus referring to an unset variable... but the default bash behavior
is to treat that as an empty array even with `set -u` so the loop was
just doing nothing.

instead, flatten the array on the nix side. bash gets something like
`("drv1 drv2" "drv3" ...)` and the existing shell code destructures
that as expected.

verify by building a vm (e.g.
`tests.vmTools.buildPatchelfInDebian.diskImage`) and checking the
nix-log before and after for `INSTALLING COMPONENT` messages.

Co-Authored-By: Stefan Frijters <sfrijters@gmail.com>
2026-05-21 07:28:29 +00:00
Stefan Frijters 85bdfb8ba6 build-support/vm: refactor IFS tricks in fillDiskWithDebs 2026-04-24 13:27:06 +02:00
Stefan Frijters 99872c2d5b build-support/vm: fix fillDiskWithRPMs
With __structuredAttrs enabled, 'rpms' is a bash array.
2026-04-24 12:15:16 +02:00
Stefan Frijters 96c5a1f757 build-support/vm: fix fillDiskWithDebs
After __structuredAttrs was enabled in runInLinuxVM, the structure
of 'debs' matters.

The current implementation uses some IFS tricks so we just flatten into a string.
Future improvements could include treating debs as a list in a more
structured way.
2026-04-24 12:15:16 +02:00
Jo 0492b8e2fc build-support/vm: enable structuredAttrs for runInLinuxVM (#498273) 2026-03-13 10:51:14 +00:00
Jörg Thalheim c4ce61bb25 build-support/vm: reduce waiting time for vsock
the check is cheap so 100ms is better to reduce latency
2026-03-12 07:36:18 +01:00
Stefan Frijters a2dbc67258 build-support/vm: enable structuredAttrs for runInLinuxVM 2026-03-09 16:47:35 +01:00
Jared Baur c509bb147d vmTools: fix crc32c module load on newer kernels
Newer kernels do not have a module called `crc32c_generic`, however the
module alias `crc32` points to the right thing on kernels from 5.10 and
onward.
2026-02-11 11:18:25 -08:00
Steven Allen f5ce33f30f vmTools: Re-export qemuCommandLinux
This was un-exported in db467c36ec, but
that breaks disko [1] and lvm2 [2].

[1] https://github.com/nix-community/disko/blob/916506443ecd0d0b4a0f4cf9d40a3c22ce39b378/lib/make-disk-image.nix#L296
[2] https://github.com/lvmteam/lvm2/blob/6e208b81ec587434097de3207fbd1ecd7a0afb8c/nix/default.nix#L136
2026-01-09 16:39:26 -08:00
Philip Taron 63df4c8020 vmTools: update Ubuntu snapshot timestamps to 20260101T000000Z 2026-01-05 11:18:23 -08:00
Philip Taron a1e10daba4 vmTools: update Debian snapshot timestamps to 20260105T082626Z 2026-01-05 11:07:45 -08:00
Philip Taron 57dc89a966 vmTools: update Oracle Linux 9 package list hashes 2026-01-05 10:50:27 -08:00
Philip Taron f75aefb26e vmTools: update Rocky Linux 9.5 to 9.6 2026-01-05 10:49:35 -08:00
Philip Taron 52fbdf3dee vmTools: drop CentOS Stream
As @uninsane points out, these are designed to rot rapidly.
2026-01-05 10:33:39 -08:00
Philip Taron 97e4caee70 vmTools: add documentation for updating Amazon Linux 2023 GUID
Amazon Linux 2023 uses GUID-based URLs that don't allow directory
listing, making updates non-trivial. Add a comment explaining how to
find the current GUID by either running an AL2023 container or checking
the docker-library/repo-info repository.
2026-01-05 09:57:14 -08:00
Philip Taron b80421ae90 vmTools: update Oracle Linux 9 package list hashes
Oracle provides versioned URLs for baseos but not appstream. Since we
can't mix versioned baseos with rolling appstream due to package version
dependencies (glibc mismatch), we keep using rolling URLs for both.

Add comment explaining this limitation.
2026-01-05 09:57:14 -08:00
Philip Taron 60e98283d2 vmTools: use AlmaLinux vault URLs for stable package lists
The repo.almalinux.org URLs are rolling and change with each minor
release, causing hash mismatches. Switch to vault.almalinux.org which
provides stable URLs for specific versions.

- alma9x86_64: use vault 9.6
- alma10x86_64: use vault 10.0
2026-01-05 09:57:14 -08:00
Philip Taron 2fec9598a8 vmTools: shore up the tests with each image 2026-01-05 09:57:14 -08:00
Philip Taron 921c93ffbc vmTools: add in Amazon Linux 2023 2026-01-05 09:57:14 -08:00
Philip Taron 98b0461681 vmTools: add Oracle Linux 9 2026-01-05 09:57:14 -08:00
Philip Taron e2127eb5d0 vmTools: add Alma Linux 9 and 10 2026-01-05 09:57:14 -08:00
Philip Taron 0101fa5e71 vmTools: add Rocky Linux 10 2026-01-05 09:57:14 -08:00
Philip Taron 89def9fcce vmTools: add Rocky Linux 9 2026-01-05 09:57:14 -08:00
Philip Taron 4664110a34 vmTools: refactor in a baseRHELFamilyPackages 2026-01-05 09:57:14 -08:00
Philip Taron 686f52f7a3 vmTools: remove unused commonCentOSPackages 2026-01-05 09:57:14 -08:00
Philip Taron c906fa0b6d vmTools: introduce CentOS Stream 10 2026-01-05 09:57:13 -08:00
Philip Taron 627a540b23 vmTools: introduce CentOS Stream 9 2026-01-05 09:57:13 -08:00
Philip Taron 052667f525 vmTools: introduce Fedora 43
It uses unified sbin, which requires a slight tweak in the unifiedSystemDir setup
2026-01-05 09:57:13 -08:00
Philip Taron b0bc312869 vmTools: add in Fedora 42 support 2026-01-05 09:57:13 -08:00
Philip Taron 8f9e96fd60 vmTools: add in backports packages for bookworm and trixie 2026-01-05 09:57:13 -08:00
Philip Taron 57c1584110 vmTools: add in updates and security pockets for all Ubuntu distros 2026-01-05 09:57:13 -08:00
Philip Taron 0b2d855f93 vmTools: update Ubuntu versions to use the snapshot.ubuntu.com server 2026-01-05 09:57:13 -08:00
Philip Taron e327ca2055 vmTools: update Debian 13 to snapshot 20251217T203845Z 2026-01-05 09:57:13 -08:00
Philip Taron 0e2d64bbd0 vmTools: update Debian 12 to snapshot 20251217T203845Z 2026-01-05 09:57:13 -08:00
Philip Taron 5112cf457a vmTools: update Debian 11 to snapshot 20251217T203845Z 2026-01-05 09:57:13 -08:00
Philip Taron 9d6ee21262 nixos: pass stdenv into qemu-common
We also don't export it from `vmTools` anymore.
2026-01-05 09:57:13 -08:00
Philip Taron db467c36ec vmTools: use callPackage and fix rotted tests 2026-01-05 09:57:09 -08:00
Marcel Müller 0cec848adc build-support/vm: Fix missing sleep command
The sleep command is not a bash built-in, so when a VM does not have
coreutils in their PATH this script will break. The fix is to refer to
it directly.

Signed-off-by: Marcel Müller <neikos@neikos.email>
2026-01-02 13:44:05 +01:00
Gary Guo 00c3b838fb build-support/vm: fix race between qemu & virtiofsd 2025-12-27 21:37:25 +00:00
Marcel Müller 971d45d94a vmtools: Add Debian 13 "Trixie" (amd64 and i386)
Signed-off-by: Marcel Müller <neikos@neikos.email>
2025-08-20 09:51:26 +02:00
Jared Baur 098f006bfc vmTools: use getOutput for MODULE_DIR
Using modulesClosure ought to work, but `lib.getOutput "modules" kernel`
is consistent with how this file was before.
2025-08-19 05:56:12 -07:00
Jared Baur d9d6cc6666 vmTools: reference modules closure already created 2025-08-19 05:02:39 -07:00
Jared Baur fa340abe6d vmTools: use modules output from kernel 2025-08-17 01:51:42 -07:00