From c7fbc0c8901917baf0d1f0822568e65c6ec00d18 Mon Sep 17 00:00:00 2001 From: Kairui Song Date: Sat, 12 Jun 2021 02:25:09 +0800 Subject: [PATCH] fix(dracut.sh): handle symlinks appropriately while using '-i' option [[ -d $symlink ]] will return true if the symlink points to a directory. So the symlink will not be copied, instead a directory is created with the symlink name and the content is copied. Signed-off-by: Kairui Song --- dracut.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dracut.sh b/dracut.sh index e7f47752c2..78917763b6 100755 --- a/dracut.sh +++ b/dracut.sh @@ -2071,7 +2071,7 @@ for ((i = 0; i < ${#include_src[@]}; i++)); do shopt -q -s dotglob for objectname in "$src"/*; do [[ -e $objectname || -L $objectname ]] || continue - if [[ -d $objectname ]]; then + if [[ -d $objectname ]] && [[ ! -L $objectname ]]; then # objectname is a directory, let's compute the final directory name object_destdir=${destdir}/${objectname#$src/} if ! [[ -e $object_destdir ]]; then