@@ -118,6 +118,16 @@ else
118
118
ln -f -s /usr/bin/podman.orig /home/tooling/.local/bin/podman
119
119
fi
120
120
121
+ # Configure container builds to use vfs or fuse-overlayfs
122
+ if [ ! -d " ${HOME} /.config/containers" ]; then
123
+ mkdir -p ${HOME} /.config/containers
124
+ if [ -c " /dev/fuse" ] && [ -f " /usr/bin/fuse-overlayfs" ]; then
125
+ (echo ' [storage]' ; echo ' driver = "overlay"' ; echo ' [storage.options.overlay]' ; echo ' mount_program = "/usr/bin/fuse-overlayfs"' ) > ${HOME} /.config/containers/storage.conf
126
+ else
127
+ (echo ' [storage]' ; echo ' driver = "vfs"' ) > " ${HOME} " /.config/containers/storage.conf
128
+ fi
129
+ fi
130
+
121
131
# ############################################################################
122
132
# Stow: If persistUserHome is enabled, then the contents of /home/user/
123
133
# will be mounted by a PVC and overwritten. In this case, we use stow to
@@ -135,6 +145,32 @@ mountpoint -q /home/user/ || HOME_USER_MOUNTED=$?
135
145
STOW_COMPLETE=/home/user/.stow_completed
136
146
137
147
if [ $HOME_USER_MOUNTED -eq 0 ] && [ ! -f $STOW_COMPLETE ]; then
148
+ # There may be regular, non-symlink files in /home/user that match the
149
+ # pathing of files in /home/tooling. Stow will error out when it tries to
150
+ # stow on top of that. Instead, we can append to the current
151
+ # /home/tooling/.stow-local-ignore file to ignore pre-existing,
152
+ # non-symlinked files in /home/user that match those in /home/tooling before
153
+ # we run stow.
154
+ #
155
+ # Create two text files containing a sorted path-based list of files in
156
+ # /home/tooling and /home/user. Cut off "/home/user" and "/home/tooling" and
157
+ # only get the sub-paths so we can do a proper comparison
158
+ #
159
+ # In the case of /home/user, we want regular file types and not symbolic
160
+ # links.
161
+ find /home/user -type f -xtype f -print | sort | sed ' s|/home/user||g' > /tmp/user.txt
162
+ find /home/tooling -print | sort | sed ' s|/home/tooling||g' > /tmp/tooling.txt
163
+ # We compare the two files, trying to find files that exist in /home/user
164
+ # and /home/tooling. Being that the files that get flagged here are not
165
+ # already synlinks, we will want to ignore them.
166
+ IGNORE_FILES=" $( comm -12 /tmp/user.txt /tmp/tooling.txt) "
167
+ # We no longer require the file lists, so remove them
168
+ rm /tmp/user.txt /tmp/tooling.txt
169
+ # For each file we need to ignore, append them to
170
+ # /home/tooling/.stow-local-ignore.
171
+ for f in $IGNORE_FILES ; do echo " ${f} " >> /home/tooling/.stow-local-ignore; done
172
+ # We are now ready to run stow
173
+ #
138
174
# Create symbolic links from /home/tooling/ -> /home/user/
139
175
stow . -t /home/user/ -d /home/tooling/ --no-folding -v 2 > /tmp/stow.log 2>&1
140
176
# Vim does not permit .viminfo to be a symbolic link for security reasons, so manually copy it
0 commit comments