]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
fix: shellcheck for modules.d/90dmsquash-live/apply-live-updates.sh
authorHarald Hoyer <harald@redhat.com>
Fri, 12 Feb 2021 12:26:11 +0000 (13:26 +0100)
committerHarald Hoyer <harald@hoyer.xyz>
Mon, 15 Feb 2021 10:00:37 +0000 (11:00 +0100)
modules.d/90dmsquash-live/apply-live-updates.sh

index 838445ef28bb9ad6d7ab5fc3820b03ff5fc5a64a..6c1d048572af3ee138052fc7f8d2906e80b93dff 100755 (executable)
@@ -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 ] &&