Talk:Apk spec

From Alpine Linux
Revision as of 17:29, 11 December 2022 by Mårten (talk | contribs)

APK v2 package/index terminology

record/block A 512 byte sequence of bytes, a block

h header record/block

d data record/block

e1, e2 EOF markers (two blocks 1024 bytes)

tar archive A tar archive file, consiting of a set of files, a sequence of blocks ending with the eof marker blocks.

tar segment A set of tar records, a sequence of tar records withouth a ending eof marker.

gzip stream A stream is a sequence gzip compressed data, starting with a magic number, headers, body and an ending 8-byte trailer.

[ ... ] A gzip stream containing blocks

concatenate To link togther things in a series or chain. ie. concatenate. Concatenate 3 gzip streams sequentially in a file.

package signature A single file that is a binary signature over the concatenated (control + data) gzip streams

package signature file DigestRSA-PKCS1v15(SHA1( apk-gzip-stream-2 ++ apk-gzip-stream-3), DER)

index signature file DigestRSA-PKCS1v15(SHA1( index-gzip-stream-2), DER)

h A tar header record block

h1 Signature file header, permission 0644, uid 0 and gid 0.

C: checksum The SHA1 hash of the "Control data" gzip stream (gzip stream 2)


APK v2 package layout
Gzip Streams apk-gzip-stream1 apk-gzip-stream2 apk-gzip-stream-3
Tar apk-tar-segment-1 apk-tar-segment-2 apk-tarball
Blocks [h1, d, ...] [h, d, ...] [h, d, h, d, ..., e1, e2 ]
Files Package Signature Control Data Package Data
Index v2 layout
Gzip Streams index-gzip-stream1 index-gzip-stream2
Tar index-tar-segment-1 index-tar-segment-2
Blocks [h1, d, ...] [h, d, ..., d1, d2]
Files Index Signature Description and APKINDEX