!PSmBFWNKoXmlQBzUQf:helsinki-systems.de

Stage 1 systemd

83 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
@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
@elvishjerricco:matrix.org@elvishjerricco:matrix.orgwe kinda technically have a stage 313:54:00
@elvishjerricco:matrix.org@elvishjerricco:matrix.orgit's just exceptionally simple13:54:08
@elvishjerricco:matrix.org@elvishjerricco:matrix.org It's just the systemd-shutdown binary going on a merciless killing spree and then eventually dumbly running some executable hooks without any sort of logical ordering 13:54:52
@elvishjerricco:matrix.org@elvishjerricco:matrix.orgok seriously wtf I cannot figure out why that assertion isn't triggering13:57:38
@elvishjerricco:matrix.org@elvishjerricco:matrix.org oh, I derped and forgot to have boot.initrd.systemd.enable = true 14:02:34
@elvishjerricco:matrix.org@elvishjerricco:matrix.org And I took for granted that if nixosTests.installer-systemd-stage-1.zfsroot evaluated, that meant it would succeed. But I'm testing that now and I expect it won't 14:03:14
@elvishjerricco:matrix.org@elvishjerricco:matrix.orgBecause it's not the initial machine config that has systemd stage 1 enabled. It's the installed machine. So it'll fail when the installer tries to install it14:03:54
@elvishjerricco:matrix.org@elvishjerricco:matrix.organd yep there it goes14:04:04
@aktaboot:tchncs.de@aktaboot:tchncs.deis stage-1 ran automatically by giving the script to the initrd/ramfs ? or rather to the bootloader that will call it in the initramfs ?14:17:22
@elvishjerricco:matrix.org@elvishjerricco:matrix.org The boot loader loads the initrd image from the disk and the kernel unpacks it into memory and runs /init 14:17:53
@aktaboot:tchncs.de@aktaboot:tchncs.de I could not find where printing the <<< NixOS Stage 1 >>> string happens 🤔 14:20:19
@elvishjerricco:matrix.org@elvishjerricco:matrix.org I think that's just in stage-1-init.sh isn't it? Which is only for the scripted initrd, not systemd initrd 14:20:52
@aktaboot:tchncs.de@aktaboot:tchncs.deyep thanks :)\14:21:36
@aktaboot:tchncs.de@aktaboot:tchncs.de* yep thanks :)14:21:38
@aktaboot:tchncs.de@aktaboot:tchncs.de huh, I thought that that would be /init in the initrd 14:22:43

Show newer messages


Back to Room ListRoom Version: 6