!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/5127 Servers

Load older messages


SenderMessageTime
21 Nov 2022
@elvishjerricco:matrix.org@elvishjerricco:matrix.orgtbh I'm not sure if that's the right thing to do. I mean I know it's better, but that is technically a compatibility break02:53:34
@elvishjerricco:matrix.org@elvishjerricco:matrix.org Oh and in the same diff, fsPackages = [e2fsprogs] was made conditional on systemd -> inInitrd. I think this is definitely incorrect though since fsPackages is relevant to stage 2 as well 02:54:37
@elvishjerricco:matrix.org@elvishjerricco:matrix.orghttps://github.com/NixOS/nixpkgs/pull/20213203:37:38
22 Nov 2022
@mlyx:matrix.org@mlyx:matrix.org joined the room.21:05:33
25 Nov 2022
@raphi:tapesoftware.net@raphi:tapesoftware.net changed their profile picture.19:41:52
@tired:fairydust.space@tired:fairydust.space joined the room.22:05:57
26 Nov 2022
@ahsmha:matrix.org@ahsmha:matrix.org changed their display name from rh to ahmed.19:19:42
27 Nov 2022
@me:linj.tech@me:linj.tech how can I write a service for old initrd's boot.initrd.preDeviceCommands? 22:24:58
@janne.hess:helsinki-systems.de@janne.hess:helsinki-systems.de boot.initrd.systemd.services I think 22:25:18
@me:linj.tech@me:linj.tech

The following service will cause systemd to time out without asking me the password for luks

boot.initrd.systemd.services.pre-device-command = {
            description = "pre device command";
            wantedBy = [ "cryptsetup.target" ];
            wants = [ "cryptsetup-pre.target" ];
            before = [ "cryptsetup-pre.target" ];
            script = ''
              echo pre-device-command-start
              echo pre-device-command-end
            '';
          };
22:30:01
@janne.hess:helsinki-systems.de@janne.hess:helsinki-systems.de yeah if it want's cryptsetup-pre.target, cryptosetup-pre.target needs to be active for the unit to start. before that, the unit has to be started though because of the before 22:30:54
@janne.hess:helsinki-systems.de@janne.hess:helsinki-systems.de you probably want cryptsetup.target in that before 22:31:08
@me:linj.tech@me:linj.tech
In reply to @me:linj.tech

The following service will cause systemd to time out without asking me the password for luks

boot.initrd.systemd.services.pre-device-command = {
            description = "pre device command";
            wantedBy = [ "cryptsetup.target" ];
            wants = [ "cryptsetup-pre.target" ];
            before = [ "cryptsetup-pre.target" ];
            script = ''
              echo pre-device-command-start
              echo pre-device-command-end
            '';
          };
oh, I made a mistake. This service cause a dependency circle and is deleted by systemd to break the circle. If I change to, systemd will time out without asking password.
22:34:07
@me:linj.tech@me:linj.tech
In reply to @me:linj.tech

The following service will cause systemd to time out without asking me the password for luks

boot.initrd.systemd.services.pre-device-command = {
            description = "pre device command";
            wantedBy = [ "cryptsetup.target" ];
            wants = [ "cryptsetup-pre.target" ];
            before = [ "cryptsetup-pre.target" ];
            script = ''
              echo pre-device-command-start
              echo pre-device-command-end
            '';
          };
* oh, I made a mistake. This service cause a dependency circle and is deleted by systemd to break the circle. If I change wants = [ "cryptsetup-pre.target" ]; to wants = [ "basic.target" ];, systemd will time out without asking password.
22:34:45
@janne.hess:helsinki-systems.de@janne.hess:helsinki-systems.de looking at the bootup man page, basic.target actually seems a bit late 22:35:46
@arianvp:matrix.orgArianDont forget Default dependencies=no22:36:34
@arianvp:matrix.orgArianOtherwise you'll be ordered after sysinit.target by default22:37:20
@arianvp:matrix.orgArianWhich is probably too late22:37:34
@me:linj.tech@me:linj.tech
In reply to @janne.hess:helsinki-systems.de
you probably want cryptsetup.target in that before
Mounting /sysroot/nix... is before Reached target Local Encrypted Volumes., so before = [ "cryptsetup.target" ] is not enough I think
22:39:03
@arianvp:matrix.orgArian`unitConfig.DefaultDependencies=false`22:39:09
@elvishjerricco:matrix.org@elvishjerricco:matrix.org linj: as I understand it, preDeviceCommands in the old initrd basically means pre-udev. That is extremely early. 22:56:59
@me:linj.tech@me:linj.tech

Arian: your trick works!

pre-device-command = {
            description = "pre device command";
            wantedBy = [ "cryptsetup.target" ];
            wants = [ "cryptsetup-pre.target" ];
            before = [ "cryptsetup-pre.target" ];
            unitConfig.DefaultDependencies = false;
            # serviceConfig = {
            #   Type = "oneshot";
            #   RemainAfterExit = true;
            # };
            script = ''
              echo pre-device-command-start
              echo pre-device-command-end
            '';
          };
23:01:17
@arianvp:matrix.orgArianGreat 23:01:46
@elvishjerricco:matrix.org@elvishjerricco:matrix.org linj: I'm very curious what you're trying to achieve 23:01:51
@me:linj.tech@me:linj.techemm, what I want is somewhat weird: generate a keyfile on the fly for luks without storing that keyfile in initrd23:03:52
@me:linj.tech@me:linj.techon a vps23:04:23
@me:linj.tech@me:linj.tech another question: the before = [ "" ] does not seem to work: 59:50 localhost systemd[1]: Reached target Local Encrypted Volumes (Pre). is before 59:50 localhost systemd[1]: pre-device-command.service: Deactivated successfully. in journal 23:06:13
@me:linj.tech@me:linj.tech * another question: the before = [ "cryptsetup-pre.target" ] does not seem to work: 59:50 localhost systemd[1]: Reached target Local Encrypted Volumes (Pre). is before 59:50 localhost systemd[1]: pre-device-command.service: Deactivated successfully. in journal 23:06:25
@me:linj.tech@me:linj.tech
In reply to @me:linj.tech
another question: the before = [ "cryptsetup-pre.target" ] does not seem to work: 59:50 localhost systemd[1]: Reached target Local Encrypted Volumes (Pre). is before 59:50 localhost systemd[1]: pre-device-command.service: Deactivated successfully. in journal
oneshot does not change this
23:06:55
@arianvp:matrix.orgArianthere's an easier way to do that I think23:10:25

Show newer messages


Back to Room ListRoom Version: 6