[systemd-devel] mkosi: rpm using host machine's users/groups
Colin Guthrie
gmane at colin.guthr.ie
Wed Sep 1 13:30:35 UTC 2021
Hi,
So I didn't appreciate this before, but it seems a long standing RPM
issue where, when using --root the packages will be installed with the
uid/gid mappings from the host machine rather than the passwd/group
files from the root.
This makes for a problem using mkosi as it doesn't make the builds
repeatable and very much dependant on the host machine.
For now, I've added the following to my mkosi.postinst:
rpm -qa | xargs rpm --setugids >/dev/null 2>&1
(for an RPM based target distro this is fine, but obviously others will
presumably have similar commands).
This, however, isn't cheap. It takes ~1 minute on a small package list
on my semi-recent SSD laptop. That's pretty much the same time it takes
to install the packages in the first place.
So my question is, is there a better work around for this?
Upstream RPM issue:
https://github.com/rpm-software-management/rpm/issues/882
While I don't think it helps, the user namespaces may be a useful work
around (e.g. semi related to
https://github.com/systemd/mkosi/issues/716) but I think the real fix is
likely in glibc/rpm.
Col
--
Colin Guthrie
gmane(at)colin.guthr.ie
http://colin.guthr.ie/
Day Job:
Tribalogic Limited http://www.tribalogic.net/
Open Source:
Mageia Contributor http://www.mageia.org/
PulseAudio Hacker http://www.pulseaudio.org/
Trac Hacker http://trac.edgewall.org/
More information about the systemd-devel
mailing list