Hello everybody, I have a SheevaPlug that I have loaded Fedora 11 onto. When I use a USB memory key as my storage device RPM works great. However I would like to run the system from the MTD. I have create a jffs file system and flashed it onto the MTD. However RPM just flat out refuses to works. I keep getting errors accessing the Packages database. I have tried rebuilding that the database, and even creating new databases from scratch. Below is the output I receive.
-bash-4.0# rpm -qa -vvv D: loading keyring from pubkeys in /var/lib/rpm/pubkeys/*.key D: couldn't find any keys in /var/lib/rpm/pubkeys/*.key D: loading keyring from rpmdb D: opening db environment /var/lib/rpm/Packages cdb:mpool:joinenv rpmdb: mmap: Invalid argument error: db4 error(22) from dbenv->open: Invalid argument D: opening db index /var/lib/rpm/Packages rdonly mode=0x0 error: cannot open Packages index using db3 - Invalid argument (22) error: cannot open Packages database in /var/lib/rpm D: opening db environment /var/lib/rpm/Packages cdb:mpool:joinenv rpmdb: mmap: Invalid argument error: db4 error(22) from dbenv->open: Invalid argument D: opening db index /var/lib/rpm/Packages rdonly mode=0x0 error: cannot open Packages database in /var/lib/rpm -bash-4.0#
-bash-4.0# rpm --rebuilddb -vvv D: rebuilding database /var/lib/rpm into /var/lib/rpmrebuilddb.1753 D: creating directory /var/lib/rpmrebuilddb.1753 D: opening old database with dbapi 3 D: opening db environment /var/lib/rpm/Packages cdb:mpool:joinenv rpmdb: mmap: Invalid argument error: db4 error(22) from dbenv->open: Invalid argument D: opening db index /var/lib/rpm/Packages rdonly mode=0x0 error: cannot open Packages index using db3 - Invalid argument (22) D: removing directory /var/lib/rpmrebuilddb.1753
-bash-4.0# mv rpm rpmBorked -bash-4.0# mkdir rpm -bash-4.0# rpm --initdb -vvv D: opening db environment /var/lib/rpm/Packages cdb:mpool:joinenv rpmdb: mmap: Invalid argument error: db4 error(22) from dbenv->open: Invalid argument D: opening db index /var/lib/rpm/Packages create mode=0x42 error: cannot open Packages index using db3 - Invalid argument (22) I am thinking it has something to with the JFFS2 filesystem. Running my USB memory key with ext3 works just file. I used the same tarball to generate both filesystems. This is the command I used to generate the JFFS2 filesystem. mkfs.jffs2 -l -e 0x20000 --pad -r /home/rootfs-f11 -o fedora.jffs2
Thanks, Eric
On 10/05/09 06:52, Somebody in the thread at some point said:
D: opening db environment /var/lib/rpm/Packages cdb:mpool:joinenv rpmdb: mmap: Invalid argument error: db4 error(22) from dbenv->open: Invalid argument
Two tips about RPM, don't know if they're exactly your problem but you can't operate without knowing the first one anyway.
If you see db problems, first move is
# rm -f /var/lib/rpm/__*
If you didn't shutdown cleanly, these "sticky database temp files" can be corrupted and tried to get use next time. If they're deleted, they'll be regenerated silently.
Second one is another way to see "corruption" of those temp files is if you had been doing rpm --root= operations on your host on the image, I saw that the __ files can get marked with your host arch. The device can see that in there and choke as well. So, after host --root= operations on the rpmdb on SD card or whatever, I routinely delete the /var/lib/rpm/__* files too.
I don't particularly recognize the mmap: Invalid argument so maybe it's something completely different, but I noticed you don't show you tried the __ file deletion.
-Andy
-----Original Message----- From: fedora-arm-bounces@redhat.com [mailto:fedora-arm- bounces@redhat.com] On Behalf Of Andy Green Sent: 05 October 2009 11:24 To: Eric Moody Cc: fedora-arm@redhat.com Subject: Re: [fedora-arm] RPM problems with Fedora 11 on Sheevaplug
On 10/05/09 06:52, Somebody in the thread at some point said:
D: opening db environment /var/lib/rpm/Packages
cdb:mpool:joinenv
rpmdb: mmap: Invalid argument error: db4 error(22) from dbenv->open: Invalid argument
IIRC, JFFS2 has some issues with supporting writeable mmaps, and you need to inform rpm of this.
Try including the following line in your $INSTALL_ROOT/etc/rpm/macros.rpmdb
%__dbi_cdb create private nommap
Kedar