Documentation ¶
Index ¶
- Constants
- Variables
- func AddFormat(name string, f RecordFormat)
- func CreateFile(f Record) error
- func CreateFileInRoot(f Record, rootDir string) error
- func Equal(r Record, s Record) bool
- func MakeAllReproducible(files []Record)
- func NewBytesReadCloser(contents []byte) io.ReadCloser
- func NewDeferReadCloser(name string) io.ReadCloser
- func NewReadCloser(r io.Reader) io.ReadCloser
- func ReadCloserEqual(r1, r2 io.ReadCloser) bool
- type Archiver
- type Info
- type LazyOpen
- type Reader
- type Record
- func CharDev(name string, perm uint64, rmajor, rminor uint64) Record
- func Directory(name string, mode uint64) Record
- func GetRecord(path string) (Record, error)
- func MakeReproducible(file Record) Record
- func StaticFile(name string, content string, perm uint64) Record
- func StaticRecord(contents []byte, info Info) Record
- func Symlink(name string, target string) 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 CreateFileInRoot ¶
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
func ReadCloserEqual ¶
func ReadCloserEqual(r1, r2 io.ReadCloser) bool
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.