Skip to content

EDK II Package Dependency Graphs

Michael D Kinney edited this page Dec 13, 2019 · 1 revision

Package dependency graphs that shows the relationships between packages can be generated with the tool PackageDependencyGraph.py. This tool also detects issues such as nested packages, circular dependencies, and unresolved packages. The graphs on this page are generated after cloning the following EDK II repositories:

git clone https://github.com/mdkinney/edk2.git -b Bug_2161_PackageDependencyGraph
git clone https://github.com/tianocore/edk2-platforms.git
git clone https://github.com/tianocore/edk2-non-osi.git
git clone https://github.com/IntelFsp/FSP.git

Tool Prerequisites

  • EDK II Pytool Libraries and Extensions
cd edk2
pip install -r pip-requirements.txt

pip install networkx

  • GraphViz

    • Make sure the GraphViz dot command is in the system path
  • OPTIONAL: Google Chrome SVG Navigator

edk2 repository

This graph is generated with the following command. It scans the edk2 repository for EDK II packages and adds labels to the links between packages showing the number of times each dependent package is referenced. Packages that can not be resolved are included in the graph. The SVG output file edk2.svg is generated and the default web browser is launched to view the generated SVG file.

python edk2/BaseTools/Scripts/PackageDependencyGraph.py -w edk2 -l -u -b -o edk2.svg

edk2 repository skipping platform packages

This graph is generated with the following command. The same options above are used except the OVMF, Emulator, UEFI Payload, and ARM Virt platform packages are skipped to simplify the graph.

python edk2/BaseTools/Scripts/PackageDependencyGraph.py -w edk2 -l -u -b -o edk2-SkipPlatforms.svg -k OvmfPkg.dec -k ArmVirtPkg.dec -k EmulatorPkg.dec -k UefiPayloadPkg.dec

edk2 repository skipping platform and ARM packages

This graph is generated with the following command. The same options above are used except all the ARM packages are skipped to highlight the issues in the common packages.

python edk2/BaseTools/Scripts/PackageDependencyGraph.py -w edk2 -l -u -b -o edk2-SkipPlatformsAndArm.svg -k OvmfPkg.dec -k ArmVirtPkg.dec -k EmulatorPkg.dec -k UefiPayloadPkg.dec -k EmbeddedPkg.dec -k ArmPkg.dec -k ArmPlatformPkg.dec

edk2-platforms repository

This graph is generated with the following command. It scans the edk2-platforms repository for EDK II packages and adds labels to the links between packages showing the number of times each dependent package is referenced. Packages that can not be resolved are included in the graph. Since the EDK II packages in the edk2-platforms repository depend on EDK II packages from the edk2 repository, there are many unresolved packages when only the edk2-platforms repository is scanned. An SVG output file is generated and the default web browser is launched to view the generated SVG file. In addition, there are two instances of the AdvancedFeaturesPkg.dec in this repository, do the -p option is used to provide the path with higher priority.

python edk2/BaseTools/Scripts/PackageDependencyGraph.py -w edk2-platforms -l -u -b -o edk2-platforms.svg -p edk2-platforms/Platform/Intel

edk2-platforms hiding unresolved packages

This graph is generated with the following command. The same options above are used except unresolved packages are removed. This shows the relationships between the EDK II packages in the edk2-platforms repository.

python edk2/BaseTools/Scripts/PackageDependencyGraph.py -w edk2-platforms -l -b -o edk2-platforms-HideUnresolved.svg  -p edk2-platforms/Platform/Intel

edk2-platforms with binary packages hiding unresolved packages

This graph is generated with the following command. The same options above are used except binary packages from the edk2-non-osi and FSP repositories are added.

python edk2/BaseTools/Scripts/PackageDependencyGraph.py -w edk2-platforms -l    -b -o edk2-platforms-AddBinariesHideUnresolved.svg -p edk2-non-osi;FSP;edk2-platforms/Platform/Intel

edk2-non-osi repository

This graph is generated with the following command. It scans the edk2-non-osi repository for EDK II packages and adds labels to the links between packages showing the number of times each dependent package is referenced. Packages that can not be resolved are included in the graph. An SVG output file is generated and the default web browser is launched to view the generated SVG file.

python edk2/BaseTools/Scripts/PackageDependencyGraph.py -w edk2-non-osi -l -u -b -o edk2-non-osi.svg

FSP repository

This graph is generated with the following command. It scans the edk2-non-osi repository for EDK II packages and adds labels to the links between packages showing the number of times each dependent package is referenced. Packages that can not be resolved are included in the graph. An SVG output file is generated and the default web browser is launched to view the generated SVG file.

python edk2/BaseTools/Scripts/PackageDependencyGraph.py -w FSP -l -u -b -o FSP.svg

All packages from edk2, edk2-platforms, edk2-non-osi, and FSP

This graph is generated with the following command. It scans all 4 of the repositories for EDK II packages and adds labels to the links between packages showing the number of times each dependent package is referenced. Packages that can not be resolved are included in the graph. This is a complete view of all the EDK II open source packages with all known issues. This graph is complex and resolving issues can focus on the repository specific graphs above. An SVG output file is generated and the default web browser is launched to view the generated SVG file.

python edk2/BaseTools/Scripts/PackageDependencyGraph.py -w . -l -u -b -o all.svg -p edk2-platforms/Platform/Intel
Clone this wiki locally