guix/gnu/build
Ryan Sundberg 62c28bc6d8
image: Use unshare to map root user for btrfs
The current version of `mkfs.btrfs` has a regression when combined with
`fakeroot` where it does not detect the faked root uid/gid of files when
building the filesystem. This produces partition images with `/` owned by
the guixbuild user when it should be owned by root.

Using `unshare` rather than `fakeroot` resolves this by doing the uid
mapping at the kernel level rather than overloading the `stat` function.

An equivalent issue was [reported and patched in
NixOS](https://github.com/NixOS/nixpkgs/pull/434122)

* gnu/build/image.scm (system-disk-image): Import `util-linux` instead of
`fakeroot`.
* gnu/system/image.scm (make-btrfs-image): Use `unshare --map-root-user`

Change-Id: Id4eeaf510f3ec5f4a23b4d700a73e2cf46da40b1
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
Merges: #5536
2026-01-12 10:56:38 +01:00
..
accounts.scm system: Relax subordinate ID validation. 2025-12-11 15:43:16 +01:00
activation.scm build: Make /etc/hosts a regular file again. 2025-12-22 10:46:52 +09:00
bootloader.scm build: bootloader: Add riscv64 case. 2025-04-08 14:58:19 +08:00
chromium-extension.scm chromium-extension: Compute json at argument evaluation time. 2023-12-27 17:18:52 +01:00
cross-toolchain.scm gnu: cross-toolchain: Add set-cross-path for AVR. 2023-12-11 13:36:51 +02:00
dbus-service.scm build/dbus-service: Fix possible syntax error in 'with-retries'. 2025-12-30 22:42:06 +09:00
file-systems.scm file-systems: Support the 'remount' mount flag. 2025-11-06 23:29:46 +01:00
hurd-boot.scm hurd-boot: change /etc/mtab to /var/run/mtab. 2025-10-12 22:22:01 +02:00
icecat-extension.scm
image.scm image: Use unshare to map root user for btrfs 2026-01-12 10:56:38 +01:00
install.scm Reapply "Update Maxim's email address." 2025-09-18 13:44:12 +09:00
jami-service.scm Reapply "Update Maxim's email address." 2025-09-18 13:44:12 +09:00
linux-boot.scm Reapply "Update Maxim's email address." 2025-09-18 13:44:12 +09:00
linux-container.scm build/syscalls: Introduce new safe-clone and use it. 2025-10-29 11:34:28 +09:00
linux-initrd.scm
linux-modules.scm Revert "elf: Remove bundled Guile source." 2025-10-30 16:19:49 +09:00
locale.scm
marionette.scm Reapply "Update Maxim's email address." 2025-09-18 13:44:12 +09:00
oci-containers.scm services: Add oci-service-type. 2025-08-25 13:04:36 +09:00
secret-service.scm services: secret-service: Add #:timeout to ‘secret-service-receive-secrets’. 2025-09-21 17:57:16 +02:00
shepherd.scm shepherd: Remove ‘make-forkexec-constructor/container’. 2023-12-22 00:31:42 +01:00
svg.scm