On 10/29/25 07:36, Alyssa Ross wrote:
Demi Marie Obenour <demiobenour@gmail.com> writes:
Busybox provides a broken fdisk that doesn't support GPT, only MBR. The systemd built against musl doesn't include systemd-pull, so systemd-sysupdate doesn't work. Therefore, use all of util-linux's command-line tools, and use systemd built against glibc.
That's a problem that's going to need to be fixed. We're not mixing two different libcs on the host.
Unfortunately, systemd-pull can't be built with musl libc. That leaves four options: 1. Try to fix the build problem, knowing that it could come back. 2. Mix two libcs on the host. 3. Try to fix the build (but this could take quite a while to upstream). 4. Use glibc on the host. I don't think we should ship with option 2, but I think it might be acceptable until the underlying problem is solved.
Signed-off-by: Demi Marie Obenour <demiobenour@gmail.com> --- host/rootfs/default.nix | 43 ++++++++++++++++++------------------------- 1 file changed, 18 insertions(+), 25 deletions(-)
Okay idea overall. I like the idea of less busybox. Busybox → util-linux should probably be a patch of its own.
Will fix in v2.
diff --git a/host/rootfs/default.nix b/host/rootfs/default.nix index 0d79f7ca54ccc86eb0fa6e743f2011237d365f24..00052222507077b9e94a5ed0a3fbddd27caeefc3 100644 --- a/host/rootfs/default.nix +++ b/host/rootfs/default.nix @@ -4,20 +4,20 @@
import ../../lib/call-package.nix ( { callSpectrumPackage, spectrum-build-tools, src -, pkgsMusl, pkgsStatic, linux_latest +, pkgsMusl, pkgsStatic, linux_latest, systemd }: pkgsStatic.callPackage (
{ busybox, cloud-hypervisor, cryptsetup, dbus, erofs-utils, execline , inkscape, inotify-tools, iproute2, jq, lib, mdevd, nixos , runCommand, s6, s6-linux-init, s6-rc, socat, spectrum-host-tools -, stdenvNoCC, util-linuxMinimal, virtiofsd, writeClosure +, stdenvNoCC, util-linux, virtiofsd, writeClosure
util-linuxMinimal = util-linux.override { cryptsetupSupport = false; nlsSupport = false; ncursesSupport = false; pamSupport = false; shadowSupport = false; systemdSupport = false; translateManpages = false; };
So how come we need the non-minimal version?
I didn't check.
# Weston doesn't support SVG icons. inkscape -w 20 -h 20 \ -o $out/usr/share/icons/hicolor/20x20/apps/com.system76.CosmicFiles.png \ ${cosmic-files}/share/icons/hicolor/24x24/apps/com.system76.CosmicFiles.svg
- ln -st $out/usr/bin \ - ${concatMapStringsSep " " (p: "${p}/bin/*") packages} \ - ${xdg-desktop-portal}/libexec/xdg-document-portal \ - ${xdg-desktop-portal-gtk}/libexec/xdg-desktop-portal-gtk + ln -sft "$out/usr/bin" \ + ${concatMapStringsSep " " (p: "${escapeShellArg p}/bin/*") packages} \ + ${escapeShellArg xdg-desktop-portal}/libexec/xdg-document-portal \ + ${escapeShellArg xdg-desktop-portal-gtk}/libexec/xdg-desktop-portal-gtk ln -st $out/usr/share/dbus-1 \ - ${dbus}/share/dbus-1/session.conf + ${escapeShellArg dbus}/share/dbus-1/session.conf ln -st $out/usr/share/dbus-1/services \ - ${xdg-desktop-portal-gtk}/share/dbus-1/services/org.freedesktop.impl.portal.desktop.gtk.service - - for pkg in ${escapeShellArgs usrPackages}; do - lndir -ignorelinks -silent "$pkg" "$out/usr" - done + ${escapeShellArg xdg-desktop-portal-gtk}/share/dbus-1/services/org.freedesktop.impl.portal.desktop.gtk.service
Unrelated changes. We don't need to escape Nix store paths, because we rely on Nixpkgs, which would break if store paths had weird characters in them.
Will drop in v2.
+ # clobber any conflicting files from busybox + ln -sft "$out/usr/bin" ${escapeShellArg util-linux}/bin/*
The approach we've taken so far is to disable those tools in Busybox, and avoid conflicting symlinks, and I like that better. Alternatively, if you want to figure out which Busybox tools are actually needed, we could switch to a minimal build and enable only what we use.
I don't want to block on either of those, and I'd rather not risk breaking the build whenever util-linux adds a new tool. It's pretty clear that util-linux is to be preferred over Busybox in the event of a conflict. This does add bloat, but there are far *more* sources of bloat right now, so I think that should be part of a more general debloating effort.
${concatStrings (mapAttrsToList (name: path: '' ln -s ${path} $out/usr/lib/spectrum/vm/${name} '') appvms)} - - # TODO: this is a hack and we should just build the util-linux - # programs we want. - # https://lore.kernel.org/util-linux/87zgrl6ufb.fsf@alyssa.is/ - ln -s ${util-linuxMinimal}/bin/{findfs,uuidgen,lsblk,mount} $out/usr/bin - - # TODO: this is another hack and it should be possible - # to build systemd without this. - ln -s -- ${lib.escapeShellArg systemd}/bin/udevadm "$out/usr/bin" ''; in
-- 2.51.2
-- Sincerely, Demi Marie Obenour (she/her/hers)