On Mon, Jan 29, 2018 at 02:36:24PM +0100, Jan Kiszka wrote:
> On 2018-01-24 11:23, [ext] Andreas J. Reichel wrote:
> > From: Andreas Reichel <
andreas.r...@siemens.com>
> >
> > efibootguard.bbclass creates an iso directory,
> > which sometimes is not ready yet before chdir'ing
> > into this new directory. Prevent this by correctly
> > fetching the result.
>
> Can you clarify what "not ready yet" exactly means? This sounds to me
> like an ordering issue ("will be ready later"), but then the patch below
> which simply fails the build does not match the description.
>
Not ready means the directory is not ready, i.e. does not exist yet.
A call to Popen runs its process async, so if "communicate" is not
called, "os.chdir" can be executed before "mkdir" is finished. A call to
communicate waits until the result of mkdir is available.
Andreas
> Jan
>
> >
> > Signed-off-by: Andreas Reichel <
andreas.r...@siemens.com>
> > ---
> > classes/efibootguard.bbclass | 4 +++-
> > 1 file changed, 3 insertions(+), 1 deletion(-)
> >
> > diff --git a/classes/efibootguard.bbclass b/classes/efibootguard.bbclass
> > index c979e23..553da57 100644
> > --- a/classes/efibootguard.bbclass
> > +++ b/classes/efibootguard.bbclass
> > @@ -70,7 +70,9 @@ python build_efi_cfg() {
> >
> > make_isodir_cmd = ["mkdir", "-p", isodir]
> > p = Popen(make_isodir_cmd)
> > -
> > + (out, err) = p.communicate()
> > + if not p.returncode == 0:
> > + bb.fatal("Could not create isodir: %s" % isodir)
> > os.chdir(isodir)
> > p = Popen([bg_setenv_cmd, "--file", "--kernel=vmlinuz", "--watchdog=30"], \
> > stdout=PIPE, stderr=PIPE)
> >
>
>
> --
> Siemens AG, Corporate Technology, CT RDA IOT SES-DE
> Corporate Competence Center Embedded Linux
--
Andreas Reichel
Dipl.-Phys. (Univ.)
Software Consultant
Andreas...@tngtech.com,
+49-174-3180074
TNG Technology Consulting GmbH, Betastr. 13a, 85774 Unterfoehring
Geschaeftsfuehrer: Henrik Klagges, Dr. Robert Dahlke, Gerhard Mueller
Sitz: Unterfoehring * Amtsgericht Muenchen * HRB 135082