From 06fe647ff578cf281e56302ddb60f0bde98577e8 Mon Sep 17 00:00:00 2001 From: Jonathan Bauer Date: Tue, 11 Feb 2020 16:07:22 +0100 Subject: chroot.inc: do not create empty overlay lists --- core/includes/chroot.inc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/core/includes/chroot.inc b/core/includes/chroot.inc index 87167fa2..d5a404c5 100644 --- a/core/includes/chroot.inc +++ b/core/includes/chroot.inc @@ -164,14 +164,13 @@ chroot_handle_whiteouts() { local WHITEOUT_LIST="${CHROOT_UPPERDIR}/overlay.whiteout.list" rm -f -- "$WHITEOUT_LIST" mkdir -p "$(dirname "$WHITEOUT_LIST")" || perror "Could not create $(dirname "$WHITEOUT_LIST")" - touch "$WHITEOUT_LIST" || perror "Could not touch whiteout list $WHITEOUT_LIST" pdebug "Searching for overlayfs-whiteouts ..." for WHITEOUT in $(find "$CHROOT_UPPERDIR" \( -type c -perm 0000 \) -o -lname "(overlay-whiteout)"); do pdebug "Whiteout found: $WHITEOUT" echo "/./${WHITEOUT#$CHROOT_UPPERDIR}" >> "$WHITEOUT_LIST" rm -f -- "$WHITEOUT" || perror "Could not delete whiteout $WHITEOUT!" done - pinfo "Whiteout list dumped to '${CHROOT_UPPERDIR}/overlay.whiteout.list'" + [ -s "$WHITEOUT_LIST" ] && pinfo "Whiteout list dumped to '${CHROOT_UPPERDIR}/overlay.whiteout.list'" } ############################################################################### -- cgit v1.2.3-55-g7522