guix/gnu/system
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
..
examples vm-image.tmpl: Remove current-guix url override. 2025-12-22 23:00:45 +01:00
images system: images: Add A20-OLinuXino-LIME2 image. 2026-01-01 01:06:14 +01:00
accounts.scm Update Giacomo's email address. 2025-12-03 14:38:09 +09:00
file-systems.scm file-systems: Support the 'remount' mount flag. 2025-11-06 23:29:46 +01:00
hurd.scm gnu: nss-certs: Relocate to (gnu packages nss). 2025-08-17 22:34:42 +02:00
image.scm image: Use unshare to map root user for btrfs 2026-01-12 10:56:38 +01:00
install.scm system: install: Remove current-guix url override. 2025-12-22 23:00:46 +01:00
keyboard.scm
linux-container.scm system: Reinstate lock-mounts work around for system containers. 2025-12-16 09:32:07 +01:00
linux-initrd.scm linux-initrd: Support more virtio modules in initrd. 2025-12-22 23:00:42 +01:00
locale.scm locale: Upgrade ‘%default-locale-libcs’. 2025-07-18 20:17:51 +02:00
mapped-devices.scm mapped-devices/luks: Support extra options. 2025-10-06 10:21:16 +02:00
nss.scm nss: Allow selecting IP protocol for mDNS lookups. 2025-10-13 14:48:27 +02:00
pam.scm system: pam: Export pam records predicates. 2024-12-18 18:32:40 +01:00
privilege.scm
setuid.scm
shadow.scm Update Giacomo's email address. 2025-12-03 14:38:09 +09:00
uuid.scm
vm.scm vm: Let ‘%immutable-store’ through. 2025-10-01 10:45:09 +02:00