garmin / pyrex

Seamless container setup for developing with OpenEmbedded/Yocto Project
Apache License 2.0
36 stars 29 forks source link

uidmap has negative number when UID is very large #77

Open ejd opened 2 years ago

ejd commented 2 years ago

I'm using pyrex to as part of the process for building the NI Linux RT image used by nilrt. I followed the instructions in the ni/nilrt README.md up to the step where you source ni-oe-init-build-env. That file runs pyrex capture which in turn attempts to run podman run with a malformed --uidmap. The error message is as follows:

Error: error initializing ID mappings: UID setting is malformed expected ["uint32:uint32:uint32"]: ["0:1:1900000000" "1900000000:0:1" "1900000001:1900000001:-1899934464"]

I'm using Ubuntu 20.01 and Python 3.9.12. nilrt pulls in a submodule of pyrex at 8262423. The ni org has their own fork of pyrex but it's unmodified from this repo.

My UID is 1900000000. (Truthfully, my actual UID is not that round but this is close enough.) I didn't choose the UID, it was assigned by the team that configured the machine at my workplace. I've never used a machine where my UID was more than four or five digits but apparently UIDs can use a full uint32. I am not sure what motivated the selection of such a large UID. :shrug:

Here's my /etc/subuid; foo is another user (and group) while me is my username and group.

foo:100000:65536
me:165536:65536

And my /etc/subgid:

foo:100000:65536
me:165536:65536