!PSmBFWNKoXmlQBzUQf:helsinki-systems.de

Stage 1 systemd

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

Load older messages


SenderMessageTime
7 Dec 2022
@elvishjerricco:matrix.org@elvishjerricco:matrix.orgzroot, not zpool?21:43:03
@hexa:lossy.network@hexa:lossy.networkyes21:43:09
@hexa:lossy.network@hexa:lossy.networksometimes I also have zhome 🙂21:43:19
@elvishjerricco:matrix.org@elvishjerricco:matrix.org You said earlier you used zfs-import-zpool.service, so that should be zfs-import-zroot.service 21:43:34
@hexa:lossy.network@hexa:lossy.networkoh boy 21:43:46
@hexa:lossy.network@hexa:lossy.networkrebooting21:43:50
@hexa:lossy.network@hexa:lossy.networkworks! 😄21:45:13
@hexa:lossy.network@hexa:lossy.networkthank you!21:46:34
@elvishjerricco:matrix.org@elvishjerricco:matrix.orgwhoo21:47:06
@hexa:lossy.network@hexa:lossy.network
  boot.initrd.systemd.services = {
    impermanence-root = {
      wantedBy = [
        "initrd.target"
      ]; 
      after = [
        "zfs-import-zroot.service"
      ];
      before = [ 
        "sysroot.mount"
      ];
      unitConfig.DefaultDependencies = "no";
      serviceConfig = {
        Type = "oneshot";
        ExecStart = "${pkgs.zfs}/bin/zfs rollback -r zroot/local/root@blank";
      };
    };
  };
21:47:35
@elvishjerricco:matrix.org@elvishjerricco:matrix.org hexa: looks good to me! 21:51:39
8 Dec 2022
@janne.hess:helsinki-systems.de@janne.hess:helsinki-systems.de
In reply to @hexa:lossy.network
  boot.initrd.systemd.services = {
    impermanence-root = {
      wantedBy = [
        "initrd.target"
      ]; 
      after = [
        "zfs-import-zroot.service"
      ];
      before = [ 
        "sysroot.mount"
      ];
      unitConfig.DefaultDependencies = "no";
      serviceConfig = {
        Type = "oneshot";
        ExecStart = "${pkgs.zfs}/bin/zfs rollback -r zroot/local/root@blank";
      };
    };
  };
https://github.com/nix-community/impermanence/pulls ;)
08:14:40
@hexa:lossy.network@hexa:lossy.networkRelated, yes08:20:06
11 Dec 2022
@mlyx:matrix.org@mlyx:matrix.org https://github.com/NixOS/nixpkgs/blob/9f6f47f27cc0bff0aee003834e2c7d8a17c8d202/nixos/modules/system/boot/systemd/initrd.nix#L500
why use chroot not systemctl switch-root?
21:55:06
@janne.hess:helsinki-systems.de@janne.hess:helsinki-systems.deBecause that switches root rather than chrooting22:00:10
@mlyx:matrix.org@mlyx:matrix.org I test that change chroot to systemctl --no-block switch-root /sysroot $closure/prepare-root can still boot. I really don't understand the difference. Could you please elaborate more details? 22:43:35
@mlyx:matrix.org@mlyx:matrix.orgSnipaste_2022-12-11.png
Download Snipaste_2022-12-11.png
22:43:35
12 Dec 2022
@elvishjerricco:matrix.org@elvishjerricco:matrix.org mlyx: We do use systemctl switch-root in initrd-switch-root.service. Whereas initrd-nixos-activation.service is just meant to prepare the file system to be used as the nixos root 03:29:26
@elvishjerricco:matrix.org@elvishjerricco:matrix.orghttps://github.com/systemd/systemd/pull/2571008:52:49
@elvishjerricco:matrix.org@elvishjerricco:matrix.org I'm still not sure what the correct design for NixOS is; root= on the cmdline, or /etc/fstab embedded in initrd or added as a companion file or generated file. But just in case the answer is the cmdline, this PR is definitely necessary 08:53:57
@arianvp:matrix.org@arianvp:matrix.orgThey're all equivalent no?09:14:34
@arianvp:matrix.org@arianvp:matrix.orgI think it's the same generator 09:14:47
@elvishjerricco:matrix.org@elvishjerricco:matrix.orgnot exactly09:14:57
@elvishjerricco:matrix.org@elvishjerricco:matrix.org systemd-fstab-generator is the one behind either, but it has different code paths for root= vs /etc/fstab vs /sysroot/etc/fstab 09:15:27
@arianvp:matrix.org@arianvp:matrix.orgThe systemd way is gpt-auto-generator probably :p09:15:28
@arianvp:matrix.org@arianvp:matrix.org
In reply to @elvishjerricco:matrix.org
systemd-fstab-generator is the one behind either, but it has different code paths for root= vs /etc/fstab vs /sysroot/etc/fstab
Ah
09:15:37
@elvishjerricco:matrix.org@elvishjerricco:matrix.organd yea that gpt generator is a whole other one I haven't dug into yet09:15:50
@elvishjerricco:matrix.org@elvishjerricco:matrix.org(and if you imagine the GPT as no different than a file on the ESP in terms of its ability to provide metadata, the GPT generator could be replaced by a generator that utilizes a file provided in the ESP and loaded via systemd-stub's "companion file" mechanism)09:18:23
@elvishjerricco:matrix.org@elvishjerricco:matrix.org (but that's neither here nor there) 09:19:01
14 Dec 2022
@yinfeng:li7g.comYinfeng joined the room.05:32:08

Show newer messages


Back to Room ListRoom Version: 6