| 12 Dec 2023 |
lassulus | yeah Janik (they/them) had the same issue. not sure what it wants with all the memory though. maybe something with tmpfs | 12:06:41 |
lassulus | ideally that shouldn't happen though | 12:06:52 |
matthewcroughan | it uses nixos-install in the VM, and it also uses nix-store --load-db | 12:07:01 |
matthewcroughan | maybe one of those requires memory for the closure | 12:07:08 |
Janik (they/them) | I upstreamed a option to add more memory to the vm builder iirc | 12:14:41 |
Janik (they/them) | https://github.com/nix-community/disko/blob/master/lib/make-disk-image.nix#L86 | 12:15:43 |
matthewcroughan | In reply to @janik0:matrix.org https://github.com/nix-community/disko/blob/master/lib/make-disk-image.nix#L86 I don't see a way of setting it from the nix function here | 12:22:52 |
matthewcroughan | it's hardcoded to 2014 | 12:23:05 |
matthewcroughan | * it's hardcoded to 1024 | 12:23:06 |
matthewcroughan | it should probably be an option in the disko config somewhere | 12:23:19 |
lassulus | but usually 1024 should suffice to just copy closures | 12:24:38 |
lassulus | so there is a bug somewhere else | 12:24:53 |
matthewcroughan | How would this get past CI? | 12:27:22 |
matthewcroughan | I thought there was a test in Disko to test a nixos config already | 12:27:39 |
lassulus | yeah, it also worked for all my testcases with 1024mb | 12:28:33 |
matthewcroughan | oh falling back to tcg for qemu seems not to work btw | 12:29:04 |
matthewcroughan | might be worth throwing an error if the host uses tcg, because it's almost destined to fail | 12:29:15 |
matthewcroughan | nix build .#nixosConfigurations.pi3.config.system.build.diskoImages -L | 12:29:46 |
matthewcroughan | the diskoImages output being a member of the nixosConfiguration is somewhat misleading if you're building for a Pi, because the host doesn't need to be aarch64 | 12:30:21 |
matthewcroughan | maybe should be a trace to say use the make-disk-image function directly, before qemu crashes with an error saying tcg is unlikely to succeed. | 12:31:45 |
matthewcroughan | What I've not understood is why the ext4 image builder in nixpkgs does often succeed, whilst disko's will fail with:
piygg-disko-images> WARNING: Image format was not specified for 'vdb.raw' and probing guessed raw.
piygg-disko-images> Automatically detecting the format is dangerous for raw images, write operations on block 0 will be restricted.
piygg-disko-images> Specify the 'raw' format explicitly to remove the restrictions.
piygg-disko-images> kvm version too old
piygg-disko-images> qemu-system-aarch64: failed to initialize kvm: Inappropriate ioctl for device
piygg-disko-images> qemu-system-aarch64: falling back to tcg
piygg-disko-images> loading kernel modules...
piygg-disko-images> [ 75.182575] Invalid ELF header magic: != ELF
piygg-disko-images> [ 77.765452] Invalid ELF header magic: != ELF
piygg-disko-images> mounting Nix store...
piygg-disko-images> mounting host's temporary directory...
piygg-disko-images> starting stage 2 (/nix/store/b8xm4rw6x3iccw74aq30x59ra6jrjank-vm-run-stage2)
piygg-disko-images> running udev...
piygg-disko-images> Starting systemd-udevd version 254.3
piygg-disko-images> Failed to wait for daemon to reply: Connection timed out
piygg-disko-images> [ 353.917274] reboot: Power down
| 12:38:24 |
matthewcroughan | bcachefs fails like this
piygg-disko-images> WARNING: Image format was not specified for 'vdb.raw' and probing guessed raw.
piygg-disko-images> Automatically detecting the format is dangerous for raw images, write operations on block 0 will be restricted.
piygg-disko-images> Specify the 'raw' format explicitly to remove the restrictions.
piygg-disko-images> loading kernel modules...
piygg-disko-images> [ 1.214649] Invalid ELF header magic: != ELF
piygg-disko-images> [ 1.237751] Invalid ELF header magic: != ELF
piygg-disko-images> mounting Nix store...
piygg-disko-images> mounting host's temporary directory...
piygg-disko-images> starting stage 2 (/nix/store/b8xm4rw6x3iccw74aq30x59ra6jrjank-vm-run-stage2)
piygg-disko-images> running udev...
piygg-disko-images> Starting systemd-udevd version 254.3
piygg-disko-images> warning: the group 'nixbld' specified in 'build-users-group' does not exist
piygg-disko-images> umount: /mnt: not found
piygg-disko-images> /nix/store/adl5xn24c9xr7w2prh6xqr9sknw38lq6-disko: line 7: /nix/store/r3xam6azp7zcd8a2ybwqdnqv0iliggl1-disk-deactivate/disk-deactivate: cannot execute: required file not found
piygg-disko-images> ++ mktemp -d
piygg-disko-images> + disko_devices_dir=/tmp/tmp.CPiB2fD5zZ
piygg-disko-images> + trap 'rm -rf "$disko_devices_dir"' EXIT
piygg-disko-images> + mkdir -p /tmp/tmp.CPiB2fD5zZ
piygg-disko-images> + device=/dev/vda
piygg-disko-images> + imageSize=2G
piygg-disko-images> + name=vdb
piygg-disko-images> + type=disk
piygg-disko-images> + device=/dev/vda
piygg-disko-images> + type=gpt
piygg-disko-images> + sgdisk --set-alignment=2048 --align-end --new=1:0:500M --change-name=1:disk-vdb-ESP --typecode=1:EF00 /dev/vda
piygg-disko-images> Creating new GPT entries in memory.
piygg-disko-images> The operation has completed successfully.
piygg-disko-images> + partprobe /dev/vda
piygg-disko-images> + udevadm trigger --subsystem-match=block
piygg-disko-images> + udevadm settle
piygg-disko-images> + device=/dev/disk/by-partlabel/disk-vdb-ESP
piygg-disko-images> + extraArgs=()
piygg-disko-images> + declare -a extraArgs
piygg-disko-images> + format=vfat
piygg-disko-images> + mountOptions=('defaults')
piygg-disko-images> + declare -a mountOptions
piygg-disko-images> + mountpoint=/boot
piygg-disko-images> + type=filesystem
piygg-disko-images> + mkfs.vfat /dev/disk/by-partlabel/disk-vdb-ESP
piygg-disko-images> mkfs.fat 4.2 (2021-01-31)
piygg-disko-images> + sgdisk --set-alignment=2048 --align-end --new=2:0:-0 --change-name=2:disk-vdb-root --typecode=2:8300 /dev/vda
piygg-disko-images> The operation has completed successfully.
piygg-disko-images> + partprobe /dev/vda
piygg-disko-images> + udevadm trigger --subsystem-match=block
piygg-disko-images> + udevadm settle
piygg-disko-images> + device=/dev/disk/by-partlabel/disk-vdb-root
piygg-disko-images> + extraArgs=()
piygg-disko-images> + declare -a extraArgs
piygg-disko-images> + format=bcachefs
piygg-disko-images> + mountOptions=('defaults')
piygg-disko-images> + declare -a mountOptions
piygg-disko-images> + mountpoint=/
piygg-disko-images> + type=filesystem
piygg-disko-images> + mkfs.bcachefs /dev/disk/by-partlabel/disk-vdb-root
piygg-disko-images> External UUID: 7082febe-9adf-4964-a37e-330c370a630a
piygg-disko-images> Internal UUID: 828694e4-1409-4c85-908d-9afa27f797fc
piygg-disko-images> Device index: 0
piygg-disko-images> Label:
piygg-disko-images> Version: 1.3: rebalance_work
piygg-disko-images> Version upgrade complete: 0.0: (unknown version)
piygg-disko-images> Oldest version on disk: 1.3: rebalance_work
piygg-disko-images> Created: Tue Dec 12 14:04:31 2023
piygg-disko-images> Sequence number: 0
piygg-disko-images> Superblock size: 952
piygg-disko-images> Clean: 0
piygg-disko-images> Devices: 1
piygg-disko-images> Sections: members_v1,members_v2
piygg-disko-images> Features: new_siphash,new_extent_overwrite,btree_ptr_v2,extents_above_btree_updates,btree_updates_journalled,new_varint,journal_no_flush,alloc_v2,extents_across_btree_nodes
piygg-disko-images> Compat features:
piygg-disko-images> Options:
piygg-disko-images> block_size: 512 B
piygg-disko-images> btree_node_size: 128 KiB
piygg-disko-images> errors: continue [ro] panic
piygg-disko-images> metadata_replicas: 1
piygg-disko-images> data_replicas: 1
piygg-disko-images> metadata_replicas_required: 1
piygg-disko-images> data_replicas_required: 1
piygg-disko-images> encoded_extent_max: 64.0 KiB
piygg-disko-images> metadata_checksum: none [crc32c] crc64 xxhash
piygg-disko-images> data_checksum: none [crc32c] crc64 xxhash
piygg-disko-images> compression: none
piygg-disko-images> background_compression: none
piygg-disko-images> str_hash: crc32c crc64 [siphash]
piygg-disko-images> metadata_target: none
piygg-disko-images> foreground_target: none
piygg-disko-images> background_target: none
piygg-disko-images> promote_target: none
piygg-disko-images> erasure_code: 0
piygg-disko-images> inodes_32bit: 1
piygg-disko-images> shard_inode_numbers: 1
piygg-disko-images> inodes_use_key_cache: 1
piygg-disko-images> gc_reserve_percent: 8
piygg-disko-images> gc_reserve_bytes: 0 B
piygg-disko-images> root_reserve_percent: 0
piygg-disko-images> wide_macs: 0
piygg-disko-images> acl: 1
piygg-disko-images> usrquota: 0
piygg-disko-images> grpquota: 0
piygg-disko-images> prjquota: 0
piygg-disko-images> journal_flush_delay: 1000
piygg-disko-images> journal_flush_disabled: 0
piygg-disko-images> journal_reclaim_delay: 100
piygg-disko-images> journal_transaction_names: 1
piygg-disko-images> version_upgrade: [compatible] incompatible none
piygg-disko-images> nocow: 0
piygg-disko-images> members_v2 (size 136):
piygg-disko-images> Device: 0
piygg-disko-images> Label: (none)
piygg-disko-images> UUID: 3caad0c2-aef6-4d83-bba1-afec70665520
piygg-disko-images> Size: 1.51 GiB
piygg-disko-images> read errors: 0
piygg-disko-images> write errors: 0
piygg-disko-images> checksum errors: 0
piygg-disko-images> seqread iops: 0
piygg-disko-images> seqwrite iops: 0
piygg-disko-images> randread iops: 0
piygg-disko-images> randwrite iops: 0
piygg-disko-images> Bucket size: 128 KiB
piygg-disko-images> First bucket: 0
piygg-disko-images> Buckets: 12368
piygg-disko-images> Last mount: (never)
piygg-disko-images> State: rw
piygg-disko-images> Data allowed: journal,btree,user
piygg-disko-images> Has data: (none)
piygg-disko-images> Discard: 0
piygg-disko-images> Freespace initialized: 0
piygg-disko-images> mounting version 1.3: rebalance_work
piygg-disko-images> initializing new filesystem
piygg-disko-images> going read-write
piygg-disko-images> initializing freespace
piygg-disko-images> + set -efux
piygg-disko-images> + device=/dev/vda
piygg-disko-images> + imageSize=2G
piygg-disko-images> + name=vdb
piygg-disko-images> + type=disk
piygg-disko-images> + device=/dev/vda
piygg-disko-images> + type=gpt
piygg-disko-images> + device=/dev/vda
piygg-disko-images> + imageSize=2G
piygg-disko-images> + name=vdb
piygg-disko-images> + type=disk
piygg-disko-images> + device=/dev/vda
piygg-disko-images> + type=gpt
piygg-disko-images> + device=/dev/disk/by-partlabel/disk-vdb-root
piygg-disko-images> + extraArgs=()
piygg-disko-images> + declare -a extraArgs
piygg-disko-images> + format=bcachefs
piygg-disko-images> + mountOptions=('defaults')
piygg-disko-images> + declare -a mountOptions
piygg-disko-images> + mountpoint=/
piygg-disko-images> + type=filesystem
piygg-disko-images> + findmnt /dev/disk/by-partlabel/disk-vdb-root /mnt/
piygg-disko-images> + mount /dev/disk/by-partlabel/disk-vdb-root /mnt/ -t bcachefs -o defaults -o X-mount.mkdir
piygg-disko-images> mount: /mnt/: unknown filesystem type 'bcachefs'.
piygg-disko-images> dmesg(1) may have more information after failed mount system call.
piygg-disko-images> + rm -rf /tmp/tmp.CPiB2fD5zZ
piygg-disko-images> [ 8.433749] reboot: Power down
| 14:07:31 |
matthewcroughan | so close :D | 14:08:41 |
matthewcroughan | /nix/store/r3xam6azp7zcd8a2ybwqdnqv0iliggl1-disk-deactivate/disk-deactivate exists on the host's nix, but I guess it's not available inside of this derivation? | 14:09:27 |
matthewcroughan | Ah yes here it is https://github.com/nix-community/disko/blob/f84c3684900d11cf19f530070d32d55f0ed51374/lib/make-disk-image.nix#L53 | 14:12:14 |
matthewcroughan | maybe the diskoScript needs to be present in this closureInfo call | 14:12:29 |
matthewcroughan | Oh.. this test https://github.com/nix-community/disko/blob/master/tests/make-disk-image.nix isn't pure | 14:18:28 |
matthewcroughan | * Oh.. this test https://github.com/nix-community/disko/blob/master/tests/make-disk-image.nix isn't pure ? | 14:18:33 |
matthewcroughan | all tests work outside of the nix derivation sandbox | 14:23:15 |
matthewcroughan | iygg-disko-images> + set -efux
piygg-disko-images> + device=/dev/vda
piygg-disko-images> + imageSize=2G
| 14:54:27 |