mirror of
https://github.com/libguestfs/libguestfs.git
synced 2026-03-22 07:03:38 +00:00
Fix the Name and Packages database so it looks enough like a modern
RPM database to fool inspection. I'm not sure whether or not the old
version ever worked, but it doesn't work now.
The format is not documented, but in brief:
The Name database contains (Name, link) pairs. The link is an
arbitrary 32 bit integer.
The Packages database contains (link, RPM-blob) pairs.
The RPM-blob is a binary blob formatted like this:
* Number of fields 4 bytes, big endian
* Size in bytes of the store 4 bytes, big endian
* Field descriptions:
list of (RPMTAG, 0, offset in store, 0)
4 * 4 * nr_fields bytes, big endian
* The store binary data containing ASCIIZ strings
For the values of RPMTAG_* that we understand, see src/inspect-apps.c.