2022-06-25 23:08:57 +00:00
|
|
|
#!/usr/bin/python
|
|
|
|
|
2022-06-26 00:13:57 +00:00
|
|
|
# Set up subuid and subgid for rootless Podman
|
2022-06-25 23:08:57 +00:00
|
|
|
# https://wiki.archlinux.org/title/Podman#Set_subuid_and_subgid
|
2022-06-26 00:13:57 +00:00
|
|
|
|
|
|
|
|
2022-06-25 23:08:57 +00:00
|
|
|
ids = ''
|
|
|
|
for uid in range(1000, 2000):
|
2023-01-13 16:48:43 +00:00
|
|
|
start = (uid - 999) * 10**5
|
2022-06-25 23:08:57 +00:00
|
|
|
num = 65536 # Allocate 65536 UIDs
|
|
|
|
ids += str(uid) + ':' + str(start) + ':' + str(num) + '\n'
|
|
|
|
|
2022-06-26 00:13:57 +00:00
|
|
|
|
2022-06-25 23:08:57 +00:00
|
|
|
# Save to system files
|
|
|
|
with open('/etc/subuid', 'w') as f:
|
|
|
|
f.write(ids)
|
|
|
|
with open('/etc/subgid', 'w') as f:
|
|
|
|
f.write(ids)
|