Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

find_linux_proc_banner does not work on Debian #24

Closed
pali opened this issue Jan 7, 2018 · 1 comment
Closed

find_linux_proc_banner does not work on Debian #24

pali opened this issue Jan 7, 2018 · 1 comment

Comments

@pali
Copy link

pali commented Jan 7, 2018

On Debian systems standard awk command does not support strtonum function. Probably it is just GNU extension which is available in gawk (GNU awk).

Starting ./run.sh just show follwing error:

looking for linux_proc_banner in /proc/kallsyms
awk: line 7: function strtonum never defined

Here is patch which implements find_linux_proc_banner function in more compatible way:

diff --git a/run.sh b/run.sh
index 39419b7..e6629b7 100755
--- a/run.sh
+++ b/run.sh
@@ -1,12 +1,7 @@
 #!/bin/sh
 
 find_linux_proc_banner() {
-	$2 awk '
-	/linux_proc_banner/ {
-		if (strtonum("0x"$1))
-			print $1;
-		exit 0;
-	}' $1
+	$2 sed -n -E 's/^([0-9a-f]+) .* linux_proc_banner$/\1/p' $1
 }
 
 echo "looking for linux_proc_banner in /proc/kallsyms"
@paboldin
Copy link
Owner

paboldin commented Jan 8, 2018

Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants