[make-initrd] [PATCH v1 16/41] fork pipeline: waitdev: get_dev_wpfx() function added

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


---
  .../data/lib/uevent/filters/bootchain-waitdev | 19 ++++++++++++++++++-
  1 file changed, 18 insertions(+), 1 deletion(-)

diff --git 
a/make-initrd/features/bootchain-waitdev/data/lib/uevent/filters/bootchain-waitdev 
b/make-initrd/features/bootchain-waitdev/data/lib/uevent/filters/bootchain-waitdev
index 272aee7..13d90fa 100755
--- 
a/make-initrd/features/bootchain-waitdev/data/lib/uevent/filters/bootchain-waitdev
+++ 
b/make-initrd/features/bootchain-waitdev/data/lib/uevent/filters/bootchain-waitdev
@@ -3,6 +3,23 @@
  . /.initrd/initenv
  . initrd-sh-functions
  +get_dev_wpfx()
+{
+	local retval="$1" name="$2"
+
+	case "$name" in
+	CDROM:*)
+		[ "${ID_CDROM-}" = 1 ] ||
+		[ "${ID_FS_TYPE-}" = iso9660 ] ||
+			return 1
+		name="${name#CDROM:}"
+		name="${name:-/dev/sr0}"
+		;;
+	esac
+
+	get_dev "$retval" "$name"
+}
+
  mkdir -p -- /.initrd/bootchain/waitdev
  cd /.initrd/bootchain/waitdev/
  @@ -10,7 +27,7 @@ i=0
  while [ "$i" -lt "${WAITDEV:-0}" ]; do
  	eval "spec=\"\${WAITDEV$i-}\""
  -	if [ -n "$spec" ] && get_dev dev "$spec"; then
+	if [ -n "$spec" ] && get_dev_wpfx dev "$spec"; then
  		printf '%s\n' "$dev" > "$i"
  	fi
  -- 2.21.0




More information about the Make-initrd mailing list