From: Kairui Song Date: Fri, 11 Jun 2021 18:25:09 +0000 (+0800) Subject: fix(dracut.sh): handle symlinks appropriately while using '-i' option X-Git-Tag: 056~142 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=c7fbc0c8901917baf0d1f0822568e65c6ec00d18;p=thirdparty%2Fdracut.git 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 --- diff --git a/dracut.sh b/dracut.sh index e7f47752c..78917763b 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