!PSmBFWNKoXmlQBzUQf:helsinki-systems.de

Stage 1 systemd

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

Load older messages


SenderMessageTime
20 Mar 2022
@bobvanderlinden_:matrix.orgbobvanderlindenwhile I was struggling I thought I might've take the oppurtinity to create a test for the emergency shell 😅17:26:46
@janne.hess:helsinki-systems.de@janne.hess:helsinki-systems.demaybe we can use an installer test that boots with the old initrd and installs a system with the new one?17:26:49
@elvishjerricco:matrix.org@elvishjerricco:matrix.orgThat'll also require adding file system packages to stage 1's environment. The old PR had some code for this that you should look at17:27:03
@janne.hess:helsinki-systems.de@janne.hess:helsinki-systems.de
In reply to @bobvanderlinden_:matrix.org
while I was struggling I thought I might've take the oppurtinity to create a test for the emergency shell 😅
I have a really horrible solution but I think we should come up with something in the test runner that allows us to interact with qemu's stdin
17:27:53
@janne.hess:helsinki-systems.de@janne.hess:helsinki-systems.deOr it may be easier to spawn backdoor.service in stage 1 🤔17:28:44
@elvishjerricco:matrix.org@elvishjerricco:matrix.orghttps://github.com/ElvishJerricco/nixpkgs/blob/78d09d5d9eea1259f96b366d640ccbfb5983e6c2/nixos/modules/tasks/filesystems.nix#L129 https://github.com/ElvishJerricco/nixpkgs/blob/78d09d5d9eea1259f96b366d640ccbfb5983e6c2/nixos/modules/tasks/filesystems.nix#L320 This was the stuff from the old PR that made growfs and makefs work automatically17:30:19
@elvishjerricco:matrix.org@elvishjerricco:matrix.orgIt's just a couple fstab options and adding fsPackages to PATH for the right unit17:30:43
@bobvanderlinden_:matrix.orgbobvanderlindenHmyea, I added x-systemd.makefs and x-systemd.growfs to fstab's root, but that didn't work. It seems it didn't attempt to run them yet.17:32:46
@elvishjerricco:matrix.org@elvishjerricco:matrix.orgYou'll need the fsPackages is probably why17:33:03
@elvishjerricco:matrix.org@elvishjerricco:matrix.org(though we ought to filter fsPackages down to only the ones needed for the stage 1 file systems, and the ones that systemd actually supports)17:33:35
@elvishjerricco:matrix.org@elvishjerricco:matrix.orgOh and note the comment on IgnoreOnIsolate in that second link17:34:09
@elvishjerricco:matrix.org@elvishjerricco:matrix.org That'll be tricky to fix because these units are generated by a systemd generator, so they exist in /run and take precedence over unit files in /etc. With the old crappy code, I could just explicitly use unitOverrides to place it in systemd-makefs@.service.d/mke2fs.conf, which does still get applied over the /run/ unit. But the generateUnits code we use now doesn't have a way to say "put this in an override, even if the unit file doesn't exist" 17:36:12
@elvishjerricco:matrix.org@elvishjerricco:matrix.org I think I fixed a similar issue in the old PR in stage 2 by adding a dummy package to systemd.packages with an empty unit file, then using the systemd options to set overrides on that unit. The dummy got shadowed by the generated /run unit, but the override file got applied on top anyway. Super jank :P 17:37:29
@bobvanderlinden_:matrix.orgbobvanderlindenare you sure generateUnits doesn't create an override for upstream service files?17:39:36
@bobvanderlinden_:matrix.orgbobvanderlinden(for dynamic mounts, yes, you're right)17:39:59
@elvishjerricco:matrix.org@elvishjerricco:matrix.org bobvanderlinden: It does, but that's not the problem 17:41:08
@elvishjerricco:matrix.org@elvishjerricco:matrix.org systemd-makefs@.service doesn't exist in the units actually stored in /etc. It's only a generated unit, created by systemd-fstab-generator 17:41:52
@elvishjerricco:matrix.org@elvishjerricco:matrix.org So when you try to make the unit yourself, generateUnits will be like "Oh, that unit doesn't exist at all. I'll just make a regular unit then, not an override" 17:42:22
@elvishjerricco:matrix.org@elvishjerricco:matrix.organd then that regular unit will get shadowed by the /run unit from the generator17:42:42
@bobvanderlinden_:matrix.orgbobvanderlindenhmm, right17:42:49
@elvishjerricco:matrix.org@elvishjerricco:matrix.orgThis is why I didn't immediately fix the issue myself :P I wasn't sure of a clean solution17:43:32
@elvishjerricco:matrix.org@elvishjerricco:matrix.orgBut I'd be very happy to include it in this PR, as being able to boot one of these VMs, or have a NixOS test, is pretty core functionality IMO17:43:59
@bobvanderlinden_:matrix.orgbobvanderlinden it doesn't really need to override systemd-makefs@.service if the needed binaries are just here in sytemd's path 'globally'? 17:44:57
@elvishjerricco:matrix.org@elvishjerricco:matrix.orgI suppose that's true.17:45:16
@elvishjerricco:matrix.org@elvishjerricco:matrix.orgWe could like... add /bin to every unit's PATH somehow17:45:28
@elvishjerricco:matrix.org@elvishjerricco:matrix.orgnot sure how to make that work for these generated /run units17:45:36
@bobvanderlinden_:matrix.orgbobvanderlindenin systemd.conf you can define the PATH17:45:58
@elvishjerricco:matrix.org@elvishjerricco:matrix.orgOhh17:46:02
@elvishjerricco:matrix.org@elvishjerricco:matrix.orgthat's good17:46:05
@elvishjerricco:matrix.org@elvishjerricco:matrix.orgProbably very much worth it17:46:12

There are no newer messages yet.


Back to Room ListRoom Version: 6