!PSmBFWNKoXmlQBzUQf:helsinki-systems.de

Stage 1 systemd

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

Load older messages


SenderMessageTime
2 May 2023
@elvishjerricco:matrix.org@elvishjerricco:matrix.org * But that's super lame because we don't need to do that for boot.growPartition, which I was hoping to implement in systemd-initrd via repart 21:24:14
@elvishjerricco:matrix.org@elvishjerricco:matrix.org but growPartition just assumes you've set fileSystems."/".device to something with a number at the end that can be dropped to get to the disk 21:24:49
@arianvp:matrix.orgArianwell we can still implement that as a compatibiliy hack?21:25:31
@elvishjerricco:matrix.org@elvishjerricco:matrix.org Yea I guess we can move the number-dropping logic out of shell script and into nix code and set boot.initrd.systemd.repart.device with that 21:26:05
@arianvp:matrix.orgArianexactly21:26:17
@arianvp:matrix.orgArian

having nixos-install call systemd-repart would be nice too.

have nixos-install --flake github:arianvp#mymachine just work would be kinda magical

21:26:54
@elvishjerricco:matrix.org@elvishjerricco:matrix.orgoh that's a cool idea21:27:22
@arianvp:matrix.orgArianI now do this: https://github.com/arianvp/nixos-stuff/blob/master/configs/utm/install.sh21:27:45
@elvishjerricco:matrix.org@elvishjerricco:matrix.orgSo one slightly crazier idea than parsing device file names with nix would be to go nuts with udev21:29:05
@elvishjerricco:matrix.org@elvishjerricco:matrix.org i.e. set up a udev rule that waits for fileSystems."/".device and creates a /dev/repart-actual-root-node symlink that points to the parent-most device of that device 21:30:00
@elvishjerricco:matrix.org@elvishjerricco:matrix.orgoh but that does expect the root partition to at least exist already21:30:24
@elvishjerricco:matrix.org@elvishjerricco:matrix.orgso nevermind21:30:27
@elvishjerricco:matrix.org@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@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@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
@arianvp:matrix.orgArian if only we replaced /nix/store with /usr/store 21:37:28
@arianvp:matrix.orgArian dreams 21:37:31
@elvishjerricco:matrix.org@elvishjerricco:matrix.orgyea...21:37:38
@elvishjerricco:matrix.org@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@elvishjerricco:matrix.orgI'm leaning towards the former personally21:39:53
@elvishjerricco:matrix.org@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@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@elvishjerricco:matrix.orgEvery time I think about this problem I just confuse myself more and more with all the possibilities and all the problems...21:44:02
@arianvp:matrix.orgArian how about we upstream a commit to systemd to support kernel param rd.repart.device=/dev/vda 21:45:39
@arianvp:matrix.orgArian if it's not set it checks for /sysroot 21:45:59
@arianvp:matrix.orgArian otherwise it uses rd.repart.device 21:46:06
@arianvp:matrix.orgArianoh wait that doesn't help21:46:32
@elvishjerricco:matrix.org@elvishjerricco:matrix.orgyea I was about to ask :P21:47:23
@elvishjerricco:matrix.org@elvishjerricco:matrix.org (of course, that would be sane anyway; just doesn't help our issues) 21:47:45
@arianvp:matrix.orgAriani still dont fully understand how this works upstream21:48:55

Show newer messages


Back to Room ListRoom Version: 6