QEMU on aarch64 requires an explicit machine type (e.g., '-machine virt'),
unlike x86_64 which has a default. Previously, the test script hardcoded
'qemu-kvm' without machine type arguments, causing aarch64 tests to fail
with "No machine specified, and there is no default".
By importing and using nixpkgs' qemu-common.nix library, we reuse the
existing platform-specific QEMU configuration logic.
fixes device groups, for example where the disko config given looks like:
label = "fast.dev1";
after formatting, the device has a literal label of "fast.dev1" which
breaks bcachefs device groups:
echo fast > /sys/fs/bcachefs/<id>/options/foreground_target
gives the error Invalid argument, echo fast.dev1 fails as well
echo "\"fast\"" fails the same, however echo "\"fast.dev1\"" succeeds
after this, device labels and groups work as expected and any component
of the label can be used for a *_target
This update introduces a bcachefs type with encryption support and advanced formatting options.
It includes a new example (`examples/bcachefs-multi-disk.nix`) to demonstrate multi-disk setups and available options.
Key changes:
- Deterministic UUID generation.
- Addressed limitations with multi-disk root setups due to bcachefs and systemd issues.
- Provided a systemd-mount alternative for fileSystems configuration.
- Added subvolume support and updated scripts for clarity and functionality.
---------
Co-authored-by: Jonas Heinrich <onny@project-insanity.org>
Co-authored-by: Jörg Thalheim <Mic92@users.noreply.github.com>
Co-authored-by: Kyle Petryszak <6314611+ProjectInitiative@users.noreply.github.com>
Update
* Add examples
* Improve descriptions
Remove debugging
Remove comment
Use `unique` to dedup lists
This is the only way to assign devices rather than fixed gpt partitions.
Without reading the code it's not very obvious how disko actually
assigns devices to zpools.
A config like
```nix
{
vdev = [
{
mode = "mirror";
members = [ "data1" "data2" ];
}
{
members = [ "data3" ];
}
];
}
```
would result in the following command:
```shell
zpool create -f <name> mirror /dev/data1 /dev/data2 /dev/data3
```
which would result in a single vdev with a 3-way mirror, rather than a
vdev with a 2-way mirror and a second vdev with a single disk. By
reordering the vdevs to handle those with an empty mode first we
transform this into:
```shell
zpool create -f <name> /dev/data3 mirror /dev/data1 /dev/data2
```
which does have the desired outcome.
Fixes#130
This should fix pretty much all cases where spaces or other special
characters would break disko due to improper quoting. I searched for all
instances of '.label', '.device' and '.name', so I believe I caught
whatever I could.
In some cases I changed single quotes to double quotes for consistency.
I know we don't usually fix bugs in the legacy table type, but it was so
easy I couldn't resist.
Reproduces #130.
For new style table the generated script has a few problems for example;
```sh
sgdisk \
--new=2:0:+100M \
--change-name=2:disk-vdb-name with spaces \
--typecode=2:EF00 \
/dev/vdb
```
and
```sh
mkfs.vfat \
\
/dev/disk/by-partlabel/disk-vdb-name with spaces
```
Legacy table style generates slightly different problems e.g.;
```sh
parted -s /dev/vdb -- mkpart name with spaces 1MiB 100MiB
```
Fixes#745
This adds a script to create a release. Running it will create two
commits that would appear like this in `git log --oneline`:
67b5fff (master) release: reset released flag
0b808f3 (tag: v1.8.1) release: v1.8.1
100d2f3 docs: last change before release
It also re-creates the `version.nix` file, which is used by the flake
to determine the final version the disko CLI will print.
If `disko --version` is run from exactly the commit tagged `v1.8.1`, it
will print `1.8.1`. If it is run from any commit past that (like
master), it will print `1.8.1-67b5fff`, and if it is run from a local
folder with uncommitted changes, it will print `1.8.1-67b5fff-dirty`.
As `makeDiskImages` always requires a NixOS configuration, we can
simplify the code by convering it into a NixOS module. Then we can make
it responsible for populating `system.build.diskoImages` and
`system.build.diskoImagesScript`.