mirror of
https://github.com/flatcar/scripts.git
synced 2025-11-14 07:01:32 +01:00
This create more issues than it solves:
* override existing subuid / subgid
* not flexible for the end user
* it has to be created only once (while tmpfiles always try to create
those files)
I think Flatcar should not be responsible to create this and it should
be documented on how to do it through Ignition:
```yaml
version: 1.1.0
variant: flatcar
storage:
files:
- path: /etc/subuid
append:
- inline: |
root:1065536:65536
- path: /etc/subgid
append:
- inline: |
root:1065536:65536
```
Signed-off-by: Mathieu Tortuyaux <mtortuyaux@microsoft.com>
27 lines
536 B
Bash
Executable File
27 lines
536 B
Bash
Executable File
#!/bin/bash
|
|
|
|
set -euo pipefail
|
|
rootfs="${1}"
|
|
|
|
pushd "${rootfs}"
|
|
|
|
pushd ./usr/lib/systemd/system
|
|
mkdir -p "multi-user.target.d"
|
|
{ echo "[Unit]"; echo "Upholds=incus.service"; } > "multi-user.target.d/10-incus.conf"
|
|
popd
|
|
|
|
mkdir -p ./usr/lib/tmpfiles.d
|
|
pushd ./usr/lib/tmpfiles.d
|
|
cat <<EOF >./10-incus.conf
|
|
d /var/lib/lxc/rootfs 0755 root root - -
|
|
EOF
|
|
popd
|
|
|
|
# Add 'core' user to 'incus-admin' group to avoid prefixing
|
|
# all commands with sudo.
|
|
mkdir -p ./usr/lib/userdb/
|
|
echo " " > ./usr/lib/userdb/core:incus-admin.membership
|
|
|
|
popd
|
|
|