| 15 May 2024 |
| lassulus changed their profile picture. | 19:30:55 |
| 16 May 2024 |
| nhnn joined the room. | 07:57:38 |
nhnn | I'm a bit confused about mechanism of https://github.com/nix-community/disko/blob/master/docs/disko-images.md. Can I create partitions and drop some files on them using disko? I don't want to install NixOS on raw disk. | 07:58:52 |
lassulus | That creates an image file with a disko defined partition layout and some extra files you pass to it | 08:17:06 |
nhnn | In reply to@lassulus:lassul.us That creates an image file with a disko defined partition layout and some extra files you pass to it It just spins up NixOS VM and creates partitions inside? | 08:18:32 |
lassulus | Yes | 08:19:34 |
nhnn | Got it, thanks. | 08:20:26 |
| 17 May 2024 |
matthewcroughan | hehe | 19:50:50 |
matthewcroughan | nix build .#nixosConfigurations.pi.config.system.build.image
warning: Git tree '/home/matthew/git/nix.how/clients/machines' is dirty
trace: warning: system.stateVersion is not set, defaulting to 24.05. Read why this matters on https://nixos.org/manual/nixos/stable/options.html#opt-system.stateVersion.
error: builder for '/nix/store/7mlf74xlxwhy4jq4rvbnjazpx5kd8bpl-image.drv' failed with exit code 1;
last 7 log lines:
> structuredAttrs is enabled
> Running phase: patchPhase
> 'repart.d' -> '/build/amended-repart.d'
> Running phase: updateAutotoolsGnuConfigScriptsPhase
> Running phase: buildPhase
> Building image with systemd-repart...
> unshare: unshare failed: Invalid argument
For full logs, run 'nix log /nix/store/7mlf74xlxwhy4jq4rvbnjazpx5kd8bpl-image.drv'.
| 19:50:52 |
matthewcroughan | bullish for disko, repart doesn't work in the binfmt emulated context | 19:51:01 |
matthewcroughan | * bullish for disko, systemd-repart doesn't work in the binfmt emulated context | 19:51:13 |
matthewcroughan | https://github.com/NixOS/nixpkgs/issues/311978 | 19:51:53 |
| 18 May 2024 |
matthewcroughan | The way I see it there are only two problems remaining with disko:
- no compression for diskImages output
- no hostPlatform recognition (build on hostPlatform vm and run binfmt inside of that accelerated kvm machine)
| 00:09:50 |
matthewcroughan | 2 is a bit of an architectural issue that I looked into earlier, the way disko and even vmTools are constructed, doesn't easily allow you to fix that | 00:10:31 |
matthewcroughan | atm vmTools will fall back to tcg, and basically hang, never completing the build | 00:11:20 |
matthewcroughan | instead, vmTools should execute a VM for the hostplatform, with binfmt enabled. But vmTools is so minimal that putting binfmt in there wouldn't re-use the nixpkgs machinery (boot.binfmt.emulatedSystems) | 00:12:05 |
matthewcroughan | * instead, vmTools should execute a VM for the hostPlatform, with binfmt enabled, and run all the scripts for arm64, But vmTools is so minimal that putting binfmt in there wouldn't re-use the nixpkgs machinery (boot.binfmt.emulatedSystems) | 00:12:22 |
matthewcroughan | The use case is building a raspberry pi image, of course :D | 00:12:34 |
matthewcroughan | x86 kvm -> nested arm64 binfmt, is much much much faster than arm64 -> arm64 , which is what currently happens | 00:15:07 |
matthewcroughan | * The way I see it there are only two problems remaining with disko:
- no compression for diskImages output
- no hostPlatform recognition (build on hostPlatform vm and run binfmt for arm64 inside of that accelerated kvm machine)
| 00:15:32 |
matthewcroughan | PRs welcome, I know.. but it's really quite difficult to re-imagine the make-disk-image function and vmTools with hostPlatform conditions | 00:16:28 |
matthewcroughan | * x86 kvm -> nested arm64 binfmt, is much much much faster than arm64 binfmt -> arm64 tcg vm , which is what currently happens if you try to build an arm64 disk image on x86 | 00:17:12 |
matthewcroughan | * x86 kvm -> nested arm64 binfmt, is much much much faster than arm64 binfmt -> arm64 tcg vm , which is what currently happens if you try to build an arm64 disk image on an x86 host | 00:17:23 |
matthewcroughan | corpo-disko-images> + findmnt /dev/disk/by-partlabel/disk-disk1-firmware /mnt/firmware
corpo-disko-images> + mount /dev/disk/by-partlabel/disk-disk1-firmware /mnt/firmware -t vfat -o defaults -o X-mount.mkdir
corpo-disko-images> + /nix/store/gc39rhvazg28s7y80c4c0a24x3hsv92p-postMountHook.sh
corpo-disko-images> + rm -rf /tmp/tmp.GkPSSeFxnb
corpo-disko-images> warning: the group 'nixbld' specified in 'build-users-group' does not exist
corpo-disko-images> cp: cannot access '/nix/store/fikh9lqcr2vfz3ncq3sihqzhjw482yps-mbrola-voices-3.3/data/gr1': Cannot allocate memory
corpo-disko-images> cp: cannot access '/nix/store/nw17gpncwy29l0r8kaxzss6nb4c1bh6s-linux-firmware-20240513-zstd/lib/firmware/qcom/sm8250': Cannot allocate memory
corpo-disko-images> [ 122.745756] reboot: Power down
| 01:02:03 |
matthewcroughan | I ran into this Cannot allocate memory issue again, but it happens non-deterministically. It only happens every now and then.. very strange | 01:02:29 |
lassulus | AFAIK there was a way to compress the images disko generates with a hook | 08:16:01 |
lassulus | https://github.com/nix-community/disko/blob/master/lib/make-disk-image.nix#L6 | 08:16:34 |
| 19 May 2024 |
matthewcroughan | In reply to @lassulus:lassul.us https://github.com/nix-community/disko/blob/master/lib/make-disk-image.nix#L6 Oh yes, but this is more manual and not a module option, which I think it should be | 11:27:02 |
matthewcroughan | I may figure that out and contribute it today | 11:27:27 |
matthewcroughan | I have another issue though, which is that I need the bootloader to be on a partition other than the root partition | 11:27:55 |