summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVyacheslav Yurkov <v.yurkov@precitec.de>2022-06-01 21:30:11 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2022-06-04 11:27:09 +0100
commitb19b734ec3c031ee594229e728ee077cd58b34a9 (patch)
treec9f8b1cb52d523b2ba41379116f9f0b9b8eb2e90
parent86a457016e7f3fc7acacf86cd87f5d8d882132dd (diff)
downloadopenembedded-core-contrib-b19b734ec3c031ee594229e728ee077cd58b34a9.tar.gz
files: respect overlayfs owner from lower layer
Permission model of overlayfs uses permissions/ownership from the upper layer after mounting. Fix up UID/GID of the upper layer, when lower layer already uses something custom. Signed-off-by: Vyacheslav Yurkov <v.yurkov@precitec.de> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/files/overlayfs-create-dirs.sh3
1 files changed, 3 insertions, 0 deletions
diff --git a/meta/files/overlayfs-create-dirs.sh b/meta/files/overlayfs-create-dirs.sh
index 06c7587a6bb..9954c343521 100644
--- a/meta/files/overlayfs-create-dirs.sh
+++ b/meta/files/overlayfs-create-dirs.sh
@@ -6,3 +6,6 @@ lowerdir=$1
datamountpoint=$2
mkdir -p ${datamountpoint}/upper${lowerdir}
mkdir -p ${datamountpoint}/workdir${lowerdir}
+if [ -d "$lowerdir" ]; then
+ chown $(stat -c "%U:%G" ${lowerdir}) ${datamountpoint}/upper${lowerdir}
+fi