Openembedded Core Discussions
 help / color / mirror / Atom feed
From: Richard Purdie <richard.purdie@linuxfoundation.org>
To: Robert Yang <liezhi.yang@windriver.com>
Cc: openembedded-core@lists.openembedded.org
Subject: Re: [PATCH 2/2] sanity.bbclass: check that TMPDIR is not located on nfs
Date: Fri, 01 Nov 2013 10:40:24 +0000	[thread overview]
Message-ID: <1383302424.25877.134.camel@ted> (raw)
In-Reply-To: <d79dba30a0175bd4344ba595cfce74e465f9a148.1383326626.git.liezhi.yang@windriver.com>

On Sat, 2013-11-02 at 01:26 +0800, Robert Yang wrote:
> There would be some unexpected errors when the whole TMPDIR is located
> on nfs, so add a test for it in sanity.bbclass.
> 
> Note:
> The better way to get the filesystem id should be get f_fsid from struct
> statvfs, but there is no f_fsid in os.stat() or os.statvfs(), so we use
> 'stat -f -c "%t"' here.
> 
> [YOCTO #5442]
> 
> Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
> ---
>  meta/classes/sanity.bbclass | 18 ++++++++++++++++++
>  1 file changed, 18 insertions(+)

Why does this need to run every build? It doesn't so don't do that
please.

Cheers,

Richard

> diff --git a/meta/classes/sanity.bbclass b/meta/classes/sanity.bbclass
> index c4827f4..7517120 100644
> --- a/meta/classes/sanity.bbclass
> +++ b/meta/classes/sanity.bbclass
> @@ -198,6 +198,21 @@ def check_path_length(filepath, pathname, limit):
>          return "The length of %s is longer than 410, this would cause unexpected errors, please use a shorter path.\n" % pathname
>      return ""
>  
> +def get_filesystem_id(path):
> +    status, result = oe.utils.getstatusoutput("stat -f -c '%s' %s" % ("%t", path))
> +    if status == 0:
> +        return result
> +    else:
> +        bb.warn("Can't get the filesystem id of: %s" % path)
> +        return None
> +
> +# Check that the path isn't located on nfs.
> +def check_not_nfs(path, name):
> +    # The nfs' filesystem id is 6969
> +    if get_filesystem_id(path) == "6969":
> +        return "The %s can't be located on nfs.\n" % name
> +    return ""
> +
>  def check_connectivity(d):
>      # URI's to check can be set in the CONNECTIVITY_CHECK_URIS variable
>      # using the same syntax as for SRC_URI. If the variable is not set
> @@ -672,6 +687,9 @@ def check_sanity_everybuild(status, d):
>      # The length of TMPDIR can't be longer than 410
>      status.addresult(check_path_length(tmpdir, "TMPDIR", 410))
>  
> +    # Check that TMPDIR isn't located on nfs
> +    status.addresult(check_not_nfs(tmpdir, "TMPDIR"))
> +
>  def check_sanity(sanity_data):
>      import subprocess
>  




      reply	other threads:[~2013-11-01 10:40 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-01 17:26 [PATCH 0/2] sanity.bbclass: check that TMPDIR is not located on nfs Robert Yang
2013-11-01 17:26 ` [PATCH 1/2] sanity.bbclass: move check_path_length(TMPDIR) to check_sanity_everybuild Robert Yang
2013-11-01 10:39   ` Richard Purdie
2013-11-01 17:26 ` [PATCH 2/2] sanity.bbclass: check that TMPDIR is not located on nfs Robert Yang
2013-11-01 10:40   ` Richard Purdie [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1383302424.25877.134.camel@ted \
    --to=richard.purdie@linuxfoundation.org \
    --cc=liezhi.yang@windriver.com \
    --cc=openembedded-core@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox