Patchwork [v2,7/7] sanity.bbclass: Check for /proc/sys/vm/mmap_min_addr to be >= 65536

login
register
mail settings
Submitter Khem Raj
Date March 2, 2011, 8:37 a.m.
Message ID <1299055045-8096-8-git-send-email-raj.khem@gmail.com>
Download mbox | patch
Permalink /patch/961/
State Superseded
Headers show

Comments

Khem Raj - March 2, 2011, 8:37 a.m.
* Now qemu can handle lower values we can chnage this sanity test
  to check of values if less than 65536

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 meta/classes/sanity.bbclass |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
Tom Rini - March 2, 2011, 10:23 p.m.
On 03/02/2011 01:37 AM, Khem Raj wrote:
> * Now qemu can handle lower values we can chnage this sanity test
>    to check of values if less than 65536
>
> Signed-off-by: Khem Raj<raj.khem@gmail.com>
> ---
>   meta/classes/sanity.bbclass |    4 ++--
>   1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/meta/classes/sanity.bbclass b/meta/classes/sanity.bbclass
> index 13940f8..4fba852 100644
> --- a/meta/classes/sanity.bbclass
> +++ b/meta/classes/sanity.bbclass
> @@ -171,8 +171,8 @@ def check_sanity(e):
>           try:
>               if os.path.exists("/proc/sys/vm/mmap_min_addr"):
>                   f = file("/proc/sys/vm/mmap_min_addr", "r")
> -                if (f.read().strip() != "0"):
> -                        messages = messages + "/proc/sys/vm/mmap_min_addr is not 0. This will cause problems with qemu so please fix the value (as root).\n\nTo fix this in later reboots, set vm.mmap_min_addr = 0 in /etc/sysctl.conf.\n"
> +                if (int(f.read().strip())<  65536):
> +                        messages = messages + "/proc/sys/vm/mmap_min_addr is not>= 65536. This will cause problems with qemu so please fix the value (as root).\n\nTo fix this in later reboots, set vm.mmap_min_addr = 65536 in /etc/sysctl.conf.\n"
>                   f.close()
>           except:
>               pass

Does this work or fail in the case where the file is unreadable?  IIRC 
that's the case in certain cases.

Patch

diff --git a/meta/classes/sanity.bbclass b/meta/classes/sanity.bbclass
index 13940f8..4fba852 100644
--- a/meta/classes/sanity.bbclass
+++ b/meta/classes/sanity.bbclass
@@ -171,8 +171,8 @@  def check_sanity(e):
         try:
             if os.path.exists("/proc/sys/vm/mmap_min_addr"):
                 f = file("/proc/sys/vm/mmap_min_addr", "r")
-                if (f.read().strip() != "0"):
-                        messages = messages + "/proc/sys/vm/mmap_min_addr is not 0. This will cause problems with qemu so please fix the value (as root).\n\nTo fix this in later reboots, set vm.mmap_min_addr = 0 in /etc/sysctl.conf.\n"
+                if (int(f.read().strip()) < 65536):
+                        messages = messages + "/proc/sys/vm/mmap_min_addr is not >= 65536. This will cause problems with qemu so please fix the value (as root).\n\nTo fix this in later reboots, set vm.mmap_min_addr = 65536 in /etc/sysctl.conf.\n"
                 f.close()
         except:
             pass