4 Oct 2024 |
ElvishJerricco | well of course not | 03:19:13 |
ElvishJerricco | it's ordered before sysroot.mount | 03:19:17 |
ElvishJerricco | oh | 03:19:19 |
ElvishJerricco | no it makes the mounts | 03:19:21 |
ElvishJerricco | and then unmounts them | 03:19:27 |
mjm | it mounts the persistent FS in a temp dir | 03:19:32 |
mjm | then creates the directories the bind mounts will be mounting from | 03:19:43 |
mjm | and then unmounts it | 03:19:46 |
ElvishJerricco | yea I'm pretty sure you just don't need to do that in systemd initrd | 03:19:58 |
ElvishJerricco | I have a feeling they made this for scripted initrd and assumed it needed a systemd initrd implementation | 03:20:12 |
mjm | maybe? | 03:20:19 |
mjm | it's not clear to me, if you have a bind mount from /persist/foo to /foo , it makes sense to me that systemd will ensure /foo exists before mounting. but will it create /persist/foo ? | 03:20:58 |
mjm | because that's what this is doing | 03:21:03 |
mjm | it would be reasonable for systemd to assume it already exists imo | 03:21:28 |
ElvishJerricco | oh | 03:21:31 |
ElvishJerricco | yea | 03:21:32 |
ElvishJerricco | that does make sense | 03:21:35 |
ElvishJerricco | I mean I don't think that's how I'd do it | 03:21:46 |
mjm | and this is solving a pretty edge case in impermanence i think | 03:21:48 |
ElvishJerricco | but sure | 03:21:49 |
mjm | idk how i'd do it | 03:22:14 |
mjm | i think this wouldn't be an issue for LUKS, since the decrypted FS has its own device and would show up separately from the encrypted one | 03:23:26 |
ElvishJerricco | My first thought was to make a service for the directory you want to make that has RequiresMountsFor=/sysroot/persist/whatever and Before=/sysroot/bind/whatever that does the mkdir | 03:23:56 |
ElvishJerricco | that way you don't have to make these assumptions they're making | 03:25:12 |
mjm | yeah it's weird to me that they would mount it somewhere temporary instead of just introducing a service after /persist or whatever mounts and before the bind mounts | 03:26:23 |
mjm | https://github.com/nix-community/impermanence/issues/222 if you feel like chiming in | 03:27:27 |
ElvishJerricco | mjm: I mean frankly I think the problem that the service is trying to solve is a silly one | 03:28:47 |
ElvishJerricco | like yes, you should make your directories | 03:28:54 |
ElvishJerricco | it's weird that impermanence has to automated it for you | 03:29:07 |
mjm | yeah, i think maybe it enables bootstrapping a system with impermanence from the get-go? idk i saw mention of nixos-anywhere in the PR that introduced it | 03:29:36 |