RPM Community Forums

Mailing List Message of <rpm-devel>

Reserving space for signatures in *.rpm packages

From: Jeff Johnson <n3npq@mac.com>
Date: Sun 07 Jun 2009 - 17:08:26 CEST
Message-id: <4295FFB2-BCCC-4091-8105-4CE8AF2AF70F@mac.com>
I've just checked in patches for RPM to reserve space
for signatures (to be added later) when a package is built.

The goal is to make signing packages less I/O intensive.

Currently, signing *.rpm packages forces (because the
added signature is inserted, not appended) a rewrite of the package  
file,
which, when dealing with all the packages in some distro, leads
to gigabytes of I/O. Signing itself is a rather lightweight event
involving only the I/O to read the metadata header itself.

(aside) Yes there is the header+payload MD5 digest, but that
value need not be recomputed and rewritten when signing a package.

The other reason for padding the signature header is to
place the metadata header at a known offset for more
efficient downloads. With a variable length signature
header, two reads are needed to load package metadata,
the first read to find the size of the signature header,
the second to load the metadata header once its offset is known.

The padding currently pushes the metadata header to a (1024 - 8)
byte offset. The "minus 8" skips the on-disk header magic and leaves
the portion of the metadata needed from a package by RPM itself on
a 0x400 boundary.

For now, 1024 is more than sufficient for reserving space for package
signatures. The value has been chosen mostly because 1024 is very easy
to remember. There are reasons for both a smaller value, and there
may also be reasons (like page alignment with mmap(2)) for a larger
padding value.

So its too early to tell what value will be eventually used, 1024
will do for the short term

There should be no legacy consequences with the implementation
whatsoever other than that actual package size produced by
rpmbuild will be ~900 or so bytes larger.

73 de Jeff
Received on Sun Jun 7 17:09:02 2009
Driven by Jeff Johnson and the RPM project team.
Hosted by OpenPKG and Ralf S. Engelschall.
Powered by FreeBSD and OpenPKG.