| 2 May 2023 |
@elvishjerricco:matrix.org | oh but that does expect the root partition to at least exist already | 21:30:24 |
@elvishjerricco:matrix.org | so nevermind | 21:30:27 |
@elvishjerricco:matrix.org | Arian: Anyway, I think the only other thing we could really do besides a boot.initrd.repart.device option would be to repurpose /sysusr for /nix/store (which is kind of morally correct anyway tbh), and and pull the system's toplevel store path from the init= parameter like we doinnixos-activation.servicein order to find repart definitions. The big advantage here is that the root device would be derived from the backing device of/sysusr/usr(which we would hack up to be derived from/sysusr/nix/store), so that we don't need an explicit device to be set. But that does mean your /nix/store` has to be on a partition on your root disk, and can't be something fancy like a 9p file system or something | 21:36:37 |
@elvishjerricco:matrix.org | * Arian: Anyway, I think the only other thing we could really do besides a boot.initrd.repart.device option would be to repurpose /sysusr for /nix/store (which is kind of morally correct anyway tbh), and and pull the system's toplevel store path from the init= parameter like we do innixos-activation.servicein order to find repart definitions. The big advantage here is that the root device would be derived from the backing device of/sysusr/usr(which we would hack up to be derived from/sysusr/nix/store), so that we don't need an explicit device to be set. But that does mean your /nix/store\ has to be on a partition on your root disk, and can't be something fancy like a 9p file system or something | 21:37:01 |
@elvishjerricco:matrix.org | * Arian: Anyway, I think the only other thing we could really do besides a boot.initrd.repart.device option would be to repurpose /sysusr for /nix/store (which is kind of morally correct anyway tbh), and and pull the system's toplevel store path from the init= parameter like we do innixos-activation.servicein order to find repart definitions. The big advantage here is that the root device would be derived from the backing device of/sysusr/usr(which we would hack up to be derived from/sysusr/nix/store), so that we don't need an explicit device to be set. But that does mean your /nix/store has to be on a partition on your root disk, and can't be something fancy like a 9p file system or something | 21:37:11 |
Arian | if only we replaced /nix/store with /usr/store | 21:37:28 |
Arian | dreams | 21:37:31 |
@elvishjerricco:matrix.org | yea... | 21:37:38 |
@elvishjerricco:matrix.org | So I dunno which of those two things to do. boot.initrd.repart.device, or /sysusr/nix/store + "your store has to be on your root disk" | 21:38:43 |
@elvishjerricco:matrix.org | I'm leaning towards the former personally | 21:39:53 |
@elvishjerricco:matrix.org | oh the other thing is that something like boot.initrd.repart.device is only needed if the root partition doesn't already exist. | 21:42:10 |
@elvishjerricco:matrix.org | If it does, we really can just wait for /sysroot to be mounted and let it get the backing device from that itself (though, unless we wait for nixos-activation.service, we do still have to find a way to point it at the right definitions files) | 21:43:24 |
@elvishjerricco:matrix.org | Every time I think about this problem I just confuse myself more and more with all the possibilities and all the problems... | 21:44:02 |
Arian | how about we upstream a commit to systemd to support kernel param rd.repart.device=/dev/vda | 21:45:39 |
Arian | if it's not set it checks for /sysroot | 21:45:59 |
Arian | otherwise it uses rd.repart.device | 21:46:06 |
Arian | oh wait that doesn't help | 21:46:32 |
@elvishjerricco:matrix.org | yea I was about to ask :P | 21:47:23 |
@elvishjerricco:matrix.org | (of course, that would be sane anyway; just doesn't help our issues) | 21:47:45 |
Arian | i still dont fully understand how this works upstream | 21:48:55 |
Arian | because systemd-repart runs before sysroot is mounted | 21:49:04 |
Arian | not after | 21:49:08 |
Arian | so how does it know the device of /sysroot? | 21:49:19 |
@elvishjerricco:matrix.org | Well, it can. It can work either way. | 21:49:45 |
Arian | https://github.com/systemd/systemd/blob/main/units/systemd-repart.service.in#L17 | 21:50:03 |
@elvishjerricco:matrix.org | If you don't have a separate /usr partition, then IIRC initrd-usr-fs.target isn't reached until /sysroot is mounted | 21:50:04 |
Arian | aaah | 21:50:12 |
Arian | I see | 21:50:15 |
Arian | and they assume /usr and / on same disk so works out | 21:50:44 |
@elvishjerricco:matrix.org | right | 21:51:20 |