!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
20 Mar 2022
@elvishjerricco:matrix.org@elvishjerricco:matrix.orgThe size is even reasonable at 15M02:19:01
@elvishjerricco:matrix.org@elvishjerricco:matrix.org13 if you don't include cryptsetup libs02:19:11
@elvishjerricco:matrix.org@elvishjerricco:matrix.orgprobably smaller when I stop adding unnecessary systemd libs with the proper Exec* parsing02:19:25
@bobvanderlinden_:matrix.orgbobvanderlindenCool! I can work on it a bit tomorrow, so if you have something where work can continue on, let me know the branch 👍02:41:30
@elvishjerricco:matrix.org@elvishjerricco:matrix.org bobvanderlinden: I'll push my branch here in a minute, and I'll open a PR probably tonight after I do the Exec*/cherry-pick thing 02:42:10
@bobvanderlinden_:matrix.orgbobvanderlinden
In reply to @elvishjerricco:matrix.org
The last thing I think I need to do before the branch can be up for review/merge is the Exec* parsing stuff, though I may just cherry-pick your code instead since that would be easier.
I have been thinking of find-dependencies. It might also be of use for packing docker images and the like. Maybe we can make it a separate tool with some options to indicate the different strategies it should use.
02:43:30
@elvishjerricco:matrix.org@elvishjerricco:matrix.orgThat... can be saved for a later date :P02:44:04
@elvishjerricco:matrix.org@elvishjerricco:matrix.orgGotta get this merged first02:44:11
@elvishjerricco:matrix.org@elvishjerricco:matrix.orgOh crap I forgot about udev rules02:49:04
@elvishjerricco:matrix.org@elvishjerricco:matrix.org bobvanderlinden: https://github.com/bobvanderlinden/nixpkgs/compare/pr-refactor-systemd-module...ElvishJerricco:systemd-initrd-reuse-systemd-module 03:10:41
@elvishjerricco:matrix.org@elvishjerricco:matrix.orgThis is on top of your refactor branch03:10:47
@elvishjerricco:matrix.org@elvishjerricco:matrix.org

This is what I use to test it:

import ./nixos { configuration = { lib, config, pkgs, ... }: {
  imports = [./nixos/modules/virtualisation/qemu-vm.nix];
  boot.initrd.systemd = {
    enable = true;
    emergencyHashedPassword = "";
 };
  virtualisation = {
    graphics = false;
    memorySize = ;
    cores = 4;
  };
  documentation.enable = false;
  services.getty.autologinUser = "root";
}; }

Note that you currently have to format the nixos.qcow2 file manually for the qemu-vm

03:13:56
@elvishjerricco:matrix.org@elvishjerricco:matrix.org *

This is what I use to test it:

import ./nixos { configuration = { lib, config, pkgs, ... }: {
  imports = [./nixos/modules/virtualisation/qemu-vm.nix];
  boot.initrd.systemd = {
    enable = true;
    emergencyHashedPassword = "";
 };
  virtualisation = {
    graphics = false;
    memorySize = 4096;
    cores = 4;
  };
  documentation.enable = false;
  services.getty.autologinUser = "root";
}; }

Note that you currently have to format the nixos.qcow2 file manually for the qemu-vm

03:14:14
@elvishjerricco:matrix.org@elvishjerricco:matrix.orgOnce I have the exec detection and udev stuff I want in there, I'll open a PR that I expect to be merge-worthy03:15:23
@elvishjerricco:matrix.org@elvishjerricco:matrix.org(graphics = false isn't necessary, I just prefer it)03:47:49
@elvishjerricco:matrix.org@elvishjerricco:matrix.org bobvanderlinden: I switched to your version of the dependencies program and managed to get initrd down to 9.1M, which is crazy! It does boot, but now the rescue mode doesn't work for some reason. 06:02:24
@elvishjerricco:matrix.org@elvishjerricco:matrix.org

Aw, that decreased size was entirely because I switched to only including the necessities from util-linux instead of all of it, not because of the automatic dependency finder. And the finder didn't work well enough to actually function without significant help from manual inclusions :/

After staring at it and thinking for a while, I'm starting to think automatically finding Exec* stuff just isn't a problem worth solving. I imagine if a fresh set of eyes came to this project after this problem had been solved, they'd say any solution is way too jank to be worth it. If your unit file points to a program, then just include that program in objects... Adding services to initrd should be a fairly rare thing anyway.

06:56:48
@elvishjerricco:matrix.org@elvishjerricco:matrix.orgSooo... I'm going to do another little review an then open a PR!06:57:07
@elvishjerricco:matrix.org@elvishjerricco:matrix.orghttps://github.com/NixOS/nixpkgs/pull/164943 woot08:06:10
@arianvp:matrix.orgArianWill try it out right away!08:08:58
@arianvp:matrix.orgArian I wanted to say we probably need https://github.com/NixOS/nixpkgs/pull/121371 for the correct ordering of kmod-static-nodes and systemd-tmpfiles-setup-dev but it seems flokli merged it already! :D 08:12:08
@arianvp:matrix.orgArianso you probably have those fixed already :P08:12:14
@arianvp:matrix.orgArianyay about forgetting about PRs and other people picking them up08:13:31
@elvishjerricco:matrix.org@elvishjerricco:matrix.org Arian: Beware it's extremely minimal (on purpose), so it's only going to boot extremely simple things 08:14:20
@elvishjerricco:matrix.org@elvishjerricco:matrix.orgBut at least it has a good rescue shell when it fails :P08:14:34
@arianvp:matrix.orgArianthat's fine. I have a "play with initrd" machine :P08:14:47
@arianvp:matrix.orgArianAnother future work could be: Unified kernel images for the SecureBoot integration 08:15:52
@arianvp:matrix.orgArian Adds to my own list 08:15:56
@elvishjerricco:matrix.org@elvishjerricco:matrix.orgBit out of scope I think :P08:17:00
@arianvp:matrix.orgArianyes =)08:17:04

Show newer messages


Back to Room ListRoom Version: 6