!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
14 Aug 2022
@grahamc:nixos.org@grahamc:nixos.org At this point I can make, upload, and boot an AMI in ~30s, making the most drastically slow step terminating the instance. 00:35:38
@elvishjerricco:matrix.org@elvishjerricco:matrix.orgI would love to know more about that, though tonight is a night for things-that-aren't-that :P00:36:32
@grahamc:nixos.org@grahamc:nixos.orgI’m going to bed in a few minutes, and it skips stage-1 anyway … :)00:37:00
@elvishjerricco:matrix.org@elvishjerricco:matrix.org Y'know, over time, I've stumbled over various little tidbits that make me think we're handling file systems in initrd slightly wrong. And in particular, I've been trying to figure out why I don't have After=local-fs-pre.target on initrd file systems since not having that can fuck with hibernation resumption, and I found this: https://github.com/systemd/systemd/blob/3f504b892b92f54087feeb3fb35e3938567d7fa0/src/core/mount.c#L482-L484 03:25:05
@elvishjerricco:matrix.org@elvishjerricco:matrix.org I think we're really meant to be using initrd-fs.target the way we've been using local-fs.target 03:25:59
@elvishjerricco:matrix.org@elvishjerricco:matrix.org the problem is that we can't use /etc/fstab to find x-initrd.mount file systems until we've run activation 03:27:02
@elvishjerricco:matrix.org@elvishjerricco:matrix.org Oh holy shit. You can just put fstab in /sysroot/etc/fstab instead of in /etc/fstab as long as you ad x-initrd.mount, and then you don't need all the /sysroot prefix stuff in the fstab stuff, and I bet the initrd dependencies work a bit better 05:39:18
@elvishjerricco:matrix.org@elvishjerricco:matrix.org * Oh holy shit. You can just put fstab in /sysroot/etc/fstab instead of in /etc/fstab in the initrd image as long as you ad x-initrd.mount, and then you don't need all the /sysroot prefix stuff in the fstab stuff, and I bet the initrd dependencies work a bit better 05:39:37
@elvishjerricco:matrix.org@elvishjerricco:matrix.org * Oh holy shit. You can just put fstab in /sysroot/etc/fstab instead of in /etc/fstab in the initrd image as long as you add x-initrd.mount, and then you don't need all the /sysroot prefix stuff in the fstab stuff, and I bet the initrd dependencies work a bit better 05:39:46
@elvishjerricco:matrix.org@elvishjerricco:matrix.org Thank you systemd-fstab-generator for not sanity checking if it makes sense to look at /sysroot/etc/fstab yet... 05:41:04
@winterqt:nixos.devWinter (she/her)is it safe to rely on that though06:01:24
@elvishjerricco:matrix.org@elvishjerricco:matrix.orgI think so06:23:09
@elvishjerricco:matrix.org@elvishjerricco:matrix.org fstab-generator.c just has a bit of code that basically says "if we're in initrd then go ahead and parse /sysroot/etc/fstab too, with the whole /sysroot thing added in" 06:25:04
@winterqt:nixos.devWinter (she/her)yeah, but what do you mean by the sanity check comment?06:25:35
@winterqt:nixos.devWinter (she/her)if that behavior is explicit06:25:38
@elvishjerricco:matrix.org@elvishjerricco:matrix.orgmore of a joke06:25:43
@elvishjerricco:matrix.org@elvishjerricco:matrix.org If you think about it for longer than 2 millisecond, it doesn't really make sense to check /sysroot/etc/fstab when /sysroot hasn't been mounted yet 06:26:06
@elvishjerricco:matrix.org@elvishjerricco:matrix.org * If you think about it for longer than 2 milliseconds, it doesn't really make sense to check /sysroot/etc/fstab when /sysroot hasn't been mounted yet 06:26:12
@elvishjerricco:matrix.org@elvishjerricco:matrix.orgbut it's also harmless and writing code against it would be pointless06:26:28
@winterqt:nixos.devWinter (she/her)but if the /sysroot behavior is explicit, why wouldn't they mount it before06:26:55
@winterqt:nixos.devWinter (she/her)i guess i should look at the code06:27:04
@elvishjerricco:matrix.org@elvishjerricco:matrix.org Winter (she/her): Oh they do 06:27:06
@elvishjerricco:matrix.org@elvishjerricco:matrix.orggenerators are run twice in initrd06:27:13
@elvishjerricco:matrix.org@elvishjerricco:matrix.orgonce before /sysroot is mounted just to get the ball rolling, i.e. parsing /etc/fstab and /proc/cmdline (for root=)06:27:37
@elvishjerricco:matrix.org@elvishjerricco:matrix.org and once after to check the real root's /etc/fstab for mounts with x-initrd.mount 06:27:51
@elvishjerricco:matrix.org@elvishjerricco:matrix.org (really they don't expect you to use /etc/fstab in initrd; they expect you to tell it where root and /usr are with the cmdline; then they expect all other initrd file systems to come from /sysroot/etc/fstab with x-initrd.mount) 06:28:52
@elvishjerricco:matrix.org@elvishjerricco:matrix.org(which, btw, means systemd technically doesn't want you to have /etc on a file system other than your rootfs)06:29:16
@k900:0upti.meK900 Arguably they don't want you to have an fstab at all\ 06:29:50
@k900:0upti.meK900 * Arguably they don't want you to have an fstab at all06:29:52
@elvishjerricco:matrix.org@elvishjerricco:matrix.orgyea well that's a whole other thing :P06:30:02

Show newer messages


Back to Room ListRoom Version: 6