func (fv FirmwareVolume) String() string {
	if fv.ExtHeaderOffset != 0 {
		return fv.FVName.String()
	}
	return fv.FileSystemGUID.String()
}
String creates a string representation for the firmware volume.
package uefi
import (
	"bytes"
	"encoding/binary"
	"errors"
	"fmt"
	"github.com/linuxboot/fiano/pkg/guid"
	"github.com/linuxboot/fiano/pkg/log"
)
const (
	FirmwareVolumeFixedHeaderSize  = 56
	FirmwareVolumeMinSize          = FirmwareVolumeFixedHeaderSize + 8  
	FirmwareVolumeExtHeaderMinSize = 20
)
var (
	FFS1      = guid.MustParse("7a9354d9-0468-444a-81ce-0bf617d890df")
	FFS2      = guid.MustParse("8c8ce578-8a3d-4f1c-9935-896185c32dd3")
	FFS3      = guid.MustParse("5473c07a-3dcb-4dca-bd6f-1e9689e7349a")
	EVSA      = guid.MustParse("fff12b8d-7696-4c8b-a985-2747075b4f50")
	NVAR      = guid.MustParse("cef5b9a3-476d-497f-9fdc-e98143e0422c")
	EVSA2     = guid.MustParse("00504624-8a59-4eeb-bd0f-6b36e96128e0")
	AppleBoot = guid.MustParse("04adeead-61ff-4d31-b6ba-64f8bf901f5a")
	PFH1      = guid.MustParse("16b45da2-7d70-4aea-a58d-760e9ecb841d")
	PFH2      = guid.MustParse("e360bdba-c3ce-46be-8f37-b231e5cb9f35")
)
var FVGUIDs = map[guid.GUID]string{
	*FFS1:      "FFS1",
	*FFS2:      "FFS2",
	*FFS3:      "FFS3",
	*EVSA:      "NVRAM_EVSA",
	*NVAR:      "NVRAM_NVAR",
	*EVSA2:     "NVRAM_EVSA2",
	*AppleBoot: "APPLE_BOOT",
	*PFH1:      "PFH1",
	*PFH2:      "PFH2",
}
var supportedFVs = map[guid.GUID]bool{
	*FFS2: true,
	*FFS3: true,
}
type Block struct {
	Count uint32
	Size  uint32
}
type FirmwareVolumeFixedHeader struct {
	_               [16]uint8
	FileSystemGUID  guid.GUID
	Length          uint64
	Signature       uint32
	Attributes      uint32  
	HeaderLen       uint16
	Checksum        uint16
	ExtHeaderOffset uint16
	Reserved        uint8 `json:"-"`
	Revision        uint8
}
type FirmwareVolumeExtHeader struct {
	FVName        guid.GUID
	ExtHeaderSize uint32
}
type FirmwareVolume struct {
	FirmwareVolumeFixedHeader
	Blocks []Block
	FirmwareVolumeExtHeader
	Files []*File `json:",omitempty"`
	DataOffset  uint64
	FVType      string `json:"-"`
	buf         []byte
	FVOffset    uint64  
	ExtractPath string
	Resizable   bool    
	FreeSpace   uint64 `json:"-"`
}
func (fv *FirmwareVolume) Buf() []byte {
	return fv.buf
}
func (fv *FirmwareVolume) SetBuf(buf []byte) {
	fv.buf = buf
}
func (fv *FirmwareVolume) Apply(v Visitor) error {
	return v.Visit(fv)
}
func (fv *FirmwareVolume) ApplyChildren(v Visitor) error {
	for _, f := range fv.Files {
		if err := f.Apply(v); err != nil {
			return err
		}
	}
	return nil
}
func (fv *FirmwareVolume) GetErasePolarity() uint8 {
	if fv.Attributes&0x800 != 0 {
		return 0xFF
	}
	return 0
}