I already sent you a fix that tries to fix installation with --root by calling rpmdbOpenAll() before the chroot(). It turned out that this also leads to problems, as the temporary databases are opened as well. If Berkeley db runs out of memory it tries to open a backing store for the temporary files and fails. I fixed this by adding another function, rpmdbOpenAllButTemporary().
Created attachment 94250 [details] patch that fixes it (hopefully)
I have no problems using --root on FC 1. I did a full installation using --root (and --aid) to an nfs mounted system. What exactly is the problem you are seeing? Do you still experience it? What is your fix supposed to accomplish? What version of rpm are you talking about? Is this architecture specific?
I've modified rpmdbOpenAll() to not open RPMDBI_DEPENDS. Meanwhile, I don't believe that calling rpmdbOpenAll() before chroot entry is the correct fix, because (potentially) there may be many more indices than currently exist somewhen, and because I believe the better fix is to understand why Berkeley DB re-opens db files on close to check cache coherency, not by opening all possible database files. I'm certainly willing to make the behavior run-time configurable, with default to not call rpmdbOpenAll, if you (or someone) wish to send a patch. Fixed in rpm cvs, will be in rpm-4.4.7 when released.
*** Bug 106057 has been marked as a duplicate of this bug. ***