verity

package
v1.74.2 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2026 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CloseMapper

func CloseMapper(ctx context.Context, module string) error

CloseMapper closes device mapper for the module Equivalent shell command: veritysetup close <module>

func CreateImage

func CreateImage(ctx context.Context, modulePath, imagePath string) error

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

func CreateImageByTar(ctx context.Context, rc io.ReadCloser, imagePath string) error

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

func CreateImageHash(ctx context.Context, imagePath string) (string, error)

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

func CreateMapper(ctx context.Context, name, imagePath, hash string) error

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 IsSupported

func IsSupported() bool

IsSupported scans /proc/filesystems for erofs type, it returns whether erofs is supported

func Mount

func Mount(ctx context.Context, module, mountPath string) error

Mount ensures the mount path and mounts the device mapper to it

func Unmount

func Unmount(ctx context.Context, mountPath string) error

Unmount unmounts image and remove mount path

func VerifyImage

func VerifyImage(ctx context.Context, imagePath, rootHash string) error

VerifyImage performs verification of the erofs image against its hash tree using veritysetup. Equivalent shell command: veritysetup verify <imagePath> <hashPath> <root_hash>

Types

This section is empty.

Jump to

Keyboard shortcuts

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