Skip to content

Commit 385f3fe

Browse files
committed
bind-dirs: fix /rw/home and /rw/usrlocal initialization from template files
1 parent ff6742c commit 385f3fe

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

vm-systemd/bind-dirs.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,10 @@ bind_dirs() {
117117
else
118118
if [ -d "$fso_ro" ] || [ -f "$fso_ro" ]; then
119119
## Initially copy over data directories to /rw if rw directory does not exist.
120-
echo "Initializing $rw_dest_dir with files from $fso_ro" >&2
121-
cp --archive --recursive --parents "$fso_ro" "$rw_dest_dir"
120+
echo "Initializing $fso_rw with files from $fso_ro" >&2
121+
parent_directory="$(dirname "$fso_rw")"
122+
test -d "$parent_directory" || mkdir --parents "$parent_directory"
123+
cp --archive --recursive "$fso_ro" "$fso_rw"
122124
else
123125
echo "$fso_ro is neither a directory nor a file and the path does not exist below /rw, skipping."
124126
continue

0 commit comments

Comments
 (0)