Skip to content

Commit 47f47b4

Browse files
committed
build_library: Add mangle script for incus sysext
This requests the `incus.service` for the multi-user.target Signed-off-by: Mathieu Tortuyaux <[email protected]>
1 parent 0355630 commit 47f47b4

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#!/bin/bash
2+
3+
set -euo pipefail
4+
rootfs="${1}"
5+
6+
pushd "${rootfs}"
7+
8+
pushd ./usr/lib/systemd/system
9+
mkdir -p "multi-user.target.d"
10+
{ echo "[Unit]"; echo "Upholds=incus.service"; } > "multi-user.target.d/10-incus.conf"
11+
popd
12+
13+
mkdir -p ./usr/lib/tmpfiles.d
14+
pushd ./usr/lib/tmpfiles.d
15+
cat <<EOF >./10-incus.conf
16+
d /var/lib/lxc/rootfs 0755 root root - -
17+
w+ /etc/subuid - - - - root:1065536:65536
18+
w+ /etc/subgid - - - - root:1065536:65536
19+
EOF
20+
popd
21+
22+
# Add 'core' user to 'incus-admin' group to avoid prefixing
23+
# all commands with sudo.
24+
mkdir -p ./usr/lib/userdb/
25+
echo " " > ./usr/lib/userdb/core:incus-admin.membership
26+
27+
popd
28+

0 commit comments

Comments
 (0)