Documentation ¶
Index ¶
- func AppendDMVerity(p *params)
- func AppendVhdFooter(p *params)
- func Convert(r io.Reader, w io.ReadWriteSeeker, options ...Option) error
- func ConvertAndComputeRootDigest(r io.Reader) (string, error)
- func ConvertBackslash(p *params)
- func ConvertTarToExt4(r io.Reader, w io.ReadWriteSeeker, options ...Option) error
- func ConvertToVhd(w io.WriteSeeker) error
- func ConvertWhiteout(p *params)
- func Ext4FileSystemSize(r io.ReadSeeker) (int64, int, error)
- func InlineData(p *params)
- func IsDeviceExt4(devicePath string) bool
- func OnlyAppendVhdFooter(p *params)
- func ReadExt4SuperBlock(devicePath string) (*format.SuperBlock, error)
- func ReadExt4SuperBlockReadSeeker(rsc io.ReadSeeker) (*format.SuperBlock, error)
- type Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AppendDMVerity ¶
func AppendDMVerity(p *params)
AppendDMVerity instructs the converter to add a dmverity Merkle tree for the ext4 filesystem after the filesystem and before the optional VHD footer
func AppendVhdFooter ¶
func AppendVhdFooter(p *params)
AppendVhdFooter instructs the converter to add a fixed VHD footer to the file.
func Convert ¶
Convert wraps ConvertTarToExt4 and conditionally computes (and appends) the file image's cryptographic hashes (merkle tree) or/and appends a VHD footer.
func ConvertAndComputeRootDigest ¶
ConvertAndComputeRootDigest writes a compact ext4 file system image that contains the files in the input tar stream, computes the resulting file image's cryptographic hashes (merkle tree) and returns merkle tree root digest. Convert is called with minimal options: ConvertWhiteout and MaximumDiskSize set to dmverity.RecommendedVHDSizeGB.
func ConvertBackslash ¶
func ConvertBackslash(p *params)
ConvertBackslash instructs the converter to replace `\` in path names with `/`. This is useful if the tar file was created on Windows, where `\` is the filepath separator.
func ConvertTarToExt4 ¶
ConvertTarToExt4 writes a compact ext4 file system image that contains the files in the input tar stream.
func ConvertToVhd ¶
func ConvertToVhd(w io.WriteSeeker) error
ConvertToVhd converts given io.WriteSeeker to VHD, by appending the VHD footer with a fixed size.
func ConvertWhiteout ¶
func ConvertWhiteout(p *params)
ConvertWhiteout instructs the converter to convert OCI-style whiteouts (beginning with .wh.) to overlay-style whiteouts.
func Ext4FileSystemSize ¶
func Ext4FileSystemSize(r io.ReadSeeker) (int64, int, error)
Ext4FileSystemSize reads ext4 superblock and returns the size of the underlying ext4 file system and its block size.
func InlineData ¶
func InlineData(p *params)
InlineData instructs the converter to write small files into the inode structures directly. This creates smaller images but currently is not compatible with DAX.
func IsDeviceExt4 ¶
IsDeviceExt4 is will read the device's superblock and determine if it is and ext4 superblock.
func OnlyAppendVhdFooter ¶
func OnlyAppendVhdFooter(p *params)
OnlyAppendVhdFooter instructs the converter not to convert but still to add a fixed VHD footer to the file.
func ReadExt4SuperBlock ¶
func ReadExt4SuperBlock(devicePath string) (*format.SuperBlock, error)
ReadExt4SuperBlock reads and returns ext4 super block from given device.
func ReadExt4SuperBlockReadSeeker ¶
func ReadExt4SuperBlockReadSeeker(rsc io.ReadSeeker) (*format.SuperBlock, error)
ReadExt4SuperBlockReadSeeker reads and returns ext4 super block given an io.ReadSeeker.
The layout on disk is as follows: | Group 0 padding | - 1024 bytes | ext4 SuperBlock | - 1 block | Group Descriptors | - many blocks | Reserved GDT Blocks | - many blocks | Data Block Bitmap | - 1 block | inode Bitmap | - 1 block | inode Table | - many blocks | Data Blocks | - many blocks
More details can be found here https://ext4.wiki.kernel.org/index.php/Ext4_Disk_Layout
Our goal is to skip the Group 0 padding, read and return the ext4 SuperBlock
Types ¶
type Option ¶
type Option func(*params)
Option is the type for optional parameters to Convert.
func MaximumDiskSize ¶
MaximumDiskSize instructs the writer to limit the disk size to the specified value. This also reserves enough metadata space for the specified disk size. If not provided, then 16GB is the default.