From 98bc0a31e1c26c9edb0a70a5c6972c9ace194918 Mon Sep 17 00:00:00 2001 From: Marc Bonnici Date: Wed, 4 Nov 2020 17:56:12 +0000 Subject: [PATCH] target/page_size_kb: Handle missing KernelPageSize On some systems KernelPageSize is not exported therefore in this case return 0. --- devlib/target.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/devlib/target.py b/devlib/target.py index 82b2dc8..21cd68a 100644 --- a/devlib/target.py +++ b/devlib/target.py @@ -215,7 +215,7 @@ class Target(object): @memoized def page_size_kb(self): cmd = "cat /proc/self/smaps | {0} grep KernelPageSize | {0} head -n 1 | {0} awk '{{ print $2 }}'" - return int(self.execute(cmd.format(self.busybox))) + return int(self.execute(cmd.format(self.busybox)) or 0) @property def shutils(self):