!PSmBFWNKoXmlQBzUQf:helsinki-systems.de

Stage 1 systemd

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

Load older messages


SenderMessageTime
22 May 2023
@nikstur:matrix.org@nikstur:matrix.orgAhh they do more cherry-picking and delaying than I thought they do19:05:15
@nikstur:matrix.org@nikstur:matrix.orgBecause the commit was on the 14th Feb and they tagged the release on the 15th 19:05:42
@nikstur:matrix.org@nikstur:matrix.org
In reply to @arianvp:matrix.org
Ill make a PR to add the repart definitions file to config.system.build.repartDefitions so that it can be consumed by image builder
I thought about that too. The biggest problem is that you likely want to create different partitions in the disk image than you want systemd-repart to create on the final disk (e.g. create a root, A/B partitions etc.)
19:13:35
@arianvp:matrix.orgArianAh good point19:42:26
@arianvp:matrix.orgArianYeh maybe i make a new Nixos module option then. OTOH repart just skips partitions that already exist. So might just work19:42:49
@nikstur:matrix.org@nikstur:matrix.orgYes it skips existing ones but you'd have the opposite problem: you'd create partitions earlier (during disk creation) than you would actually want them (on first boot).20:19:35
@arianvp:matrix.orgArianSeparate config it is then :)21:53:51
@nikstur:matrix.org@nikstur:matrix.orgIs this something you want to upstream into Nixpkgs? 21:59:56
@nikstur:matrix.org@nikstur:matrix.orgThe image builder?22:00:10
@arianvp:matrix.orgArianDefinitely 22:07:30
@nikstur:matrix.org@nikstur:matrix.orgOk, I have some code for it already, we can cooperate if you're interested 22:11:09
23 May 2023
@emilazy:matrix.orgemily joined the room.09:32:49
@arianvp:matrix.orgAriancool11:38:33
@arianvp:matrix.orgArianThis is the code I have now (But doesn't work yet as the patch doesnt apply cleanly to v253.3 yet) https://github.com/arianvp/server-optimised-nixos/blob/5d0be3e285deea85e8ebbdc4291bfb6798fea831/modules/image.nix11:38:53
@arianvp:matrix.orgArian Probably want to move away from UKI to creating bootloader entry files such that the image is immediately compatible with nixos-rebuild after booting 11:39:23
@nikstur:matrix.org@nikstur:matrix.orgDoesn't the NixOS systemd boot installer just ignore your UKI and build its own entries?11:56:46
@arianvp:matrix.orgArian yeh so maybe it's actually fine. NixOS will not touch /EFI/Linux so I can put the UKI there and then NixOS can put its own entires in /loader/entries 12:45:47
@arianvp:matrix.orgArian nikstur: are you building against systemd master to get repart working in the sandbox? 12:46:16
@nikstur:matrix.org@nikstur:matrix.org

I'm doing something way nastier:

systemd-repart = pkgsUnstable.systemdMinimal.overrideAttrs (finalAttrs: previousAttrs: {
      src = prev.fetchFromGitHub {
        owner = "systemd";
        repo = "systemd";
        rev = "1eb86ddde4f36165a99732b53cc97cef1acc3aa7";
        hash = "sha256-Frf0QwJCw/fG+YQ/+frqq8aD2Jv32Ozw1JMwjZSBTHc=";
      };

      # Only this patch is necessary to build systemd. This package will not be
      # usable as a general replacement of systemd for NixOS but the tools like
      # systemd-repart will work.
      patches = [ (builtins.elemAt previousAttrs.patches 10) ];
    });
13:46:59
@nikstur:matrix.org@nikstur:matrix.orgpkgsUnstable is nixos-unstable13:47:14
@arianvp:matrix.orgArianI see14:03:16
@arianvp:matrix.orgArianRedacted or Malformed Event14:03:20
@arianvp:matrix.orgArianNote that systemd-repart does not change the UIDs/GIDs of any copied files and directories. When running systemd-repart as an unprivileged user to build an image of files and directories owned by the same user, you can run systemd-repart in a user namespace with the current user mapped to the root user to make sure the files and directories in the image are owned by the root user.14:03:31
@arianvp:matrix.orgArianwe don't support user namespaces inside the build sandbox do we? or do we these days?14:03:53
@arianvp:matrix.orgArian because I want th uid to be 0. not the uid of nixbld 14:04:30
@arianvp:matrix.orgArianfor files in the image14:04:36
@nikstur:matrix.org@nikstur:matrix.orgI call systemd-repart with fakeroot14:05:35
@nikstur:matrix.org@nikstur:matrix.orgAnd then there are quite a few things you need to do to make it reproducibleish14:05:58
@arianvp:matrix.orgArianyou have this code somewhere?14:06:14
@nikstur:matrix.org@nikstur:matrix.org

Not yet in the wild. This is what I currently do:

fakeroot systemd-repart \
              --dry-run=no \
              --empty=create \
              --size=auto \
              --root=buildroot \
              --definitions="$repartDefinitions" \
              --split=true \
              image.raw

which is definetely not enough for reproducibility

14:07:33

Show newer messages


Back to Room ListRoom Version: 6