Documentation ¶
Index ¶
- Constants
- Variables
- func AddFormat(name string, f RecordFormat)
- func CreateFile(f Record) error
- func MakeAllReproducible(files []Record)
- func NewBytesReadCloser(contents []byte) io.ReadCloser
- func NewDeferReadCloser(name string) io.ReadCloser
- func NewReadCloser(r io.Reader) io.ReadCloser
- type Archiver
- type Info
- type LazyOpen
- type Reader
- type Record
- type RecordFormat
- type RecordReader
- type RecordWriter
- type Writer
Constants ¶
View Source
const Trailer = "TRAILER!!!"
Variables ¶
View Source
var (
Debug = func(string, ...interface{}) {}
)
View Source
var TrailerRecord = StaticRecord(nil, Info{Name: Trailer})
Functions ¶
func AddFormat ¶
func AddFormat(name string, f RecordFormat)
func CreateFile ¶
func MakeAllReproducible ¶
func MakeAllReproducible(files []Record)
func NewBytesReadCloser ¶
func NewBytesReadCloser(contents []byte) io.ReadCloser
func NewDeferReadCloser ¶
func NewDeferReadCloser(name string) io.ReadCloser
func NewReadCloser ¶
func NewReadCloser(r io.Reader) io.ReadCloser
Types ¶
type Archiver ¶
type Archiver struct {
RecordFormat
}
type Info ¶
type Info struct { Ino uint64 Mode uint64 UID uint64 GID uint64 NLink uint64 MTime uint64 FileSize uint64 Dev uint64 Major uint64 Minor uint64 Rmajor uint64 Rminor uint64 Name string }
Info holds metadata about files.
type Reader ¶
type Reader struct {
// contains filtered or unexported fields
}
func (Reader) ReadRecord ¶
func (Reader) ReadRecords ¶
type Record ¶
type Record struct { io.ReadCloser Info }
func MakeReproducible ¶
MakeReproducible changes any fields in a Record such that if we run cpio again, with the same files presented to it in the same order, and those files have unchanged contents, the cpio file it produces will be bit-for-bit identical. This is an essential property for firmware-embedded payloads.
func StaticRecord ¶
type RecordFormat ¶
type RecordFormat interface { Reader(r io.ReaderAt) RecordReader Writer(w io.Writer) RecordWriter }
type RecordReader ¶
type RecordWriter ¶
type Writer ¶
type Writer struct {
// contains filtered or unexported fields
}
func (Writer) WriteRecord ¶
func (Writer) WriteRecords ¶
WriteRecords writes multiple records.
func (Writer) WriteTrailer ¶
WriteTrailer writes the trailer record.
Click to show internal directories.
Click to hide internal directories.