All of lore.kernel.org
 help / color / mirror / Atom feed
From: Saul Wold <sgw@linux.intel.com>
To: Patches and discussions about the oe-core layer
	<openembedded-core@lists.openembedded.org>
Subject: Re: [PATCH] sanity.bbclass: check user can read and write to SSTATE_DIR
Date: Fri, 18 May 2012 08:39:01 +0300	[thread overview]
Message-ID: <4FB5E075.60402@linux.intel.com> (raw)
In-Reply-To: <1336784426-22337-1-git-send-email-josh@linux.intel.com>

On 05/12/2012 04:00 AM, Joshua Lock wrote:
> The user needs read and write permissions to SSTATE_DIR, check
> whether they have sufficient permissions and if not recommend
> use of SSTATE_MIRRORS.
>
> Signed-off-by: Joshua Lock<josh@linux.intel.com>
> ---
>   meta/classes/sanity.bbclass |   17 ++++++++++++++---
>   1 files changed, 14 insertions(+), 3 deletions(-)
>
> diff --git a/meta/classes/sanity.bbclass b/meta/classes/sanity.bbclass
> index 05545f4..ff3c413 100644
> --- a/meta/classes/sanity.bbclass
> +++ b/meta/classes/sanity.bbclass
> @@ -96,10 +96,16 @@ def check_conf_exists(fn, data):
>   def check_sanity_sstate_dir_change(sstate_dir, data):
>       # Sanity checks to be done when the value of SSTATE_DIR changes
>
> -    # Check that SSTATE_DIR isn't on a filesystem with limited filename length (eg. eCryptFS)
>       testmsg = ""
>       if sstate_dir != "":
> -        testmsg = check_create_long_filename(sstate_dir, "SSTATE_DIR")
> +        # Check that the user can read and write to SSTATE_DIR
> +        sstatemsg = check_can_read_write_directory(sstate_dir) or None
> +        if sstatemsg:
> +            sstatemsg = sstatemsg + ". You could try using it as an SSTATE_MIRRORS instead of SSTATE_CACHE.\n"
> +            testmsg = testmsg + sstatemsg
> +        # Check that SSTATE_DIR isn't on a filesystem with limited filename length (eg. eCryptFS)
> +        testmsg = testmsg + check_create_long_filename(sstate_dir, "SSTATE_DIR")
> +
>       return testmsg
>
>   def check_sanity_tmpdir_change(tmpdir, data):
> @@ -150,7 +156,12 @@ def check_create_long_filename(filepath, pathname):
>           if errno == 36: # ENAMETOOLONG
>               return "Failed to create a file with a long name in %s. Please use a filesystem that does not unreasonably limit filename length.\n" % pathname
>           else:
> -            return "Failed to create a file in %s: %s" % (pathname, strerror)
> +            return "Failed to create a file in %s: %s\n" % (pathname, strerror)
> +    return ""
> +
> +def check_can_read_write_directory(directory):
> +    if not os.access(directory, os.R_OK|os.W_OK):
> +       return "Insufficient permissions for %s" % directory
>       return ""
>
>   def check_connectivity(d):


Merged into OE-Core along with the state.bbclass change

Thanks
	Sau!




      reply	other threads:[~2012-05-18  5:49 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-12  1:00 [PATCH] sanity.bbclass: check user can read and write to SSTATE_DIR Joshua Lock
2012-05-18  5:39 ` Saul Wold [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=4FB5E075.60402@linux.intel.com \
    --to=sgw@linux.intel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.