File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed
pkg/cidata/cidata.TEMPLATE.d/boot Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -4,6 +4,18 @@ set -eux
4
4
# This script does not work unless systemd is available
5
5
command -v systemctl > /dev/null 2>&1 || exit 0
6
6
7
+ if [ -O " ${LIMA_CIDATA_HOME} " ]; then
8
+ # Fix ownership of the user home directory when created by root.
9
+ # In cases where mount points exist in the user's home directory, the home directory and
10
+ # the mount points are created by root before the user is created. This leads to the home
11
+ # directory being owned by root.
12
+ # Following commands fix the ownership of the home directory and its contents (on the same filesystem)
13
+ # is updated to the correct user.
14
+ # shellcheck disable=SC2046 # it fails if find results are quoted.
15
+ chown " ${LIMA_CIDATA_USER} " $( find " ${LIMA_CIDATA_HOME} " -xdev) ||
16
+ true # Ignore errors because changing owner of the mount points may fail but it is not critical.
17
+ fi
18
+
7
19
# Set up env
8
20
for f in .profile .bashrc .zshrc; do
9
21
if ! grep -q " # Lima BEGIN" " ${LIMA_CIDATA_HOME} /$f " ; then
You can’t perform that action at this time.
0 commit comments