From 7b1d342e6037579dc691f414f056880e6bdef31f Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Fri, 12 Feb 2021 13:26:11 +0100 Subject: [PATCH] fix: shellcheck for modules.d/90dmsquash-live/apply-live-updates.sh --- modules.d/90dmsquash-live/apply-live-updates.sh | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) 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 ] && -- 2.47.3