Openembedded Core Discussions
 help / color / mirror / Atom feed
From: Mark Hatle <mark.hatle@windriver.com>
To: <openembedded-core@lists.openembedded.org>
Subject: Re: [PATCH] rootfs.py: Remove rpm database from staging area
Date: Mon, 30 Mar 2015 09:56:27 -0500	[thread overview]
Message-ID: <5519641B.5010706@windriver.com> (raw)
In-Reply-To: <1427705624.14020.244.camel@linuxfoundation.org>

On 3/30/15 3:53 AM, Richard Purdie wrote:
> On Mon, 2015-03-30 at 11:30 +0300, Ed Bartosh wrote:
>> Rpm database in staging area is used only by createrepo.
>> createrepo fails with the error
>> "rpmdb: BDB0060 PANIC: fatal region error detected"
>> if rpm database is broken from the previous run of createrepo.
>>
>> Removing the databae before running createrepo can hopefully
>> prevent this failure to happen.
>>
>> [YOCTO #6571]
>>
>> Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
>> ---
>>  meta/lib/oe/rootfs.py | 3 +++
>>  1 file changed, 3 insertions(+)
>>
>> diff --git a/meta/lib/oe/rootfs.py b/meta/lib/oe/rootfs.py
>> index 4e4e6eb..9f7dc65 100644
>> --- a/meta/lib/oe/rootfs.py
>> +++ b/meta/lib/oe/rootfs.py
>> @@ -306,6 +306,9 @@ class RpmRootfs(Rootfs):
>>              bb.utils.remove(self.image_rootfs, True)
>>          else:
>>              self.pm.recovery_packaging_data()
>> +        dbpath = os.path.join(self.d.getVar('STAGING_DIR_NATIVE', True),
>> +                              'var/lib/rpm/*')
>> +        bb.utils.remove(dbpath, recurse=True)
>>          bb.utils.remove(self.d.getVar('MULTILIB_TEMP_ROOTFS', True), True)
>>  
>>          self.pm.crea
> 
> This patch helps me see the problem a lot. I'd never realised there was
> an rpm database in the native sysroot that was getting corrupted, I'd
> always assumed it was the target rootfs one.
> 
> I'm a little worried about what happens if you have multiple images
> generating at the same time as this change as above may delete something
> being worked on by another process.
> 
> I'm wondering why is it getting into the sysroot at all? Rather than
> delete it here, could we either not generate it at all, or place it
> somewhere in WORKDIR (so that other tasks can't see it or race against
> it)?

My guess is that either createrepo or other rpm commands are doing a lazy init
on the DB.  As you mentioned deleting the DB is a little worrying because if
it's open in another process you -are- going to cause other failures.

It would be nice if we could find the creation points and redirect them to the
current workdir.  (Pseudo and it's logging might help us be able to do that.)
The other option could be to create an empty DB, and simply set it and the
directory containing it to read-only, no write.... (but I'm not sure that the
filesystem is actually going to enforce that for the current user.)

--Mark

> Cheers,
> 
> Richard
> 



  reply	other threads:[~2015-03-30 14:56 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-30  8:30 [PATCH] rootfs.py: Remove rpm database from staging area Ed Bartosh
2015-03-30  8:53 ` Richard Purdie
2015-03-30 14:56   ` Mark Hatle [this message]
2015-03-30 15:14   ` Mark Hatle
2015-03-30 19:00     ` Ed Bartosh
2015-03-30 19:22       ` Mark Hatle
2015-03-30 22:47     ` Ed Bartosh
2015-03-30 23:49       ` [PATCH] createrepo: Implement --dbpath command line option Ed Bartosh
2015-03-31  0:16         ` [PATCH] package_manager: call createrepo with --dbpath pointing inside WORKDIR Ed Bartosh
2015-03-31 12:06           ` Richard Purdie
2015-03-31 16:09           ` Mark Hatle
2015-04-01 11:17             ` Ed Bartosh
2015-03-31 21:25         ` [PATCH] createrepo: Implement --dbpath command line option Burton, Ross
2015-04-01 11:19           ` Ed Bartosh
2015-04-01 12:06           ` Ed Bartosh
2015-04-01 12:12             ` Ed Bartosh

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=5519641B.5010706@windriver.com \
    --to=mark.hatle@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