Skip to contentSkip to conversation

hook-functions: dep_add_modules_mount: kill unreadable eval

PATCH New Masahiro Yamada 1 participant 1 message Jan 23, 2023

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 hook-functions: dep_add_modules_mount: kill unreadable eval

The 'eval' is here because we evaluated the code returned by AWK.

Commit 9249db649ced ("MODULES=dep: awk free version for root dev search") stopped using AWK, so 'eval' is unneeded.

---
 hook-functions | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)
hook-functions +7 -4
index 95bd584..fa49990 100644
@@ -416,10 +416,13 @@ dep_add_modules_mount()
 
 	# find out block device + fstype
 	# shellcheck disable=SC2034
-	eval "$(while read -r dev mp fs opts rest ; do \
-		[ "$mp" = "$dir" ] && [ "$fs" != "rootfs" ] \
-		&& printf "dev_node=%s\\nFSTYPE=%s" "$dev" "$fs"\
-		&& break; done < /proc/mounts)"
+	while read -r dev mp fs opts rest; do \
+		if [ "$mp" = "$dir" ] && [ "$fs" != "rootfs" ]; then
+			dev_node=$dev
+			FSTYPE=$fs
+			break;
+		fi
+	done < /proc/mounts
 
 	# Only the root mountpoint has to exist; do nothing if any other
 	# directory is not a mountpoint.