| 24 Mar 2022 |
@janne.hess:helsinki-systems.de | In reply to @elvishjerricco:matrix.org systemd just mounts /proc, /dev, etc. automatically when it starts Hm. So it mounts a new tmpfs over /run? | 17:29:07 |
@elvishjerricco:matrix.org | Hmm I seem to recall it moving /run correctly now that you mention it, but it's been a while since I played with that | 17:29:41 |
@elvishjerricco:matrix.org | maybe it does move them with switch-root or something? Not sure | 17:29:59 |
flokli | https://www.freedesktop.org/software/systemd/man/bootup.html | 17:30:46 |
@elvishjerricco:matrix.org | The service initrd-parse-etc.service scans /sysroot/etc/fstab for a possible /usr/ mount point and additional entries marked with the x-initrd.mount option. All entries found are mounted below /sysroot, and initrd-fs.target is reached | 17:33:45 |
@elvishjerricco:matrix.org | Ah, we should probably use that | 17:33:48 |
flokli | https://systemd.io/INITRD_INTERFACE/ also mentions also pivoting back to initrd on shutdown, to clean up storage stuff necessary for / | 17:34:10 |
@elvishjerricco:matrix.org | Then we'd only need to have / and /etc in initrd, and the rest can be in the real rootfs's /etc/fstab with x-initrd.mount | 17:34:37 |
@elvishjerricco:matrix.org | The shutdown pivoting stuff is a whole other thing, and somewhat annoying to implement | 17:35:02 |
@janne.hess:helsinki-systems.de | In reply to @flokli:matrix.org https://systemd.io/INITRD_INTERFACE/ also mentions also pivoting back to initrd on shutdown, to clean up storage stuff necessary for / I wanted to test that later 👀 | 17:35:08 |
@elvishjerricco:matrix.org | We definitely should; e.g. we could properly export the root zfs pool that way instead of the dumb hack we do now | 17:35:24 |
flokli | ElvishJerricco: Maybe we can address some of the minor style nits in the open PR, put enabling it behind a fat lib.warn that this is all still experimental, and merge it? | 17:35:44 |
flokli | I assume some of the followup stuff can be done in parallel | 17:35:53 |
@elvishjerricco:matrix.org | Yea | 17:35:53 |
@elvishjerricco:matrix.org | that's what I was hoping for | 17:36:03 |
@elvishjerricco:matrix.org | Just haven't gotten around to the remaining nits yet | 17:36:20 |
flokli | Okay :-) | 17:36:25 |
@elvishjerricco:matrix.org | Y'all are free to take a stab at those if you want :) | 17:36:29 |
flokli | I don't want to race with you on it | 17:36:40 |
flokli | I might eat some dinner soon, but will check back later | 17:36:45 |
@elvishjerricco:matrix.org | I don't have any unpunished progress, and I'm not going to be able to work on this stuff today at all most likely | 17:36:58 |
@elvishjerricco:matrix.org | * I don't have any unpushed progress, and I'm not going to be able to work on this stuff today at all most likely | 17:37:03 |
@elvishjerricco:matrix.org | oh wow "unpunished != unpushed", what a terrible autocorrect | 17:37:23 |
@elvishjerricco:matrix.org | Actually, if we rely on the real /etc to find all the other mounts via x-initrd.mount, then initrd has to be aware of the full path to /etc, which means either putting it on the kernel cmdline or baking it into the initrd and requiring way too many initrd's in /boot. So maybe we don't want this... Then again if we did put it on the cmdline, we'd be able to have fewer initrds because it wouldn't change whenever the fs'es needed in stage 1 changes... | 17:41:50 |
@arianvp:matrix.org | Currently we rebuild the initrd everytime fstab changes right? | 17:44:24 |
@elvishjerricco:matrix.org | Don't think so | 17:44:40 |
@arianvp:matrix.org | As we don't actually paarse /etc/fstab but just build from the fileSystems options | 17:44:48 |
@arianvp:matrix.org | Oh . Ok in that case maybe makes sense to keep that yeh | 17:45:00 |
@elvishjerricco:matrix.org | In the real rootfs, fstab is generated from fileSystems, but we still let systemd-fstab-generator work via fstab. In the old initrd, we have bash-isms for mounting the list of fs'es needed for boot. In the new initrd, we do the same as stage 2, and generate an fstab so that at runtime systemd-fstab-generator will do the work | 17:46:11 |
@elvishjerricco:matrix.org | So in old and new, initrd is only rebuilt whenever the fs'es needed for boot change; and in the new initrd that's because we make a new fstab for it | 17:46:53 |