!PSmBFWNKoXmlQBzUQf:helsinki-systems.de

Stage 1 systemd

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

Load older messages


SenderMessageTime
22 May 2023
@arianvp:matrix.orgArian(or maybe we do that already; idk)13:49:31
@nikstur:matrix.org@nikstur:matrix.org
In reply to @arianvp:matrix.org
shouldn't we be able to build an image without booting a VM?
Afaik all the file systems that systemd-repart supports ("ext4", "btrfs", "xfs", "vfat", "erofs", "squashfs") can be created without a VM. In fact with this commit https://github.com/systemd/systemd/commit/1eb86ddde4f36165a99732b53cc97cef1acc3aa7 we can build disk images with systemd-repart in the nix build sandbox. For all but vfat and xfs the, mkfs tools take a directory and turn it into a fs. To build a vfat fs you need to copy the files manually (with mtools) into the fs image after you have created it (still in user space though) and for xfs there is a weird protofile which you can also create outside of a VM. I have no idea about the other filesystems NixOS supports.
16:14:07
@nikstur:matrix.org@nikstur:matrix.org And then there a fun things like bootctl install which checks that the ESP is a vfat fs, so afaik you cant call it in a chroot. 16:14:37
@elvishjerricco:matrix.org@elvishjerricco:matrix.org How does repart's CopyFiles thing even work? 16:16:08
@nikstur:matrix.org@nikstur:matrix.org Ahh this is new, there is a variable for bootctl which disables the check $SYSTEMD_RELAX_ESP_CHECKS=1 16:16:29
@nikstur:matrix.org@nikstur:matrix.org
In reply to @elvishjerricco:matrix.org
How does repart's CopyFiles thing even work?
It creates a root directory for most filesystems and then calls mkfs pointing at the root directory.
16:17:11
@elvishjerricco:matrix.org@elvishjerricco:matrix.orgwell but how does it actually populate the file system with contents?16:17:27
@elvishjerricco:matrix.org@elvishjerricco:matrix.orgdoes it mount the fs?16:17:34
@elvishjerricco:matrix.org@elvishjerricco:matrix.orgor does it have some userspace way to write to the fs16:17:50
@nikstur:matrix.org@nikstur:matrix.orgmkfs does the population16:17:57
@nikstur:matrix.org@nikstur:matrix.orgSee: https://github.com/systemd/systemd/blob/main/src/shared/mkfs-util.c#LL482C36-L482C3616:18:00
@nikstur:matrix.org@nikstur:matrix.orgWith the exception of vfat where they do something similar to what we do in our iso images: https://github.com/NixOS/nixpkgs/blob/master/nixos/modules/installer/cd-dvd/iso-image.nix#L43716:20:08
@nikstur:matrix.org@nikstur:matrix.orgAnd XFS which I don't really understand16:20:22
@elvishjerricco:matrix.org@elvishjerricco:matrix.org TIL it's common for mkfs.* to support prepopulation 16:26:12
@arianvp:matrix.orgArianSo then we can get rid of qemu no?16:28:59
@elvishjerricco:matrix.org@elvishjerricco:matrix.orgI doubt it? I think the thing qemu is for is so we can just run a regular install process. We don't have a static fs tree to populate with16:30:01
@nikstur:matrix.org@nikstur:matrix.org Maybe make-diks-image-ng.nix for most use-cases? 16:30:17
@arianvp:matrix.orgArianBut the FS tree is just a nix store closure no?16:30:31
@nikstur:matrix.org@nikstur:matrix.org * Maybe make-diks-image-ng.nix for ~~most~~ a few use-cases? 16:30:33
@arianvp:matrix.orgArian /Etc gets populated in boot16:30:46
@elvishjerricco:matrix.org@elvishjerricco:matrix.org

Arian: from make-disk-image.nix:

The Nix-store only image only need to run LKL tools to produce an image and will never spawn a virtual machine, whereas full images will always require a virtual machine, b
ut also use LKL.

16:31:13
@arianvp:matrix.orgArianWhat else is there to populate except for some directories?16:31:17
@elvishjerricco:matrix.org@elvishjerricco:matrix.orgso we already don't need a vm if we're just making a nix store image16:31:27
@elvishjerricco:matrix.org@elvishjerricco:matrix.org *

Arian: from make-disk-image.nix:

The Nix-store only image only need to run LKL tools to produce an image and will never spawn a virtual machine, whereas full images will always require a virtual machine, but also use LKL.

16:31:40
@elvishjerricco:matrix.org@elvishjerricco:matrix.org Arian: A big part of what the VM is used for is useBootLoader 16:32:30
@elvishjerricco:matrix.org@elvishjerricco:matrix.orgbecause you actually have to do a boot loader install process16:32:40
@arianvp:matrix.orgArianFor EFI that's just files on the ESP16:33:01
@nikstur:matrix.org@nikstur:matrix.orgI have built disk images like that, but it might be hard to make all the installer tools behave16:33:42
@nikstur:matrix.org@nikstur:matrix.org And then there are fun things like useSecureBoot where sd-boot populates efi-vars 16:34:09
@nikstur:matrix.org@nikstur:matrix.org * And then there are fun things like useSecureBoot where bootctl populates efi-vars 16:34:28

Show newer messages


Back to Room ListRoom Version: 6