]sphinx.addnodesdocument)}( rawsourcechildren]( translations LanguagesNode)}(hhh](h pending_xref)}(hhh]docutils.nodesTextChinese (Simplified)}parenthsba attributes}(ids]classes]names]dupnames]backrefs] refdomainstdreftypedoc reftarget | cpio_trailer) cpio_file := ALGN(4) + cpio_header + filename + "\0" + ALGN(4) + data cpio_trailer := ALGN(4) + cpio_header + "TRAILER!!!\0" + ALGN(4)h]hX* 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* + ( | cpio_trailer) cpio_file := ALGN(4) + cpio_header + filename + "\0" + ALGN(4) + data cpio_trailer := ALGN(4) + cpio_header + "TRAILER!!!\0" + ALGN(4)}hjsbah}(h]h ]h"]h$]h&] xml:spacepreserveuh1hhhhKhhhhubh)}(hIn human terms, the initramfs buffer contains a collection of compressed and/or uncompressed cpio archives (in the "newc" or "crc" formats); arbitrary amounts zero bytes (for padding) can be added between members.h]hIn human terms, the initramfs buffer contains a collection of compressed and/or uncompressed cpio archives (in the “newc” or “crc” formats); arbitrary amounts zero bytes (for padding) can be added between members.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK*hhhhubh)}(hvThe cpio "TRAILER!!!" entry (cpio end-of-archive) is optional, but is not ignored; see "handling of hard links" below.h]h~The cpio “TRAILER!!!” entry (cpio end-of-archive) is optional, but is not ignored; see “handling of hard links” below.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK/hhhhubh)}(hThe structure of the cpio_header is as follows (all fields contain hexadecimal ASCII numbers fully padded with '0' on the left to the full width of the field, for example, the integer 4780 is represented by the ASCII string "000012ac"):h]hThe structure of the cpio_header is as follows (all fields contain hexadecimal ASCII numbers fully padded with ‘0’ on the left to the full width of the field, for example, the integer 4780 is represented by the ASCII string “000012ac”):}(hj-hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK2hhhhubhtable)}(hhh]htgroup)}(hhh](hcolspec)}(hhh]h}(h]h ]h"]h$]h&]colwidthK uh1jEhjBubjF)}(hhh]h}(h]h ]h"]h$]h&]colwidthKuh1jEhjBubjF)}(hhh]h}(h]h ]h"]h$]h&]colwidthK.uh1jEhjBubhthead)}(hhh]hrow)}(hhh](hentry)}(hhh]h)}(h Field nameh]h Field name}(hjthhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK8hjqubah}(h]h ]h"]h$]h&]uh1johjlubjp)}(hhh]h)}(h Field sizeh]h Field size}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK8hjubah}(h]h ]h"]h$]h&]uh1johjlubjp)}(hhh]h)}(hMeaningh]hMeaning}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK8hjubah}(h]h ]h"]h$]h&]uh1johjlubeh}(h]h ]h"]h$]h&]uh1jjhjgubah}(h]h ]h"]h$]h&]uh1jehjBubhtbody)}(hhh](jk)}(hhh](jp)}(hhh]h)}(hc_magich]hc_magic}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK:hjubah}(h]h ]h"]h$]h&]uh1johjubjp)}(hhh]h)}(h6 bytesh]h6 bytes}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK:hjubah}(h]h ]h"]h$]h&]uh1johjubjp)}(hhh]h)}(hThe string "070701" or "070702"h]h'The string “070701” or “070702”}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK:hjubah}(h]h ]h"]h$]h&]uh1johjubeh}(h]h ]h"]h$]h&]uh1jjhjubjk)}(hhh](jp)}(hhh]h)}(hc_inoh]hc_ino}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK;hjubah}(h]h ]h"]h$]h&]uh1johjubjp)}(hhh]h)}(h8 bytesh]h8 bytes}(hj2hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK;hj/ubah}(h]h ]h"]h$]h&]uh1johjubjp)}(hhh]h)}(hFile inode numberh]hFile inode number}(hjIhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK;hjFubah}(h]h ]h"]h$]h&]uh1johjubeh}(h]h ]h"]h$]h&]uh1jjhjubjk)}(hhh](jp)}(hhh]h)}(hc_modeh]hc_mode}(hjihhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1johjubjp)}(hhh]h)}(h8 bytesh]h8 bytes}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK>hjubah}(h]h ]h"]h$]h&]uh1johjubjp)}(hhh]h)}(hFile gidh]hFile gid}(hj3hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK>hj0ubah}(h]h ]h"]h$]h&]uh1johjubeh}(h]h ]h"]h$]h&]uh1jjhjubjk)}(hhh](jp)}(hhh]h)}(hc_nlinkh]hc_nlink}(hjShhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK?hjPubah}(h]h ]h"]h$]h&]uh1johjMubjp)}(hhh]h)}(h8 bytesh]h8 bytes}(hjjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK?hjgubah}(h]h ]h"]h$]h&]uh1johjMubjp)}(hhh]h)}(hNumber of linksh]hNumber of links}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK?hj~ubah}(h]h ]h"]h$]h&]uh1johjMubeh}(h]h ]h"]h$]h&]uh1jjhjubjk)}(hhh](jp)}(hhh]h)}(hc_mtimeh]hc_mtime}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK@hjubah}(h]h ]h"]h$]h&]uh1johjubjp)}(hhh]h)}(h8 bytesh]h8 bytes}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK@hjubah}(h]h ]h"]h$]h&]uh1johjubjp)}(hhh]h)}(hModification timeh]hModification time}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK@hjubah}(h]h ]h"]h$]h&]uh1johjubeh}(h]h ]h"]h$]h&]uh1jjhjubjk)}(hhh](jp)}(hhh]h)}(h c_filesizeh]h c_filesize}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKAhjubah}(h]h ]h"]h$]h&]uh1johjubjp)}(hhh]h)}(h8 bytesh]h8 bytes}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKAhjubah}(h]h ]h"]h$]h&]uh1johjubjp)}(hhh]h)}(hSize of data fieldh]hSize of data field}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKAhjubah}(h]h ]h"]h$]h&]uh1johjubeh}(h]h ]h"]h$]h&]uh1jjhjubjk)}(hhh](jp)}(hhh]h)}(hc_majh]hc_maj}(hj=hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKBhj:ubah}(h]h ]h"]h$]h&]uh1johj7ubjp)}(hhh]h)}(h8 bytesh]h8 bytes}(hjThhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKBhjQubah}(h]h ]h"]h$]h&]uh1johj7ubjp)}(hhh]h)}(h Major part of file device numberh]h Major part of file device number}(hjkhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKBhjhubah}(h]h ]h"]h$]h&]uh1johj7ubeh}(h]h ]h"]h$]h&]uh1jjhjubjk)}(hhh](jp)}(hhh]h)}(hc_minh]hc_min}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKChjubah}(h]h ]h"]h$]h&]uh1johjubjp)}(hhh]h)}(h8 bytesh]h8 bytes}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKChjubah}(h]h ]h"]h$]h&]uh1johjubjp)}(hhh]h)}(h Minor part of file device numberh]h Minor part of file device number}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKChjubah}(h]h ]h"]h$]h&]uh1johjubeh}(h]h ]h"]h$]h&]uh1jjhjubjk)}(hhh](jp)}(hhh]h)}(hc_rmajh]hc_rmaj}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKDhjubah}(h]h ]h"]h$]h&]uh1johjubjp)}(hhh]h)}(h8 bytesh]h8 bytes}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKDhjubah}(h]h ]h"]h$]h&]uh1johjubjp)}(hhh]h)}(h#Major part of device node referenceh]h#Major part of device node reference}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKDhjubah}(h]h ]h"]h$]h&]uh1johjubeh}(h]h ]h"]h$]h&]uh1jjhjubjk)}(hhh](jp)}(hhh]h)}(hc_rminh]hc_rmin}(hj'hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKEhj$ubah}(h]h ]h"]h$]h&]uh1johj!ubjp)}(hhh]h)}(h8 bytesh]h8 bytes}(hj>hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKEhj;ubah}(h]h ]h"]h$]h&]uh1johj!ubjp)}(hhh]h)}(h#Minor part of device node referenceh]h#Minor part of device node reference}(hjUhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKEhjRubah}(h]h ]h"]h$]h&]uh1johj!ubeh}(h]h ]h"]h$]h&]uh1jjhjubjk)}(hhh](jp)}(hhh]h)}(h c_namesizeh]h c_namesize}(hjuhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKFhjrubah}(h]h ]h"]h$]h&]uh1johjoubjp)}(hhh]h)}(h8 bytesh]h8 bytes}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKFhjubah}(h]h ]h"]h$]h&]uh1johjoubjp)}(hhh]h)}(h&Length of filename, including final \0h]h&Length of filename, including final 0}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKFhjubah}(h]h ]h"]h$]h&]uh1johjoubeh}(h]h ]h"]h$]h&]uh1jjhjubjk)}(hhh](jp)}(hhh]h)}(hc_chksumh]hc_chksum}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKGhjubah}(h]h ]h"]h$]h&]uh1johjubjp)}(hhh]h)}(h8 bytesh]h8 bytes}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKGhjubah}(h]h ]h"]h$]h&]uh1johjubjp)}(hhh]h)}(h;Checksum of data field if c_magic is 070702; otherwise zeroh]h;Checksum of data field if c_magic is 070702; otherwise zero}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKGhjubah}(h]h ]h"]h$]h&]uh1johjubeh}(h]h ]h"]h$]h&]uh1jjhjubeh}(h]h ]h"]h$]h&]uh1jhjBubeh}(h]h ]h"]h$]h&]colsKuh1j@hj=ubah}(h]h ]h"]h$]h&]uh1j;hhhhhhhNubh)}(h~The c_mode field matches the contents of st_mode returned by stat(2) on Linux, and encodes the file type and file permissions.h]h~The c_mode field matches the contents of st_mode returned by stat(2) on Linux, and encodes the file type and file permissions.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKKhhhhubh)}(hRThe c_filesize should be zero for any file which is not a regular file or symlink.h]hRThe c_filesize should be zero for any file which is not a regular file or symlink.}(hj,hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKNhhhhubh)}(hXThe c_chksum field contains a simple 32-bit unsigned sum of all the bytes in the data field. cpio(1) refers to this as "crc", which is clearly incorrect (a cyclic redundancy check is a different and significantly stronger integrity check), however, this is the algorithm used.h]hXThe c_chksum field contains a simple 32-bit unsigned sum of all the bytes in the data field. cpio(1) refers to this as “crc”, which is clearly incorrect (a cyclic redundancy check is a different and significantly stronger integrity check), however, this is the algorithm used.}(hj:hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKQhhhhubh)}(hIf the filename is "TRAILER!!!" this is actually an end-of-archive marker; the c_filesize for an end-of-archive marker must be zero.h]hIf the filename is “TRAILER!!!” this is actually an end-of-archive marker; the c_filesize for an end-of-archive marker must be zero.}(hjHhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKWhhhhubh)}(hhh](h)}(hHandling of hard linksh]hHandling of hard links}(hjYhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjVhhhhhK\ubh)}(hXWhen a nondirectory with c_nlink > 1 is seen, the (c_maj,c_min,c_ino) tuple is looked up in a tuple buffer. If not found, it is entered in the tuple buffer and the entry is created as usual; if found, a hard link rather than a second copy of the file is created. It is not necessary (but permitted) to include a second copy of the file contents; if the file contents is not included, the c_filesize field should be set to zero to indicate no data section follows. If data is present, the previous instance of the file is overwritten; this allows the data-carrying instance of a file to occur anywhere in the sequence (GNU cpio is reported to attach the data to the last instance of a file only.)h]hXWhen a nondirectory with c_nlink > 1 is seen, the (c_maj,c_min,c_ino) tuple is looked up in a tuple buffer. If not found, it is entered in the tuple buffer and the entry is created as usual; if found, a hard link rather than a second copy of the file is created. It is not necessary (but permitted) to include a second copy of the file contents; if the file contents is not included, the c_filesize field should be set to zero to indicate no data section follows. If data is present, the previous instance of the file is overwritten; this allows the data-carrying instance of a file to occur anywhere in the sequence (GNU cpio is reported to attach the data to the last instance of a file only.)}(hjghhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK^hjVhhubh)}(h*c_filesize must not be zero for a symlink.h]h*c_filesize must not be zero for a symlink.}(hjuhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKjhjVhhubh)}(hWhen a "TRAILER!!!" end-of-archive marker is seen, the tuple buffer is reset. This permits archives which are generated independently to be concatenated.h]hWhen a “TRAILER!!!” end-of-archive marker is seen, the tuple buffer is reset. This permits archives which are generated independently to be concatenated.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKlhjVhhubh)}(hTo combine file data from different sources (without having to regenerate the (c_maj,c_min,c_ino) fields), therefore, either one of the following techniques can be used:h]hTo combine file data from different sources (without having to regenerate the (c_maj,c_min,c_ino) fields), therefore, either one of the following techniques can be used:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKphjVhhubhenumerated_list)}(hhh](h list_item)}(hWSeparate the different file data sources with a "TRAILER!!!" end-of-archive marker, or h]h)}(hVSeparate the different file data sources with a "TRAILER!!!" end-of-archive marker, orh]hZSeparate the different file data sources with a “TRAILER!!!” end-of-archive marker, or}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKthjubah}(h]h ]h"]h$]h&]uh1jhjhhhhhNubj)}(h4Make sure c_nlink == 1 for all nondirectory entries.h]h)}(hjh]h4Make sure c_nlink == 1 for all nondirectory entries.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKwhjubah}(h]h ]h"]h$]h&]uh1jhjhhhhhNubeh}(h]h ]h"]h$]h&]enumtype loweralphaprefixhsuffix)uh1jhjVhhhhhKtubeh}(h]handling-of-hard-linksah ]h"]handling of hard linksah$]h&]uh1hhhhhhhhK\ubeh}(h]initramfs-buffer-formatah ]h"]initramfs buffer formatah$]h&]uh1hhhhhhhhKubeh}(h]h ]h"]h$]h&]sourcehuh1hcurrent_sourceN current_lineNsettingsdocutils.frontendValues)}(hN generatorN datestampN source_linkN source_urlN toc_backlinksjofootnote_backlinksK sectnum_xformKstrip_commentsNstrip_elements_with_classesN strip_classesN report_levelK halt_levelKexit_status_levelKdebugNwarning_streamN tracebackinput_encoding utf-8-siginput_encoding_error_handlerstrictoutput_encodingutf-8output_encoding_error_handlerjerror_encodingutf-8error_encoding_error_handlerbackslashreplace language_codeenrecord_dependenciesNconfigN id_prefixhauto_id_prefixid dump_settingsNdump_internalsNdump_transformsNdump_pseudo_xmlNexpose_internalsNstrict_visitorN_disable_configN_sourceh _destinationN _config_files]7/var/lib/git/docbuild/linux/Documentation/docutils.confafile_insertion_enabled raw_enabledKline_length_limitM'pep_referencesN pep_base_urlhttps://peps.python.org/pep_file_url_templatepep-%04drfc_referencesN rfc_base_url&https://datatracker.ietf.org/doc/html/ tab_widthKtrim_footnote_reference_spacesyntax_highlightlong smart_quotessmartquotes_locales]character_level_inline_markupdoctitle_xform docinfo_xformKsectsubtitle_xform image_loadinglinkembed_stylesheetcloak_email_addressessection_self_linkenvNubreporterNindirect_targets]substitution_defs}substitution_names}refnames}refids}nameids}(jjjju nametypes}(jjuh}(jhjjVu footnote_refs} citation_refs} autofootnotes]autofootnote_refs]symbol_footnotes]symbol_footnote_refs] footnotes] citations]autofootnote_startKsymbol_footnote_startK id_counter collectionsCounter}Rparse_messages]transform_messages] transformerN include_log] decorationNhhub.