patchwork

package module
v0.0.0-...-1d7ee9f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 26, 2020 License: MIT Imports: 8 Imported by: 0

README

patchwork

GoDoc

patchwork provides on-the-fly way to replace files on ISO9660 image. RockRidge extention is also supperted partially.

What patchwork does

TODO

Example

https://gist.github.com/kaz/7c4faa5e5ad95fe9b6a71c9b3458f250

Documentation

Overview

patchwork provides on-the-fly way to replace files on ISO9660 image. RockRidge extention is also supperted partially.

README: https://github.com/kaz/patchwork#readme

Index

Constants

View Source
const (
	SECTOR_SIZE uint32 = 2 * 1024
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Device

type Device interface {
	io.Seeker
	io.ReaderAt
	io.WriterAt
}

Device is data layer which Image write updated contents to and read original contents from. You can use os.File as Device.

type Image

type Image struct {
	// contains filtered or unexported fields
}

Image represents rewritable ISO9660 disk image.

func NewImage

func NewImage(dev Device) *Image

Create instance which has specified device in it.

func NewImageFromFile

func NewImageFromFile(file string) (*Image, *os.File, error)

Create instance from image file. Changes will be applied directly. If you prefer to avoid change original file, use NewOverlayedImageFromFile instead.

func NewOverlayedImageFromFile

func NewOverlayedImageFromFile(file string) (*Image, *overlay.Overlay, error)

Create instance from image file with overlay reader as a device. Changes won't be applied to original file.

func (*Image) UpdateFile

func (img *Image) UpdateFile(path, id, name string, data []byte) error

UpdateFile updates file in image.

path is a file which will be replaced. It must be a path on RockRidge extention and a valid and existent filename on image's filesystem. (e.g. /EFI/BOOT/grub.cfg)

id is new filename, which is used when the image read as raw-ISO9660 filesystem.

name is also new filename, which is used when the image read as ISO9660 with RockRidge extention.

data is a content which will be written.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL