bakaft@BakaFT-PC:~/edk2$ git submodule update --init Cloning into '/home/bakaft/edk2/ArmPkg/Library/ArmSoftFloatLib/berkeley-softfloat-3'... Cloning into '/home/bakaft/edk2/BaseTools/Source/C/BrotliCompress/brotli'... Cloning into '/home/bakaft/edk2/CryptoPkg/Library/OpensslLib/openssl'... Cloning into '/home/bakaft/edk2/MdeModulePkg/Library/BrotliCustomDecompressLib/brotli'... Cloning into '/home/bakaft/edk2/MdeModulePkg/Universal/RegularExpressionDxe/oniguruma'... Cloning into '/home/bakaft/edk2/RedfishPkg/Library/JsonLib/jansson'... Cloning into '/home/bakaft/edk2/UnitTestFrameworkPkg/Library/CmockaLib/cmocka'... Submodule path 'ArmPkg/Library/ArmSoftFloatLib/berkeley-softfloat-3': checked out 'b64af41c3276f97f0e181920400ee056b9c88037' Submodule path 'BaseTools/Source/C/BrotliCompress/brotli': checked out 'f4153a09f87cbb9c826d8fc12c74642bb2d879ea' Submodule path 'CryptoPkg/Library/OpensslLib/openssl': checked out 'd82e959e621a3d597f1e0d50ff8c2d8b96915fd7' Submodule path 'MdeModulePkg/Library/BrotliCustomDecompressLib/brotli': checked out 'f4153a09f87cbb9c826d8fc12c74642bb2d879ea' Submodule path 'MdeModulePkg/Universal/RegularExpressionDxe/oniguruma': checked out 'abfc8ff81df4067f309032467785e06975678f0d' Submodule path 'RedfishPkg/Library/JsonLib/jansson': checked out 'e9ebfa7e77a6bee77df44e096b100e7131044059' Submodule path 'UnitTestFrameworkPkg/Library/CmockaLib/cmocka': checked out '1cc9cde3448cdd2e000886a26acf1caac2db7cf1'
编译 EDK2 工具链
EDK2 拥有自己的构建工具链
1
bakaft@BakaFT-PC:~/edk2$ make -C BaseTools
配置工作区环境变量
每次重启 Bash 还要重新设置一次
1
bakaft@BakaFT-PC:~/edk2$ . edksetup.sh
构建测试
设置构建目标信息
编辑$CONF_PATH/target.txt
修改 20 行:
1
ACTIVE_PLATFORM = MdeModulePkg/MdeModulePkg.dsc
54 行:
1
TOOL_CHAIN_TAG = GCC5
尝试构建
1 2 3 4 5 6
build # ....
- Done - Build end time: 00:20:58, May.22 2022 Build total time: 00:00:45
构建完毕后即可看到编译好的文件
1 2
root@BakaFT-PC:~/edk2# ls Build/MdeModule/DEBUG_*/*/HelloWorld.efi Build/MdeModule/DEBUG_GCC5/IA32/HelloWorld.efi