Documentation
¶
Index ¶
- Variables
- func CloseMapper(ctx context.Context, name string) error
- func CreateImage(ctx context.Context, modulePath, imagePath string) error
- func CreateImageByTar(ctx context.Context, rc io.ReadCloser, imagePath string) error
- func CreateImageHash(ctx context.Context, imagePath string) (string, error)
- func CreateMapper(ctx context.Context, name, imagePath, hash string) error
- func GetVersionByDevice(ctx context.Context, name string) (string, error)
- func IsSupported() bool
- func Mount(ctx context.Context, name, mountPath string) error
- func Unmount(ctx context.Context, mountPath string) error
- func VerifyImage(ctx context.Context, imagePath, rootHash string) error
Constants ¶
This section is empty.
Variables ¶
var ( ErrVersionNotFound = errors.New("version not found") ErrEmptyHash = errors.New("empty hash") )
Functions ¶
func CloseMapper ¶
CloseMapper closes device mapper Equivalent shell command: veritysetup close <name>
func CreateImage ¶
CreateImage uses mkfs.erofs to create image from module dir. Equivalent shell command: mkfs.erofs --aufs --quiet -Enoinline_data -T 1750791050 -Uclear -x-1 <imagePath> <modulePath>
func CreateImageByTar ¶
CreateImageByTar uses mkfs.erofs to create image from tar. Equivalent shell command: mkfs.erofs --tar=f --aufs --quiet -Enoinline_data -T 1750791050 -Uclear -x-1 <imagePath> <modulePath>
func CreateImageHash ¶
CreateImageHash computes hash from the image by veritysetup format Equivalent shell command: veritysetup format --data-block-size=4096 --hash-block-size=4096 --salt=<salt> <imagePath> <hashPath>
func CreateMapper ¶
CreateMapper creates device mapper for the erofs image. It creates two loop devices and attach image and hash file for them. Equivalent shell command: veritysetup open <imagePath> <name> <hashPath> <hash>
func GetVersionByDevice ¶ added in v1.75.0
GetVersionByDevice retrieves the image version from an active dm-verity device by querying its status via veritysetup and parsing the data device path. Equivalent shell command: veritysetup status <name>
func IsSupported ¶
func IsSupported() bool
IsSupported scans /proc/filesystems for erofs type, it returns whether erofs is supported
Types ¶
This section is empty.