https://docs.kernel.org/driver-api/early-userspace/buffer-format.html
110 + filename + zero
* is used to indicate "0 or more occurrences of"
(|) indicates alternatives
+ indicates concatenation
GZIP() indicates the gzip(1) of the operand
ALGN(n) means padding with null bytes to an n-byte boundary
initramfs := ("\0" | cpio_archive | cpio_gzip_archive)*
cpio_gzip_archive := GZIP(cpio_archive)
cpio_archive := cpio_file* + (<nothing> | cpio_trailer)
cpio_file := ALGN(4) + cpio_header + filename + "\0" + ALGN(4) + data
cpio_trailer := ALGN(4) + cpio_header + "TRAILER!!!\0" + ALGN(4)
Field name |
Field size |
Meaning |
---|---|---|
c_magic |
6 bytes |
The string “070701” or “070702” |
c_ino |
8 bytes |
File inode number |
c_mode |
8 bytes |
File mode and permissions |
c_uid |
8 bytes |
File uid |
c_gid |
8 bytes |
File gid |
c_nlink |
8 bytes |
Number of links |
c_mtime |
8 bytes |
Modification time |
c_filesize |
8 bytes |
Size of data field |
c_maj |
8 bytes |
Major part of file device number |
c_min |
8 bytes |
Minor part of file device number |
c_rmaj |
8 bytes |
Major part of device node reference |
c_rmin |
8 bytes |
Minor part of device node reference |
c_namesize |
8 bytes |
Length of filename, including final 0 |
c_chksum |
8 bytes |
Checksum of data field if c_magic is 070702; otherwise zero |
00000000: 3037 3037 3031 3030 3643 4230 4535 3030 070701006CB0E500
00000010: 3030 3431 4644 3030 3030 3033 4538 3030 0041FD000003E800
00000020: 3030 3033 4538 3030 3030 3030 3033 3636 0003E80000000366
00000030: 3444 3832 3046 3030 3030 3030 3030 3030 4D820F0000000000
00000040: 3030 3030 3038 3030 3030 3030 3231 3030 0000080000002100
00000050: 3030 3030 3030 3030 3030 3030 3030 3030 0000000000000000
00000060: 3030 3030 3032 3030 3030 3030 3030 2e00 00000200000000..
00000070: 3037 3037 3031 3030 3643 4230 4536 3030 070701006CB0E600
00000080: 3030 3431 4644 3030 3030 3033 4538 3030 0041FD000003E800
00000090: 3030 3033 4538 3030 3030 3030 3032 3636 0003E80000000266
000000a0: 3444 3832 3046 3030 3030 3030 3030 3030 4D820F0000000000
000000b0: 3030 3030 3038 3030 3030 3030 3231 3030 0000080000002100
000000c0: 3030 3030 3030 3030 3030 3030 3030 3030 0000000000000000
000000d0: 3030 3030 3034 3030 3030 3030 3030 6465 00000400000000de
000000e0: 7600 0000 3037 3037 3031 3030 3643 4230 v...070701006CB0
000000f0: 4631 3030 3030 3231 4134 3030 3030 3030 F1000021A4000000
00000100: 3030 3030 3030 3030 3030 3030 3030 3030 0000000000000000
00000110: 3031 3636 3444 3832 3046 3030 3030 3030 01664D820F000000
00000120: 3030 3030 3030 3030 3038 3030 3030 3030 0000000008000000
00000130: 3231 3030 3030 3030 3031 3030 3030 3030 2100000001000000
00000140: 3033 3030 3030 3030 3039 3030 3030 3030 0300000009000000
00000150: 3030 6465 762f 6e75 6c6c 0000 3037 3037 00dev/null..0707
00000160: 3031 3030 3643 4230 4632 3030 3030 3231 01006CB0F2000021
00000170: 4134 3030 3030 3030 3030 3030 3030 3030 A400000000000000
00000180: 3030 3030 3030 3030 3031 3636 3444 3832 0000000001664D82
00000190: 3046 3030 3030 3030 3030 3030 3030 3030 0F00000000000000
000001a0: 3038 3030 3030 3030 3231 3030 3030 3030 0800000021000000
000001b0: 3031 3030 3030 3030 3035 3030 3030 3030 0100000005000000
000001c0: 3039 3030 3030 3030 3030 6465 762f 7a65 0900000000dev/ze
000001d0: 726f 0000 3037 3037 3031 3030 3643 4230 ro..070701006CB0
000001e0: 4633 3030 3030 3231 4134 3030 3030 3030 F3000021A4000000
000001f0: 3030 3030 3030 3030 3030 3030 3030 3030 0000000000000000
00000200: 3031 3636 3444 3832 3046 3030 3030 3030 01664D820F000000
00000210: 3030 3030 3030 3030 3038 3030 3030 3030 0000000008000000
00000220: 3231 3030 3030 3030 3031 3030 3030 3030 2100000001000000
00000230: 3039 3030 3030 3030 3043 3030 3030 3030 090000000C000000
00000240: 3030 6465 762f 7572 616e 646f 6d00 0000 00dev/urandom...