!PSmBFWNKoXmlQBzUQf:helsinki-systems.de

Stage 1 systemd

83 Members
systemd in NixOs's stage 1, replacing the current bash tooling https://github.com/NixOS/nixpkgs/projects/5127 Servers

Load older messages


SenderMessageTime
5 May 2023
@uep:matrix.org@uep:matrix.orgwell, the "init system" part of systemd is22:36:18
@uep:matrix.org@uep:matrix.orgSo, like, yeah... decouple away22:36:37
@uep:matrix.org@uep:matrix.orgAt 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@mberndt:matrix.orgHey, 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.nix16:00:30
@mberndt:matrix.org@mberndt:matrix.orgBut 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 volume16:02:19
@mberndt:matrix.org@mberndt:matrix.orgHow can he boot from a volume that doensn't have anything in it? 16:03:15
@mberndt:matrix.org@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 volume16:03:32
@mberndt:matrix.org@mberndt:matrix.org * How can it boot from a volume that doesn't have anything in it? 16:04:51
@elvishjerricco:matrix.org@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@mberndt:matrix.orgoh wow16:06:42
@elvishjerricco:matrix.org@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@mberndt:matrix.orgthat's clever16:06:48
@mberndt:matrix.org@mberndt:matrix.orgAnd so the nix store is already mounted in the initramfs?16:07:37
@elvishjerricco:matrix.org@elvishjerricco:matrix.orgyea16:07:46
@elvishjerricco:matrix.org@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@elvishjerricco:matrix.org I think probably precisely because it's not doing what I just described :P 16:11:28
@elvishjerricco:matrix.org@elvishjerricco:matrix.org As of recently, useBootLoader implies actually creating a root fs image containing the nix store 16:11:47
@mberndt:matrix.org@mberndt:matrix.orgthere goes my plan16:12:24
@elvishjerricco:matrix.org@elvishjerricco:matrix.orglet 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 fix16:13:13
@mberndt:matrix.org@mberndt:matrix.orgBut 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
@elvishjerricco:matrix.org@elvishjerricco:matrix.org mberndt: You might want to make a variant of the nixos installer test then 16:15:51
@elvishjerricco:matrix.org@elvishjerricco:matrix.orglook at `installer.nix16:15:54
@elvishjerricco:matrix.org@elvishjerricco:matrix.org * look at `installer.nix` 16:15:55
@elvishjerricco:matrix.org@elvishjerricco:matrix.org * look at installer.nix 16:15:58
@elvishjerricco:matrix.org@elvishjerricco:matrix.orgactually that's better for a bunch of reasons16:16:11
@elvishjerricco:matrix.org@elvishjerricco:matrix.orgtesting actually installing nixos is way more comprehensive16:16:23
@mberndt:matrix.org@mberndt:matrix.orgThanks, I'll have a look16:16:29
@mberndt:matrix.org@mberndt:matrix.orgWhoa, that's more than 1k lines16:16:49
@elvishjerricco:matrix.org@elvishjerricco:matrix.org

fwiw, this does fix the lvm2 test:

diff --git a/nixos/tests/lvm2/systemd-stage-1.nix b/nixos/tests/lvm2/systemd-stage-1.nix
index b711cd22d7f..05f0e6eb76e 100644
--- a/nixos/tests/lvm2/systemd-stage-1.nix
+++ b/nixos/tests/lvm2/systemd-stage-1.nix
@@ -64,6 +64,7 @@ in import ../make-test-python.nix ({ pkgs, ... }: {
     virtualisation = {
       emptyDiskImages = [ 8192 8192 ];
       useBootLoader = true;
+      mountHostNixStore = true;
       useEFIBoot = true;
     };
     boot.loader.systemd-boot.enable = true;
16:16:57
@elvishjerricco:matrix.org@elvishjerricco:matrix.org
In reply to @mberndt:matrix.org
Whoa, that's more than 1k lines
yea well it's actually a bunch of tests in one
16:17:07

Show newer messages


Back to Room ListRoom Version: 6