Skip to content

Commit 3a0bb91

Browse files
committed
cidata: update /etc/fuse.conf earlier
Signed-off-by: Akihiro Suda <[email protected]>
1 parent 33df81f commit 3a0bb91

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

pkg/cidata/cidata.TEMPLATE.d/boot/30-install-packages.sh

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,23 @@
11
#!/bin/sh
22
set -eux
33

4+
update_fuse_conf(){
5+
# Modify /etc/fuse.conf to allow "-o allow_root"
6+
if [ "${LIMA_CIDATA_MOUNTS}" -gt 0 ]; then
7+
if ! grep -q "^user_allow_other" /etc/fuse.conf ; then
8+
echo "user_allow_other" >> /etc/fuse.conf
9+
fi
10+
fi
11+
}
12+
413
# Install minimum dependencies
514
if command -v apt-get 2>&1 >/dev/null; then
615
DEBIAN_FRONTEND=noninteractive
716
export DEBIAN_FRONTEND
817
apt-get update
918
if [ "${LIMA_CIDATA_MOUNTS}" -gt 0 ]; then
1019
apt-get install -y sshfs
20+
update_fuse_conf
1121
fi
1222
if [ "${LIMA_CIDATA_CONTAINERD_SYSTEM}" = 1 ] || [ "${LIMA_CIDATA_CONTAINERD_USER}" = 1 ]; then
1323
apt-get install -y iptables
@@ -18,6 +28,7 @@ if command -v apt-get 2>&1 >/dev/null; then
1828
elif command -v dnf 2>&1 >/dev/null; then
1929
if [ "${LIMA_CIDATA_MOUNTS}" -gt 0 ]; then
2030
dnf install -y fuse-sshfs
31+
update_fuse_conf
2132
fi
2233
if [ "${LIMA_CIDATA_CONTAINERD_SYSTEM}" = 1 ] || [ "${LIMA_CIDATA_CONTAINERD_USER}" = 1 ]; then
2334
dnf install -y iptables
@@ -35,13 +46,8 @@ elif command -v apk 2>&1 >/dev/null; then
3546
apk update
3647
apk add sshfs
3748
fi
49+
update_fuse_conf
3850
modprobe fuse
3951
fi
4052
fi
41-
# Modify /etc/fuse.conf to allow "-o allow_root"
4253

43-
if [ "${LIMA_CIDATA_MOUNTS}" -gt 0 ]; then
44-
if ! grep -q "^user_allow_other" /etc/fuse.conf ; then
45-
echo "user_allow_other" >> /etc/fuse.conf
46-
fi
47-
fi

0 commit comments

Comments
 (0)