Skip to content

Commit

Permalink
Clean up immutable regions section a bit
Browse files Browse the repository at this point in the history
  • Loading branch information
dralley committed Jan 9, 2024
1 parent e452eab commit 9f3185c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 19 deletions.
25 changes: 8 additions & 17 deletions docs/manual/format.md
Original file line number Diff line number Diff line change
Expand Up @@ -258,33 +258,29 @@ starts at byte 592: "00 09 9b 31", which is 629553).

### Immutable header regions

The header data structure has changed in rpm-4.0.[12] to preserve the
original header from a package. The goal is to keep the original
header intact so that metadata can be verified separately from the
payload by the RHN up2date client and by the rpm command line verify
mode using signatures saved in the rpm database. I believe the change
is entirely forward and backward compatible, and will not require
any artifacts like changing the version number of packaging or
adding an "rpmlib(...)" tracking dependency. We'll see ...
One useful feature of RPM is the ability to preserve the original
header from a package, so that metadata can be verified separately
from the payload, e.g. using signatures saved in the rpm database.
This ability was added in RPM 4.0.12 with the concept of immutable
header regions.

Here's a short description of the change. An rpm header has three sections:
A short description of the implementation is as follows.
As described above, an rpm header has three sections:
```
1) intro (# entries in index, # bytes of data)
2) index 16 byte entries, one per tag, big endian
3) data tag values, properly aligned, big endian
```

Representing sections in the header (ignoring the intro) with
```
A,B,C index entries sorted by tag number
a,b,c variable length entry data
| boundary between index/data
| boundary between index/data
```
a header with 3 tag/value pairs (A,a) can be represented something like
```
ABC|abc
```

The change is to introduce a new tag that keeps track of a contiguous
region (i.e. the original header). Representing the boundaries with
square/angle brackets, an "immutable region" in the header thus becomes
Expand Down Expand Up @@ -339,11 +335,6 @@ What made header regions trickier yet is the desire to have an implementation
that is both backward and forward compatible. I won't bore you with the
tedious details.

However, even after doing regressions against supported Red Hat releases,
there's a Great Big Universe of rpm packages out there, and I'm *very*
interested in hearing (as bug reports against rpm at http://bugzilla.redhat.com)
about any and all problems with header regions in rpm-4.0.1.

## Payload

The Payload is currently a cpio archive, typically compressed using
Expand Down
3 changes: 1 addition & 2 deletions docs/manual/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,7 @@ title: rpm.org - RPM Reference Manual
* [Plugin API](plugins.md)

### Package Format
* [RPM v3 file format](format.md)
* [RPM v4 header regions](hregions.md)
* [RPM v4 file format](format.md)
* [RPM v4 signatures and digests](signatures_digests.md)

### Documentation
Expand Down

0 comments on commit 9f3185c

Please sign in to comment.