test: Only copy /tmp contents if there are any

Signed-off-by: Jacques de Laval <jacques@de-laval.se>
This commit is contained in:
Jacques de Laval
2021-02-27 18:27:26 +01:00
parent 7c45fd451e
commit aa096cde19
+8 -4
View File
@@ -10,10 +10,14 @@ mount -n -t tmpfs none /dev
mount -t proc none /proc
mount -t sysfs none /sys
mkdir -p /tmp.shadow
mount --bind /tmp /tmp.shadow
mount -t tmpfs none /tmp
cp -a /tmp.shadow/* /tmp/
if [ "$(ls -A /tmp)" ]; then
mkdir -p /tmp.shadow
mount --bind /tmp /tmp.shadow
mount -t tmpfs none /tmp
cp -a /tmp.shadow/* /tmp/
else
mount -t tmpfs none /tmp
fi
mkdir -p "$FINIT_RCSD"