All,
I have built rpm 4.1 for arm-linux, to run on arm-linux. But it doesn't work. :( What am I doing wrong?
Oh, you want more detail? ;)
So far, I have rpm 4.1 built to run on x86, but create packages for armv4l.
Using that, I built rpm 4.1 to run on armv4l and use packages for armv4l.
There's a structure alignment patch in rpmio/rpmpgp.c for arm that you want. Check
the rpm package at netwinder.org for the patch (you might have to diff rpmpgp.c yourself).
I can then use the x86->armv4l rpm 4.1 to convert all my rpms to cpios, transfer them to the target, create a directory, cpio --extract all of those, then chroot into that directory.
In that chroot, I am now able to do an
rpm --initdb
FYI: --initdb is largeyly hysterical these days, not needed. otoph, won't hurt a thing.
and rpm -qa (which shows no output, as expected).
But, problem #1:
rpm --install complains that the packages are "intended for a armv4l architecture"
And
# rpm --eval='%{_arch}'
i386
I was expecting it to give 'armv4l' or similar instead. Ok, so I use --ignorearch to get around that for now, and rpm will install the packages successfully. The files are installed as expected.
Watchout, you can be tricked by --eval. The goal of macro config is to set up a context for
parsing the spec file, so add %dump to a spec file and parse with rpmbuild -ba to verify values.
But, problem #2:
# rpm -qa
Still shows nothing.
So,
# rm -f /var/lib/rpm/*
# rpm --initdb
# echo $?
0
# ls /var/lib/rpm
Packages __db.001 __db.002 __db.003
# rpm --install --nodeps --ignorearch gzip*.rpm
# ls /var/lib/rpm
Basenames Group Packages Requirename Sigmd5 __db.002
Dirnames Installtid Providename Requireversion Triggername __db.003
Filemd5s Name Provideversion Sha1header __db.001
# rpm -qa
Shows nothing, but /var/lib/rpm/Packages has been updated and shows some indication that gzip was added.[1]
# rpm -qa -vv
D: opening db environment /var/lib/rpm/Packages joinenv
D: opening db index /var/lib/rpm/Packages rdonly mode=0x0
D: locked db index /var/lib/rpm/Packages
D: closed db index /var/lib/rpm/Packages
D: closed db environment /var/lib/rpm/Packages
I'm using glibc 2.3.1, a 2.5 kernel in case that matters.
An strace of 'rpm -qa -vv' gives a few hundred lines of output, but I noticed that it seems to do a lot of:
fcntl64(3, F_SETLKW64, {type=F_WRLCK, whence=SEEK_SET, start=8020, len=1}, 0xbeffe81c) = 0
getpid() = 28530
fcntl64(3, F_SETLK64, {type=F_UNLCK, whence=SEEK_SET, start=8020, len=1}, 0xbeffe81c) = 0
Where fd 3 is: open("/var/lib/rpm/__db.001", O_RDWR|O_LARGEFILE) = 3 Probably irrellavent, but it looked odd to me.
__db.001 contains dbenv locks, opened/created when the environment is created. An strace will show
anal retentive checks to avoid a file race creating __db.001, the checks insure that the process was actually
the creator of __db.001.
If all the indices were created with lazy open, and Packages has changed size, then the package was
probably installed correctly. Add -vv to the install args watch the entries being created.
Make sure that rpm -qa is opening the correct database, use --dbpath explicitly, or check with strace.
I'd appreciate any hints as to what I should look into here.....
TIA,
Eli
[1] I used python and did (basically) this:
for d in open('Packages').read().split('\0'):
if len(d):
print repr(d)
to get a basic idea of the file's contents.
hexedit can/will display the same, easier imho. Still -vv on the install is easiest of all.
73 de Jeff
_______________________________________________ Rpm-list mailing list Rpm-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/rpm-list