Skip to content

Commit

Permalink
WIP: debug FV assembly
Browse files Browse the repository at this point in the history
Signed-off-by: Daniel Maslowski <[email protected]>
  • Loading branch information
orangecms committed Sep 28, 2024
1 parent df71279 commit cbe3614
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
6 changes: 5 additions & 1 deletion pkg/uefi/firmwarevolume.go
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,11 @@ func (fv *FirmwareVolume) InsertFile(alignedOffset uint64, fBuf []byte) error {
// Check size
fLen := uint64(len(fBuf))
if fLen == 0 {
return errors.New("trying to insert empty file")
if true {
return nil
} else {
return errors.New("trying to insert empty file")
}
}
// Overwrite old data in the firmware volume.
fv.buf = append(fv.buf, fBuf...)
Expand Down
3 changes: 2 additions & 1 deletion pkg/visitors/assemble.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,9 @@ func (v *Assemble) Visit(f uefi.Firmware) error {
for _, file := range f.Files {
fileBuf := file.Buf()
fileLen := uint64(len(fileBuf))
log.Warnf("adding %v ", file.Header.GUID)
if fileLen == 0 {
log.Fatalf("%v", file.Header.GUID)
log.Warnf("%v empty?", file.Header.GUID)
}

// Pad to the 8 byte alignments.
Expand Down

0 comments on commit cbe3614

Please sign in to comment.