Skip to contentSkip to conversation

volatile-binds: Change cp to use -a instead of -p.

PATCH New [email protected] 1 participant 1 message Jun 17, 2019

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 volatile-binds: Change cp to use -a instead of -p.

From: Chris PeBenito <[email protected]>

This is needed on SELinux systems, so the labels (xattrs) are preserved.

---
 meta/recipes-core/volatile-binds/files/mount-copybind | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
meta/recipes-core/volatile-binds/files/mount-copybind +2 -2
index fddf520053..e32e675308 100755
@@ -42,14 +42,14 @@ if [ -d "$mountpoint" ]; then
     if ! mount -t overlay overlay -olowerdir="$mountpoint",upperdir="$spec",workdir="$overlay_workdir" "$mountpoint" > /dev/null 2>&1; then
 
         if [ "$specdir_existed" != "yes" ]; then
-            cp -pPR "$mountpoint"/. "$spec/"
+            cp -aPR "$mountpoint"/. "$spec/"
         fi
 
         mount -o "bind$options" "$spec" "$mountpoint"
     fi
 elif [ -f "$mountpoint" ]; then
     if [ ! -f "$spec" ]; then
-        cp -pP "$mountpoint" "$spec"
+        cp -aP "$mountpoint" "$spec"
     fi
 
     mount -o "bind$options" "$spec" "$mountpoint"
Signature · 1 line
2.20.1