Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.kernel > #78020 > unrolled thread

[PATCH] hook-functions: dep_add_modules_mount: kill unreadable eval

Started byMasahiro Yamada <masahiroy@kernel.org>
First post2023-01-23 06:00 +0100
Last post2023-01-23 06:00 +0100
Articles 1 — 1 participant

Back to article view | Back to linux.debian.kernel


Contents

  [PATCH] hook-functions: dep_add_modules_mount: kill unreadable eval Masahiro Yamada <masahiroy@kernel.org> - 2023-01-23 06:00 +0100

#78020 — [PATCH] hook-functions: dep_add_modules_mount: kill unreadable eval

FromMasahiro Yamada <masahiroy@kernel.org>
Date2023-01-23 06:00 +0100
Subject[PATCH] hook-functions: dep_add_modules_mount: kill unreadable eval
Message-ID<FQX61-uMB-7@gated-at.bofh.it>
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.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---
 hook-functions | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/hook-functions b/hook-functions
index 95bd584..fa49990 100644
--- a/hook-functions
+++ b/hook-functions
@@ -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.
-- 
2.34.1

[toc] | [standalone]


Back to top | Article view | linux.debian.kernel


csiph-web