Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
lima-vm
GitHub Repository: lima-vm/lima
Path: blob/master/pkg/cidata/cidata.TEMPLATE.d/boot/35-setup-packages.sh
2655 views
1
#!/bin/sh
2
3
# SPDX-FileCopyrightText: Copyright The Lima Authors
4
# SPDX-License-Identifier: Apache-2.0
5
6
set -eux
7
8
update_fuse_conf() {
9
# Modify /etc/fuse.conf (/etc/fuse3.conf) to allow "-o allow_root"
10
if [ "${LIMA_CIDATA_MOUNTS}" -gt 0 ]; then
11
fuse_conf="/etc/fuse.conf"
12
if [ -e /etc/fuse3.conf ]; then
13
fuse_conf="/etc/fuse3.conf"
14
fi
15
if ! grep -q "^user_allow_other" "${fuse_conf}"; then
16
echo "user_allow_other" >>"${fuse_conf}"
17
fi
18
fi
19
}
20
21
# update_fuse_conf has to be called after installing all the packages,
22
# otherwise apt-get fails with conflict
23
if [ "${LIMA_CIDATA_MOUNTTYPE}" = "reverse-sshfs" ]; then
24
update_fuse_conf
25
fi
26
27
SETUP_DNS=0
28
if [ -n "${LIMA_CIDATA_UDP_DNS_LOCAL_PORT}" ] && [ "${LIMA_CIDATA_UDP_DNS_LOCAL_PORT}" -ne 0 ]; then
29
SETUP_DNS=1
30
fi
31
if [ -n "${LIMA_CIDATA_TCP_DNS_LOCAL_PORT}" ] && [ "${LIMA_CIDATA_TCP_DNS_LOCAL_PORT}" -ne 0 ]; then
32
SETUP_DNS=1
33
fi
34
if [ "${SETUP_DNS}" = 1 ]; then
35
# Try to setup iptables rule again, in case we just installed iptables
36
"${LIMA_CIDATA_MNT}/boot/09-host-dns-setup.sh"
37
fi
38
39