mirror of
https://github.com/flatcar/scripts.git
synced 2025-08-06 20:47:00 +02:00
build_library: Add mangle script for incus sysext
This requests the `incus.service` for the multi-user.target Signed-off-by: Mathieu Tortuyaux <mtortuyaux@microsoft.com>
This commit is contained in:
parent
0355630109
commit
47f47b4393
28
build_library/sysext_mangle_flatcar-incus
Executable file
28
build_library/sysext_mangle_flatcar-incus
Executable file
@ -0,0 +1,28 @@
|
||||
#!/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 - -
|
||||
w+ /etc/subuid - - - - root:1065536:65536
|
||||
w+ /etc/subgid - - - - root:1065536:65536
|
||||
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
|
||||
|
Loading…
Reference in New Issue
Block a user