[make-initrd] [PATCH v1 18/41] fork pipeline: waitdev: infinite loop fixed, DEVNAME added

Leonid Krivoshein klark.devel at gmail.com
Fri Sep 24 18:57:24 MSK 2021


---
  .../bootchain-waitdev/data/lib/bootchain/waitdev       | 10 +++++++---
  1 file changed, 7 insertions(+), 3 deletions(-)

diff --git 
a/make-initrd/features/bootchain-waitdev/data/lib/bootchain/waitdev 
b/make-initrd/features/bootchain-waitdev/data/lib/bootchain/waitdev
index 74af6ea..60464d9 100755
--- a/make-initrd/features/bootchain-waitdev/data/lib/bootchain/waitdev
+++ b/make-initrd/features/bootchain-waitdev/data/lib/bootchain/waitdev
@@ -13,12 +13,16 @@ while [ -n "$devspec" ]; do
  		read -r devfile < "$envfile" ||:
   		if [ -n "$devfile" ]; then
-			if [ ! -e "$destdir/dev" ]; then
-				target="$(readlink-e "$devfile")"
+			target="$(readlink-e "$devfile" 2>/dev/null ||:)"
+
+			if [ -b "$target" ] || [ -c "$target" ]; then
+				message "target device found: $target"
+				printf '%s\n' "$target" > "$destdir/DEVNAME"
  				run cp -a -- "$target" "$destdir/dev"
+				break
  			fi
-			break
  		fi
  	fi
+
  	sleep 1
  done
-- 
2.21.0




More information about the Make-initrd mailing list