!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
22 Apr 2023
@elvishjerricco:matrix.org@elvishjerricco:matrix.orgok the assertion just isn't working for some reason13:41:02
@elvishjerricco:matrix.org@elvishjerricco:matrix.orgOr... the way I'm testing it isn't working? I'm confused13:42:08
@elvishjerricco:matrix.org@elvishjerricco:matrix.org

Yea wtf assertions?

$ nix eval -f ./nixos --arg configuration '{fileSystems."/" = { device = "fo"; fsType = "zfs"; }; boot.loader.grub.device = "nodev"; networking.hostId = "deadbeef"; }' config.boot.initrd.postDeviceCommands
<very much not the empty string>
$ nix build -f ./nixos --arg configuration '{fileSystems."/" = { device = "fo"; fsType = "zfs"; }; boot.loader.grub.device = "nodev"; networking.hostId = "deadbeef"; }' system
<builds fine>
13:44:30
@aktaboot:tchncs.de@aktaboot:tchncs.debut doesn't stage2 happen after mounting the rootfs ? (which in some cases is luks encrypted) so how would that be ?13:45:02
@aktaboot:tchncs.de@aktaboot:tchncs.de only reading it from the comments in stage-1.nix 13:45:24
@elvishjerricco:matrix.org@elvishjerricco:matrix.org aktaboot: The file systems that have to be mounted in stage 1 also need to have their LUKS drives decrypted in stage 1 13:45:32
@elvishjerricco:matrix.org@elvishjerricco:matrix.orgBut this is not all file systems13:45:48
@elvishjerricco:matrix.org@elvishjerricco:matrix.orgIt's not uncommon to have file systems and disks that only need to be done in stage 213:46:17
@elvishjerricco:matrix.org@elvishjerricco:matrix.orgbut we currently always do luks in stage 113:46:25
@elvishjerricco:matrix.org@elvishjerricco:matrix.org You can do it in stage 2 yourself by configuring /etc/crypttab though 13:46:36
@lily:lily.flowers@lily:lily.flowers
In reply to @elvishjerricco:matrix.org
Hm I thought I tested that one...
https://github.com/NixOS/nixpkgs/blob/9ea57a7a020823ff80dd3afbda037036e7392f21/nixos/modules/tasks/filesystems/zfs.nix#L534-L545
13:46:44
@aktaboot:tchncs.de@aktaboot:tchncs.deokay I see 👍. Also is this stage1/2 thing nixos specific ? I couldn13:46:49
@aktaboot:tchncs.de@aktaboot:tchncs.de* okay I see 👍. Also is this stage1/2 thing nixos specific ? I couldn't find info from other distros13:47:07
@elvishjerricco:matrix.org@elvishjerricco:matrix.org Lily Foster: Yea I see. I just can't figure out why the assertion didn't trigger for me 13:47:21
@elvishjerricco:matrix.org@elvishjerricco:matrix.org Like, I can see the option's value is not the empty string with nix eval 13:47:37
@oddlama:matrix.orgoddlama
In reply to @aktaboot:tchncs.de
okay I see 👍. Also is this stage1/2 thing nixos specific ? I couldn't find info from other distros
no, other distributions just don't call it stage 1 (the initramfs stage) and stage 2 (the actual system stage).
13:50:14
@elvishjerricco:matrix.org@elvishjerricco:matrix.orgYea the systemd docs try to exclusively use the terms "initrd" and "host" for what we prefer to call "stage 1" and "stage 2" respectively13:50:58
@elvishjerricco:matrix.org@elvishjerricco:matrix.orginitramfs is another commonly used name though since it's technically more accurate (no one uses literal ramdisks anymore, which is what rd stood for)13:51:24
@aktaboot:tchncs.de@aktaboot:tchncs.deoh okay so stage2 ends with pivot-root iiuc ?13:52:11
@elvishjerricco:matrix.org@elvishjerricco:matrix.org stage 1 ends with systemctl switch-root (or switch_root in the traditional initrd) 13:52:40
@oddlama:matrix.orgoddlamano stage 1 pivots to stage 213:52:42
@elvishjerricco:matrix.org@elvishjerricco:matrix.orgstage 2 just shuts down when it ends13:52:54
@lily:lily.flowers@lily:lily.flowers
In reply to @elvishjerricco:matrix.org
Lily Foster: Yea I see. I just can't figure out why the assertion didn't trigger for me
Oh, yeah, no clue there
13:53:00
@elvishjerricco:matrix.org@elvishjerricco:matrix.orgi.e. when you power off / reboot13:53:02
@aktaboot:tchncs.de@aktaboot:tchncs.deokay so stage2 is just the normal os stuff :)13:53:09
@aktaboot:tchncs.de@aktaboot:tchncs.dethanks for the clarificatiosn 👍13:53:35
@lily:lily.flowers@lily:lily.flowers
In reply to @elvishjerricco:matrix.org
stage 2 just shuts down when it ends
We could designate the final shutdown ramfs pivot stage-3 (/s)
13:53:39
@aktaboot:tchncs.de@aktaboot:tchncs.de* thanks for the clarifications 👍13:53:40
@elvishjerricco:matrix.org@elvishjerricco:matrix.orgI didn't wanna mention that :P13:53:51
@elvishjerricco:matrix.org@elvishjerricco:matrix.orgbut yep13:53:53

Show newer messages


Back to Room ListRoom Version: 6