···122 checkPath="$(dirname "$checkPath")"
123done
12400000000125# Verify that user is not trying to use attribute building and flake
126# at the same time
127if [[ -z $buildingAttribute && -n $flake ]]; then
···122 checkPath="$(dirname "$checkPath")"
123done
124125+# Check if the mount point root directory is owned by root
126+if [[ "$(stat -c '%u:%g' "$mountPoint")" != "0:0" ]]; then
127+ echo "$0: $mountPoint is not owned by root:root (owned by $(stat -c '%U:%G' "$mountPoint"))"
128+ echo "$0: installation root directory must be owned by root to avoid system issues"
129+ echo "$0: run 'sudo chown root:root $mountPoint' to fix this"
130+ exit 1
131+fi
132+133# Verify that user is not trying to use attribute building and flake
134# at the same time
135if [[ -z $buildingAttribute && -n $flake ]]; then