From aa096cde197544bbb4e002f6c4809e61c4a2ae79 Mon Sep 17 00:00:00 2001 From: Jacques de Laval Date: Sat, 27 Feb 2021 18:27:26 +0100 Subject: [PATCH] test: Only copy /tmp contents if there are any Signed-off-by: Jacques de Laval --- test/tenv/chrootsetup.sh | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/test/tenv/chrootsetup.sh b/test/tenv/chrootsetup.sh index 457c9ec5..86951846 100755 --- a/test/tenv/chrootsetup.sh +++ b/test/tenv/chrootsetup.sh @@ -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"