From: Gary Thomas <gary@mlbassoc.com>
To: Paul Eggleton <paul.eggleton@linux.intel.com>
Cc: poky@yoctoproject.org
Subject: Re: [PATCH 1/1] sanity.bbclass: add check for creation of long filenames
Date: Thu, 02 Dec 2010 05:21:06 -0700 [thread overview]
Message-ID: <4CF78F32.4030700@mlbassoc.com> (raw)
In-Reply-To: <cc23b209094288c749968a2933959c097ae2d3e6.1291135878.git.paul.eggleton@linux.intel.com>
On 11/30/2010 09:40 AM, Paul Eggleton wrote:
> Detect and fail if filesystem in use for TMPDIR or SSTATE_DIR has an
> unreasonably short file name length limit (eg. eCryptFS). This can cause
> "file name too long" errors during poky builds (e.g. when writing sstate
> files for packages with a git revision as the version).
Is this information cached? It's seems quite the burden
to have to create/remove ~400 files each time on startup.
> Signed-off-by: Paul Eggleton<paul.eggleton@linux.intel.com>
> ---
> meta/classes/sanity.bbclass | 33 ++++++++++++++++++++++++++++++++-
> 1 files changed, 32 insertions(+), 1 deletions(-)
>
> diff --git a/meta/classes/sanity.bbclass b/meta/classes/sanity.bbclass
> index 06aeddc..90e8911 100644
> --- a/meta/classes/sanity.bbclass
> +++ b/meta/classes/sanity.bbclass
> @@ -21,6 +21,21 @@ def check_conf_exists(fn, data):
> return True
> return False
>
> +def check_create_long_filename(filepath, pathname):
> + testfile = os.path.join(filepath, ''.join([`num`[-1] for num in xrange(1,200)]))
> + try:
> + if not os.path.exists(filepath):
> + os.path.mkdir(filepath)
> + f = file(testfile, "w")
> + f.close()
> + os.remove(testfile)
> + except IOError as (errno, strerror):
> + if errno == 36: # ENAMETOOLONG
> + return "Failed to create a file with a long name in {0}. Please use a filesystem that does not unreasonably limit filename length.\n".format(pathname)
> + else:
> + return "Failed to create a file in {0}: {1}".format(pathname, strerror)
> + return ""
> +
> def check_sanity(e):
> from bb import note, error, data, __version__
>
> @@ -163,10 +178,26 @@ def check_sanity(e):
> if os.path.exists('%s/libc.so.6' % lib32path) and not os.path.exists('/usr/include/gnu/stubs-32.h'):
> messages = messages + "You have a 32-bit libc, but no 32-bit headers. You must install the 32-bit libc headers.\n"
>
> + tmpdir = data.getVar('TMPDIR', e.data, True)
> +
> + #
> + # Check that TMPDIR isn't on a filesystem with limited filename length (eg. eCryptFS)
> + #
> + testmsg = check_create_long_filename(tmpdir, "TMPDIR")
> + if testmsg != "":
> + messages = messages + testmsg
> + #
> + # Check that SSTATE_DIR isn't on a filesystem with limited filename length (eg. eCryptFS)
> + #
> + sstatedir = data.getVar('SSTATE_DIR', e.data, True)
> + if sstatedir != "":
> + testmsg = check_create_long_filename(sstatedir, "SSTATE_DIR")
> + if testmsg != "":
> + messages = messages + testmsg
> +
> #
> # Check that TMPDIR hasn't changed location since the last time we were run
> #
> - tmpdir = data.getVar('TMPDIR', e.data, True)
> checkfile = os.path.join(tmpdir, "saved_tmpdir")
> if os.path.exists(checkfile):
> f = file(checkfile, "r")
--
------------------------------------------------------------
Gary Thomas | Consulting for the
MLB Associates | Embedded world
------------------------------------------------------------
next prev parent reply other threads:[~2010-12-02 12:21 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <cover.1291135878.git.paul.eggleton@linux.intel.com>
2010-11-30 16:40 ` [PATCH 1/1] sanity.bbclass: add check for creation of long filenames Paul Eggleton
2010-12-02 12:21 ` Gary Thomas [this message]
2010-12-02 14:13 ` Paul Eggleton
2010-12-02 14:16 ` Gary Thomas
2010-12-02 14:36 ` Paul Eggleton
2010-12-02 14:41 ` Gary Thomas
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=4CF78F32.4030700@mlbassoc.com \
--to=gary@mlbassoc.com \
--cc=paul.eggleton@linux.intel.com \
--cc=poky@yoctoproject.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;
as well as URLs for NNTP newsgroup(s).