| Commit message (Collapse) | Author | Age |
|
|
|
|
|
|
|
|
| |
This was widely used when each component was responsible for filtering
out its own Nix files, but now that's centralised, all these bindings
can be cleaned up.
Fixes: 0149885 ("nix: centralise source cleaning")
Signed-off-by: Alyssa Ross <hi@alyssa.is>
|
|
|
|
|
| |
Signed-off-by: Alyssa Ross <hi@alyssa.is>
Message-Id: <20221010232909.1953738-3-hi@alyssa.is>
|
|
|
|
|
|
|
|
|
| |
This is required for any use of vhost-user. Since any VM might have a
vhost-user device hotplugged, this needs to be on from the start for
all VMs.
Signed-off-by: Alyssa Ross <hi@alyssa.is>
Message-Id: <20221010232909.1953738-2-hi@alyssa.is>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We can simplify our Makefiles a bit by moving some things into a
library file. So far, I've done this for non-component-specific
macros, and inference rules.
Some tar2ext4 rules used a temporary file for the tar2ext4 invocation,
and then moved the file into place when it was done, to prevent a
half-built image sticking around if tar2ext4 died. According to
POSIX, make should clean up any targets that didn't finish building if
it's interrupted, so we should only end up with a half-built image if
tar2ext4 crashes, e.g. due to running out of disk space. I think we
should just ignore that possibility, since otherwise we'd have to
write annoying make rules using temporary file names for every target,
and if it does happen recovery is just a make clean away.
With this, I've also made a small reorganisation. I got rid of the
"nix" directory and created a "lib" directory, where I put
eval-config.nix and the new common.mk file, since both are library
code. checks.nix isn't really a library though, so I moved it into
the "release" directory, since the only reference to it is in
release.nix.
Signed-off-by: Alyssa Ross <hi@alyssa.is>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When I introduced the global src attribute, I broke custom
configurations, since they wouldn't be passing that key in, and nor
should they. To allow for non-customisable globals like src, we need
to separate them from config. Here, I've modified eval-config.nix to
take a callback, so that it can provide multiple attributes, and
handle command line arguments itself so that doesn't need to be in
every entry point any more. This gives us an interface similar to the
NixOS module system's, where a variety of globals are available that
can be pulled out of the passed attribute set as required, but with
the additional advantage that files are usable directly from
nix-build, and support command line arguments.
Signed-off-by: Alyssa Ross <hi@alyssa.is>
Fixes: 0149885 ("nix: centralise source cleaning")
|
|
|
|
|
|
|
|
|
| |
This was getting very repetitive. Having a single copy of the sources
shared between builds will also save on store space, and means we
don't need to support overriding the path to the scripts directory in
Makefiles.
Signed-off-by: Alyssa Ross <hi@alyssa.is>
|
|
|
|
|
|
|
|
|
| |
This will allow booting reliably from multiple disk images, without
relying on order.
Thanks-to: Puck Meerburg <puck@puckipedia.com>
Signed-off-by: Alyssa Ross <hi@alyssa.is>
Message-Id: <20221009114036.463071-5-hi@alyssa.is>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is the first step to being able to do things like having a static
base image for an application VM, and another image containing the
application to run.
When we actually use multiple images we'll need to change how we boot
so we know the kernel is booting from the right image — probably by
PARTUUID or PARTLABEL — because we can't guarantee how the kernel
orders disks inside the VM.
Signed-off-by: Alyssa Ross <hi@alyssa.is>
Message-Id: <20221009114036.463071-2-hi@alyssa.is>
|
|
|
|
|
|
|
| |
With this, Meson will show the status of subtests inside the
"Rust unit tests" test.
Signed-off-by: Alyssa Ross <hi@alyssa.is>
|
|
|
|
|
| |
Pull out all the logic from start-vm into its own file, that can be
built as a library and tested.
|
|
|
|
|
|
|
| |
Otherwise, if start-vm was run by path, it would print the whole path
used to invoke it as an error message prefix.
Signed-off-by: Alyssa Ross <hi@alyssa.is>
|
|
|
|
| |
Signed-off-by: Alyssa Ross <hi@alyssa.is>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
By default, a file called "config.nix" in the root of the Spectrum
repository will be read if it exists. That file should contain an
attribute set. Currently, only a "pkgs" key is supported, which
allows specifying a custom package set that will be used throughout
the Spectrum Nix files. This will allow us to provide configuartion
options for people who want to build Spectrum in ways that are
probably not suitable for upstreaming.
For example, using the "pkgs" config option I'm introducing here, it
would be possible to use an overlay to patch individual components,
like so:
{
pkgs = import <nixpkgs> {
overlays = [
(final: super: {
weston = super.weston.overrideAttrs ({ patches ? [], ... }: {
patches = patches ++ [
path/to/weston.patch
];
});
})
];
};
}
Signed-off-by: Alyssa Ross <hi@alyssa.is>
Message-Id: <20220831093727.282797-1-hi@alyssa.is>
Reviewed-by: Ville Ilvonen <ville.ilvonen@unikie.com>
Tested-by: José Pekkarinen <jose.pekkarinen@unikie.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This isn't a license change — the code was always available under
potential future EUPL versions because of this language in the EUPL:
> Copyleft clause: If the Licensee distributes or communicates copies of the
> Original Works or Derivative Works, this Distribution or Communication will be
> done under the terms of this Licence or of a later version of this Licence
> unless the Original Work is expressly distributed only under this version of the
> Licence — for example by communicating ‘EUPL v. 1.2 only’. The Licensee
> (becoming Licensor) cannot offer or impose any additional terms or conditions on
> the Work or Derivative Work that alter or restrict the terms of the Licence.
But now that reuse 1.0.0 is out, and supports SPDX '+' expressions, we
can express this more clearly in SPDX.
Signed-off-by: Alyssa Ross <hi@alyssa.is>
|
|
|
|
|
|
| |
Nix files shouldn't be considered part of the sources, and so they
should be filtered out. This way, changes to them (that don't change
their meaning) won't force rebuilds.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
There's nothing we could do to recover from a panic, and since we use
FFI extensively, to safely use unwinding panics we would have to wrap
every Rust function callable from C in a catch_unwind[1].
It's not currently possible[2] to use this with Rust unit tests, so we
keep panic=unwind there. It's unlikely that a Rust unit test will
call C which calls Rust anyway.
[1]: https://doc.rust-lang.org/nomicon/unwinding.html
[2]: https://github.com/rust-lang/rust/issues/67650
|
| |
|
|
|
|
|
| |
cloud-hypervisor would misintepret these if they were passed on its
command line.
|
|
|
|
|
| |
I thought that returning early would make the code more noisy, but
with String as the error type, it doesn't!
|
|
|
|
| |
The patch made its way into the Meson release now in Nixpkgs!
|
|
|
|
|
|
|
|
|
| |
Now that we're using a proper modprobe implementation, some of these
weird modprobes we shouldn't have needed in the first place can
actually be removed.
Message-Id: <20220321140107.1043654-2-hi@alyssa.is>
Tested-by: Ville Ilvonen <ville.ilvonen@unikie.com>
|
| |
|
| |
|
|
|
|
| |
This was a leftover from debugging a crash.
|
| |
|
| |
|
| |
|
|
|
|
|
| |
Just like with bridge_add, the kernel doesn't tell us what the new
name is, so we can't return it.
|
| |
|
|
|
|
|
|
| |
This way of doing it stops GCC's stringop-truncation warning in this
case. (But it still fires spuriously in other cases so we're keeping
it disabled.)
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Linux will accept %d and dynamically fill it in, but it doesn't update
the string it was given, so there's no way to know what name was
chosen with this API. If we wanted to support this, we'd probably
have to use the netlink API instead. Right now, we don't need the
kernel to allocate bridge names for us, so let's just reject the names
we can't handle instead.
We only need to check for the presence of a % character, rather than
doing anything more complicated, because network interfaces aren't
actually allowed to have % in their names, so any % character is
either part of a %d that gets replaced, or will be rejected by the
kernel.
|
|
|
|
|
|
| |
This is important when using %d to dynamically choose a tap name in
the kernel. It's not needed for the start-vm program, but supporting
dynamic names makes writing tests easier.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
Aside from the experience benefit of not popping the netvm console
open when it's not required, this also simplifies the implementation a
lot, because it means each VM only has to be a single service.
|
|
|
|
|
| |
If we know ahead of time we won't be able to cleanup after ourselves,
it's probably better to fail early.
|
| |
|
|
|
|
|
| |
The meson mess in Nixpkgs has been resolved, and "meson" is now a
recent version that the patch applies to.
|
| |
|
| |
|
|
|
|
|
| |
All callers are Rust at this point, so there's no point having a C
version available.
|
| |
|
| |
|
| |
|
|
|
|
|
| |
As far as I can tell, this isn't required for anything, ninja uses the
dependency information emitted by rustc.
|
|
This way, we don't allow arbitrary code from the ext partition to run
on the host system, which gives us better integrity guarantees when
paired with Secure Boot. This new scheme also makes it easy to
introspect VMs, since they're defined using a very limited
configuration language.
|