diff options
author | Changqing Li <changqing.li@windriver.com> | 2018-11-15 16:16:55 +0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2018-11-16 11:46:07 +0000 |
commit | bfe2255172c9d33a592e0ecdec6d651672d22682 (patch) | |
tree | 4aff9c790418443f0f8b50a0f47c213a98ff7a62 | |
parent | 6da5d5b3242f4f435628192c561a1d2115a9a9ee (diff) | |
download | poky-bfe2255172c9d33a592e0ecdec6d651672d22682.tar.gz |
checklayer: generate locked-sigs.inc under builddir
yocto-check-layer will find locked-sigs.inc under builddir,
but locked-sigs.inc is generated under current bitbake working
dir. if run yocto-check-layer outside builddir, we will met error
like "No such file or directory: *locked-sigs.inc". change to
run bitbake -S under builddir to fix this problem.
[YOCTO #12973]
(From OE-Core rev: 2ec0bc0b038bc6413978c8f34ef5c0d22b4bc3e7)
Signed-off-by: Changqing Li <changqing.li@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r-- | scripts/lib/checklayer/__init__.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/scripts/lib/checklayer/__init__.py b/scripts/lib/checklayer/__init__.py index 7788041843..ca7863a19e 100644 --- a/scripts/lib/checklayer/__init__.py +++ b/scripts/lib/checklayer/__init__.py | |||
@@ -221,13 +221,13 @@ def add_layer(bblayersconf, layer, layers, logger): | |||
221 | 221 | ||
222 | return True | 222 | return True |
223 | 223 | ||
224 | def check_command(error_msg, cmd): | 224 | def check_command(error_msg, cmd, cwd=None): |
225 | ''' | 225 | ''' |
226 | Run a command under a shell, capture stdout and stderr in a single stream, | 226 | Run a command under a shell, capture stdout and stderr in a single stream, |
227 | throw an error when command returns non-zero exit code. Returns the output. | 227 | throw an error when command returns non-zero exit code. Returns the output. |
228 | ''' | 228 | ''' |
229 | 229 | ||
230 | p = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) | 230 | p = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, cwd=cwd) |
231 | output, _ = p.communicate() | 231 | output, _ = p.communicate() |
232 | if p.returncode: | 232 | if p.returncode: |
233 | msg = "%s\nCommand: %s\nOutput:\n%s" % (error_msg, cmd, output.decode('utf-8')) | 233 | msg = "%s\nCommand: %s\nOutput:\n%s" % (error_msg, cmd, output.decode('utf-8')) |
@@ -257,7 +257,7 @@ def get_signatures(builddir, failsafe=False, machine=None): | |||
257 | os.unlink(sigs_file) | 257 | os.unlink(sigs_file) |
258 | try: | 258 | try: |
259 | check_command('Generating signatures failed. This might be due to some parse error and/or general layer incompatibilities.', | 259 | check_command('Generating signatures failed. This might be due to some parse error and/or general layer incompatibilities.', |
260 | cmd) | 260 | cmd, builddir) |
261 | except RuntimeError as ex: | 261 | except RuntimeError as ex: |
262 | if failsafe and os.path.exists(sigs_file): | 262 | if failsafe and os.path.exists(sigs_file): |
263 | # Ignore the error here. Most likely some recipes active | 263 | # Ignore the error here. Most likely some recipes active |