5 May 2023 |
@nikstur:matrix.org | * But maybe if we teach the systemd tools the locations of the files (like /etc/os-release , repart definitions etc.) it expects in the nix store, don't we get close enough? | 21:36:25 |
@elvishjerricco:matrix.org | nikstur: Thing is, that's not a whole lot different than just... putting those files in the initrd, from a practical perspective | 21:50:42 |
@nikstur:matrix.org | Right right right. I think I was a little (very) slow on this. Let me think about it a little more... | 21:56:40 |
@elvishjerricco:matrix.org | I do kinda wonder if we should be trying to reduce the fsNeededForBoot space. Like, a lot of the problem is that systemd wishes that all you needed in initrd was / and /usr, while in nixos we have a whole list of mountpoints that need to be there | 21:59:51 |
@elvishjerricco:matrix.org | How much of that stuff is actually needed though? Like I think the main reason we need /var/lib is because of the users-groups stuff we do in activation. But shouldn't that stuff really be handled at the same level as systemd-sysroot ? i.e. during ordinary stage 2 systemd units? | 22:00:48 |
@elvishjerricco:matrix.org | (In fact, that's a good example because we already have a PR to change part of that one: https://github.com/NixOS/nixpkgs/pull/223932/files/034ae4044941f507dcabd5f20753d6c786f925b6..31361e90bc151eba286ffcdafdaed89df7c77de6?notification_referrer_id=NT_kwDOABTWvLI2MDE5MzMyOTc4OjEzNjU2OTI¬ifications_query=is%3Aunread) | 22:01:15 |
@elvishjerricco:matrix.org | * (In fact, that's a good example because we already have a PR to change part of that one: ) | 22:01:20 |
@elvishjerricco:matrix.org | * (In fact, that's a good example because we already have a PR to change part of that one: https://github.com/NixOS/nixpkgs/pull/223932) | 22:01:33 |
@elvishjerricco:matrix.org | * How much of that stuff is actually needed though? Like I think the main reason we need /var/lib is because of the users-groups stuff we do in activation. But shouldn't that stuff really be handled at the same level as systemd-sysusers ? i.e. during ordinary stage 2 systemd units? | 22:03:02 |
@uep:matrix.org | Systemd is all about unbundling serial things (ball of script) into separate items with finer-grain dependency graphs | 22:36:10 |
@uep:matrix.org | well, the "init system" part of systemd is | 22:36:18 |
@uep:matrix.org | So, like, yeah... decouple away | 22:36:37 |
@uep:matrix.org | At some point in this process, perhaps here where things potentially change between stage 1 and 2, we hit coupling and compatibility issues with a stage 2 that needs to work with scripted stage 1 still? | 22:38:39 |
6 May 2023 |
@mberndt:matrix.org | Hey, so I was looking into making a test for the stratis root fs support that I'm trying to get merged, and I figured that the easiest way to do that is to tweak the lvm2 test that already exists.
https://github.com/NixOS/nixpkgs/blob/master/nixos/tests/lvm2/systemd-stage-1.nix | 16:00:30 |
@mberndt:matrix.org | But I' confused, because it looks like a logical volume is created in line 90, and then a single file is created in that volume, and then he reboot into that volume | 16:02:19 |
@mberndt:matrix.org | How can he boot from a volume that doensn't have anything in it? | 16:03:15 |
@mberndt:matrix.org | * But I' confused, because it looks like a logical volume is created in line 90, and then a single file is created in that volume, and then it reboots into that volume | 16:03:32 |
@mberndt:matrix.org | * How can it boot from a volume that doesn't have anything in it? | 16:04:51 |
@elvishjerricco:matrix.org | mberndt: The root fs in nixos tests usually doesn't contain the OS. Instead, /nix/store is mounted as a 9p network file system from the host, so that the VM uses the host nix store instead of wasting time and space on a disk image | 16:06:00 |
@mberndt:matrix.org | oh wow | 16:06:42 |
@elvishjerricco:matrix.org | (that's only mostly true; in reality it's usually actually an overlay fs where the lower dir is the 9p file system and the upper dir is in ram or something) | 16:06:44 |
@mberndt:matrix.org | that's clever | 16:06:48 |
@mberndt:matrix.org | And so the nix store is already mounted in the initramfs? | 16:07:37 |
@elvishjerricco:matrix.org | yea | 16:07:46 |
@elvishjerricco:matrix.org | mberndt: Actually, it looks like that lvm test is currently failing https://hydra.nixos.org/job/nixos/trunk-combined/nixos.tests.lvm2.lvm-thinpool-sd-stage-1-linux-latest.x86_64-linux | 16:11:18 |
@elvishjerricco:matrix.org | I think probably precisely because it's not doing what I just described :P | 16:11:28 |
@elvishjerricco:matrix.org | As of recently, useBootLoader implies actually creating a root fs image containing the nix store | 16:11:47 |
@mberndt:matrix.org | there goes my plan | 16:12:24 |
@elvishjerricco:matrix.org | let me see if the easy fix for this was implemented... I talked about it with the person who made that change a little while ago but I don't remember if he implemented the fix | 16:13:13 |
@mberndt:matrix.org | But actually I was thinking that this might not be the best way to test this anyway. After all, what is happening here is that we boot the machine, then set up an lvm2 volume, and then reboot into that. Instead of doing that, maybe it's better to hook into the logic that creates the Qemu VM so that it sets it up with a stratis volume (rather than a GPT partition) to begin with. | 16:15:21 |