From: Harald Hoyer Date: Fri, 12 Feb 2021 12:26:11 +0000 (+0100) Subject: fix: shellcheck for modules.d/90dmsquash-live/apply-live-updates.sh X-Git-Tag: 052~48 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=7b1d342e6037579dc691f414f056880e6bdef31f;p=thirdparty%2Fdracut.git fix: shellcheck for modules.d/90dmsquash-live/apply-live-updates.sh --- diff --git a/modules.d/90dmsquash-live/apply-live-updates.sh b/modules.d/90dmsquash-live/apply-live-updates.sh index 838445ef2..6c1d04857 100755 --- a/modules.d/90dmsquash-live/apply-live-updates.sh +++ b/modules.d/90dmsquash-live/apply-live-updates.sh @@ -2,21 +2,17 @@ if [ -h /dev/root ] && [ -d /run/initramfs/live/updates -o -d /updates ]; then info "Applying updates to live image..." - mount -o bind /run $NEWROOT/run + mount -o bind /run "$NEWROOT"/run # avoid overwriting symlinks (e.g. /lib -> /usr/lib) with directories for d in /updates /run/initramfs/live/updates; do [ -d "$d" ] || continue ( - cd $d - find . -depth -type d | while read dir; do - mkdir -p "$NEWROOT/$dir" - done - find . -depth \! -type d | while read file; do - cp -a "$file" "$NEWROOT/$file" - done + cd "$d" || return 0 + find . -depth -type d -exec mkdir -p "$NEWROOT/{}" \; + find . -depth \! -type d -exec cp -a "{}" "$NEWROOT/{}" \; ) done - umount $NEWROOT/run + umount "$NEWROOT"/run fi # release resources on iso-scan boots with rd.live.ram if [ -d /run/initramfs/isoscan ] &&