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

Update Driver to existing Binary of specified GUID #12

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Commits on Apr 28, 2023

  1. Update Driver to existing Binary of specified GUID

    1. Functions Introduction
    Functions:
        1. Parse the input FV file into a origin binary tree. Currently, we just support FV level replacement operation, so we define two different types of tree nodes - FV/ FFS.
        2. Given a new FFS file , parse the new FFS file into a new binary tree and get the new FFS Node from the new binary tree.
        3. Find target FFS node from the origin binary tree with new FFS's driver guid.
        4. Replace the target FFS node with New FFS node in the binary tree.
        5. Encapsulate binary with replaced FFS.
    Design thoughts:
        A binary tree will be created for binary file to include all the info.
        The whole binary file will be seen as a Root Node of the tree. When parse the binary, the FV and FFS part will be seen as the FVNode/FFSNode which is the Child of the ROOT/FVNode.
        With the tree, both the structure and data of ROOT/FV/FFS... can be saved which can be used for function extensions.
    
    2. Use method
    Method 1:
        Step 1: Copy the origin "bios_image.bin" & target "driver_image.ffs" (The file name can not be changed) into the XmlCli repo root folder.
        Step 2: Open windows console with XmlCli repo root folder, then run "py -3 src\xmlcli\common\bios_fw_parser.py".
        Then the expected output binary file "replaced_image.bin" will be generated into the root folder.
    Method 2:
        Step 1: Copy the origin "bios_image.bin" & target "driver_image.ffs"( with your own file name )into the XmlCli repo root folder.
        Step 2: Open windows console with XmlCli repo root folder, then run "py -3 src\xmlcli\common\bios_fw_parser.py -r $(input_binary_file) $(target_driver_ffs).ffs $(output_binary_file)".
        Then the expected output binary file $(output_binary_file) will be generated into the root folder.
    
    3. Known Issue
    3.1 Only support replace the first find driver ffs.
    3.2 Only support replace the same guid driver ffs file.
    3.3 The entry extension in xmlcli_registry_listener.py does not been complemented.
    
    4. Extension direction
    4.1 All the Known Issues can be enhanced with more details requirements descriptions.
    4.2 The binary tree can be extended to save all level's FV and FFS and Section Node through binary parsing.
    4.3 The existed binary Tree can be used to extend more functions like "Add a new driver / Delete a driver...".
    
    Signed-off-by: Yuwei Chen <yuwei.chen@intel.com>
    Signed-off-by: Yuting Yang <yuting2.yang@intel.com>
    YuweiChen1110 committed Apr 28, 2023
    Configuration menu
    Copy the full SHA
    a8490f0 View commit details
    Browse the repository at this point in the history

Commits on Jun 13, 2024

  1. Configuration menu
    Copy the full SHA
    409d636 View commit details
    Browse the repository at this point in the history