Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BaseTools FMMT handle case where Parent.Data is none (previously easier bug report?) #10557

Open
jaredmauch opened this issue Dec 20, 2024 Discussed in #6558 · 2 comments
Open
Assignees
Labels
priority:high Significant impact. Should be fixed as soon as possible. type:bug Something isn't working

Comments

@jaredmauch
Copy link

Discussed in #6558

Originally posted by jaredmauch December 18, 2024
I've found a bug in FMMT and wanted to quickly report it but don't have a chance to do fork() and PR

--- a/BaseTools/Source/Python/FMMT/core/FMMTOperation.py
+++ b/BaseTools/Source/Python/FMMT/core/FMMTOperation.py
@@ -184,12 +184,13 @@ def ExtractFfs(inputfile: str, Ffs_name: str, outputfile: str, Fv_name: str=None
     if Fv_name:
         FindNum = len(FmmtParser.WholeFvTree.Findlist)
         for index in range(FindNum-1, -1, -1):
-            if FmmtParser.WholeFvTree.Findlist[index].Parent.key != Fv_name and FmmtParser.WholeFvTree.Findlist[index].Parent.Data.Name != Fv_name:
+            if FmmtParser.WholeFvTree.Findlist[index].Parent.key != Fv_name and FmmtParser.WholeFvTree.Findlist[index].Parent.Data is not None and FmmtParser.WholeFvTree.Findlist[index].Parent.Data.Name != Fv_name:^M

You can't force a bios vendor (in this case DELL) to fix things, but you can at least fix the parser bug that prevents it from being loaded.

This change resolves the problem that I was having:

  File "/home/jared/bios/edk2/BaseTools/Source/Python/FMMT/core/FMMTOperation.py", line 187, in ExtractFfs
    if FmmtParser.WholeFvTree.Findlist[index].Parent.key != Fv_name and FmmtParser.WholeFvTree.Findlist[index].Parent.Data.Name != Fv_name:
                                                                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'Name'

because Parent.Data was None, and it was being referenced here. There may be a better way to fix this issue, but this change is allowing me to move on with my project.

@mdkinney
Copy link
Member

@AshrafAliS I think you are working on some FMMT related issues. Can you pull this one in too?

@mdkinney mdkinney changed the title easier bug report? BaseTools FMMT handle case where Parent.Data is none (previously easier bug report?) Dec 20, 2024
@mdkinney mdkinney added priority:high Significant impact. Should be fixed as soon as possible. type:bug Something isn't working labels Dec 21, 2024
@AshrafAliS
Copy link
Contributor

@jaredmauch is it possible to share the below data.

  1. BIOS image
  2. Command being used.
  3. FMMT dump

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority:high Significant impact. Should be fixed as soon as possible. type:bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants