Skip to contentSkip to conversation

arm/edk2-firmware: no need to inherit python3native

PATCH In review Ross Burton 2 participants 7 messages Oct 20, 2020 – Oct 25, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/6 arm/edk2-firmware: no need to inherit python3native

There are no python3-foo-native dependencies, so just set PYTHON to the host python3 (which is in HOSTTOOLS) and remove the python3native inherit.

Change-Id I1234d04df380a71a1e881328157e1d154f3cb49c
---
 meta-arm/recipes-bsp/uefi/edk2-firmware_git.bb | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
meta-arm/recipes-bsp/uefi/edk2-firmware_git.bb +1 -2
index a343e07..ee8f523 100644
@@ -29,7 +29,6 @@ EDK2_BUILD_MODE = "${@bb.utils.contains('EDK2_BUILD_RELEASE', '1', 'RELEASE', 'D
 
 DEPENDS += "util-linux-native iasl-native"
 
-inherit python3native
 inherit deploy
 
 B = "${WORKDIR}/build"
@@ -48,7 +47,7 @@ export GCC5_AARCH64_PREFIX = "${STAGING_BINDIR_TOOLCHAIN}/${TARGET_PREFIX}"
 export PACKAGES_PATH       = "${S}/edk2:${S}/edk2/edk2-platforms"
 export WORKSPACE           = "${S}/edk2"
 export EDK_TOOLS_PATH      = "${WORKSPACE}/BaseTools"
-export PYTHON_COMMAND      = "${PYTHON}"
+export PYTHON_COMMAND      = "python3"
 export CONF_PATH           = "${WORKSPACE}/Conf"
 
 export BTOOLS_PATH = "${EDK_TOOLS_PATH}/BinWrappers/PosixLike"
Signature · 1 line
2.25.1
#1 lore raw

PATCH 2/6 arm/edk2-firware: don't handle obsolete GCC releases

There's no point in handling GCC cross compilers that are before version 5, as GCC 5 came out in 2017 and is obsolete now.

Change-Id I650ee44c433f70004d20c0219310ddbd4028addb
---
 meta-arm/recipes-bsp/uefi/edk2-firmware_git.bb | 12 +-----------
 1 file changed, 1 insertion(+), 11 deletions(-)
meta-arm/recipes-bsp/uefi/edk2-firmware_git.bb +1 -11
index ee8f523..74924b4 100644
@@ -52,17 +52,7 @@ export CONF_PATH           = "${WORKSPACE}/Conf"
 
 export BTOOLS_PATH = "${EDK_TOOLS_PATH}/BinWrappers/PosixLike"
 
-python __anonymous() {
-    # If GCC Version is greater than 4 then pass GCC5
-    # set GCC5 by default
-    d.setVar('GCC_VER', 'GCC5')
-
-    # Otherwise pass the corresponding version
-    G = d.getVar('GCCVERSION',True).split(".")
-    gcc_vlist = ['1', '2', '3', '4']
-    if G[0] in gcc_vlist:
-        d.setVar('GCC_VER', 'GCC'+G[0])
-}
+GCC_VER ?= "GCC5"
 
 do_compile() {
     sed -i -e 's:-I \.\.:-I \.\. ${BUILD_CFLAGS} :' ${EDK_TOOLS_PATH}/Source/C/Makefiles/header.makefile
Signature · 1 line
2.25.1
#2 lore raw

PATCH 3/6 arm/edk2-firmare: use gitsm fetcher

In reply to Ross Burton

The EDK2 repository contains a number of submodules and some builds need them, so use the gitsm fetcher to ensure they're always fetched.

Change-Id I63cf20900b3fa636f409926222c715b7f6a7bb89
---
 meta-arm/recipes-bsp/uefi/edk2-firmware_git.bb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta-arm/recipes-bsp/uefi/edk2-firmware_git.bb +1 -1
index 74924b4..4012f0e 100644
@@ -12,7 +12,7 @@ LIC_FILES_CHKSUM = "file://edk2/License.txt;md5=2b415520383f7964e96700ae12b4570a
 LIC_FILES_CHKSUM += "file://edk2/edk2-platforms/License.txt;md5=2b415520383f7964e96700ae12b4570a"
 
 SRC_URI ?= "\
-    git://github.com/tianocore/edk2.git;name=edk2;destsuffix=${S}/edk2;nobranch=1 \
+    gitsm://github.com/tianocore/edk2.git;name=edk2;destsuffix=${S}/edk2;nobranch=1 \
     git://github.com/tianocore/edk2-platforms.git;name=edk2-platforms;destsuffix=${S}/edk2/edk2-platforms;nobranch=1 \
 "
 SRCREV_edk2           ?= "6ff7c838d09224dd4e4c9b5b93152d8db1b19740"
Signature · 1 line
2.25.1
#3 lore raw

PATCH 4/6 arm-bsp/edk2-firmware: remove redundant SRC_URI

In reply to Ross Burton

Now that the base recipe uses gitsm: the SRC_URI can be removed from here.

Change-Id Ic070a8a84c49a9c731690ad660501fb61b092750
---
 meta-arm-bsp/recipes-bsp/uefi/edk2-firmware-sgi575.inc | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)
meta-arm-bsp/recipes-bsp/uefi/edk2-firmware-sgi575.inc +1 -6
index e27d617..0e30a71 100644
@@ -1,8 +1,3 @@
-SRC_URI = "\
-    gitsm://github.com/tianocore/edk2.git;name=edk2;destsuffix=${S}/edk2;nobranch=1 \
-    git://github.com/tianocore/edk2-platforms.git;name=edk2-platforms;destsuffix=${S}/edk2/edk2-platforms;nobranch=1 \
-"
-# TAGS and commit ID
 SRCREV_edk2           = "50528537b2fb0ebdf32c719a0525635c93b905c2"
 SRCREV_edk2-platforms = "b972f17b329a85e6aa4d69f240d459839ba8b47c"
 
@@ -15,4 +10,4 @@ EDK2_ARCH          = "AARCH64"
 
 COMPATIBLE_MACHINE = "sgi575"
 
-PV ?= "202005+git${SRCPV}"
+PV = "202005+git${SRCPV}"
Signature · 1 line
2.25.1
#4 lore raw

PATCH 5/6 arm/edk2-firmware: rationalise $S

In reply to Ross Burton

Currently edk2-firmware sets S to WORKDIR/git/ and unpacks edk2 into WORKDIR/git/edk2. This isn't idiomatic and breaks tooling such as devtool which expects a git fetcher to unpack a git repository to $S.

Move the edk2 unpack to $S directly, and update the recipe where required.

Change-Id Ib9571032c14a01864860e2eb5a04ed73dd382710
---
 .../recipes-bsp/uefi/edk2-firmware-n1sdp.inc  |  4 +--
 .../recipes-bsp/uefi/edk2-firmware_git.bb     | 35 ++++++++++---------
 2 files changed, 20 insertions(+), 19 deletions(-)
meta-arm-bsp/recipes-bsp/uefi/edk2-firmware-n1sdp.inc +2 -2
index 6bd7d79..78463ac 100644
@@ -1,6 +1,6 @@
 SRC_URI = "\
-    git://git.linaro.org/landing-teams/working/arm/edk2.git;name=edk2;destsuffix=git/edk2;nobranch=1 \
-    git://git.linaro.org/landing-teams/working/arm/edk2-platforms.git;name=edk2-platforms;destsuffix=git/edk2/edk2-platforms;nobranch=1 \
+    git://git.linaro.org/landing-teams/working/arm/edk2.git;name=edk2;destsuffix=edk2;nobranch=1 \
+    git://git.linaro.org/landing-teams/working/arm/edk2-platforms.git;name=edk2-platforms;destsuffix=edk2/edk2-platforms;nobranch=1 \
 "
 
 # TAGS and commit ID as per N1SDP-2020.03.26 release
meta-arm/recipes-bsp/uefi/edk2-firmware_git.bb +18 -17
index 4012f0e..a0f2fbe 100644
@@ -7,13 +7,13 @@ LICENSE = "BSD-2-Clause-Patent"
 PROVIDES += "virtual/uefi-firmware"
 
 # EDK2
-LIC_FILES_CHKSUM = "file://edk2/License.txt;md5=2b415520383f7964e96700ae12b4570a"
+LIC_FILES_CHKSUM = "file://License.txt;md5=2b415520383f7964e96700ae12b4570a"
 # EDK2 Platforms
-LIC_FILES_CHKSUM += "file://edk2/edk2-platforms/License.txt;md5=2b415520383f7964e96700ae12b4570a"
+LIC_FILES_CHKSUM += "file://edk2-platforms/License.txt;md5=2b415520383f7964e96700ae12b4570a"
 
-SRC_URI ?= "\
-    gitsm://github.com/tianocore/edk2.git;name=edk2;destsuffix=${S}/edk2;nobranch=1 \
-    git://github.com/tianocore/edk2-platforms.git;name=edk2-platforms;destsuffix=${S}/edk2/edk2-platforms;nobranch=1 \
+SRC_URI = "\
+    gitsm://github.com/tianocore/edk2.git;name=edk2;destsuffix=edk2;nobranch=1 \
+    git://github.com/tianocore/edk2-platforms.git;name=edk2-platforms;destsuffix=edk2/edk2-platforms;nobranch=1 \
 "
 SRCREV_edk2           ?= "6ff7c838d09224dd4e4c9b5b93152d8db1b19740"
 SRCREV_edk2-platforms ?= "ed4cc8059ec551032f0d8b8c172e9ec19214a638"
@@ -31,8 +31,9 @@ DEPENDS += "util-linux-native iasl-native"
 
 inherit deploy
 
+S = "${WORKDIR}/edk2"
 B = "${WORKDIR}/build"
-S = "${WORKDIR}/git"
+do_compile[cleandirs] += "${B}"
 
 PACKAGE_ARCH = "${MACHINE_ARCH}"
 COMPATIBLE_MACHINE ?= "invalid"
@@ -44,11 +45,11 @@ do_configure[noexec] = "1"
 
 # Set variables as per envsetup
 export GCC5_AARCH64_PREFIX = "${STAGING_BINDIR_TOOLCHAIN}/${TARGET_PREFIX}"
-export PACKAGES_PATH       = "${S}/edk2:${S}/edk2/edk2-platforms"
-export WORKSPACE           = "${S}/edk2"
-export EDK_TOOLS_PATH      = "${WORKSPACE}/BaseTools"
+export PACKAGES_PATH       = "${S}:${S}/edk2-platforms"
+export WORKSPACE           = "${B}"
+export EDK_TOOLS_PATH      = "${S}/BaseTools"
 export PYTHON_COMMAND      = "python3"
-export CONF_PATH           = "${WORKSPACE}/Conf"
+export CONF_PATH           = "${S}/Conf"
 
 export BTOOLS_PATH = "${EDK_TOOLS_PATH}/BinWrappers/PosixLike"
 
@@ -59,24 +60,24 @@ do_compile() {
     sed -i -e 's: -luuid: -luuid ${BUILD_LDFLAGS}:g' ${EDK_TOOLS_PATH}/Source/C/*/GNUmakefile
 
     # Copy the templates as we don't run envsetup
-    cp ${EDK_TOOLS_PATH}/Conf/build_rule.template ${WORKSPACE}/Conf/build_rule.txt
-    cp ${EDK_TOOLS_PATH}/Conf/tools_def.template ${WORKSPACE}/Conf/tools_def.txt
-    cp ${EDK_TOOLS_PATH}/Conf/target.template ${WORKSPACE}/Conf/target.txt
+    cp ${EDK_TOOLS_PATH}/Conf/build_rule.template ${S}/Conf/build_rule.txt
+    cp ${EDK_TOOLS_PATH}/Conf/tools_def.template ${S}/Conf/tools_def.txt
+    cp ${EDK_TOOLS_PATH}/Conf/target.template ${S}/Conf/target.txt
 
     # Build basetools
-    oe_runmake -C ${S}/edk2/BaseTools
+    oe_runmake -C ${S}/BaseTools
 
     PATH="${WORKSPACE}:${BTOOLS_PATH}:$PATH" \
-    "${S}/edk2/BaseTools/BinWrappers/PosixLike/build" \
+    "${S}/BaseTools/BinWrappers/PosixLike/build" \
        -a "${EDK2_ARCH}" \
        -b ${EDK2_BUILD_MODE} \
        -t ${GCC_VER} \
-       -p "${S}/edk2/edk2-platforms/Platform/ARM/${EDK2_PLATFORM_DSC}"
+       -p "${S}/edk2-platforms/Platform/ARM/${EDK2_PLATFORM_DSC}"
 }
 
 do_install() {
     install -d ${D}/firmware
-    install "${S}/edk2/Build/${EDK2_PLATFORM}/${EDK2_BUILD_MODE}_${GCC_VER}/FV/${EDK2_BIN_NAME}" "${D}/firmware/uefi.bin"
+    install ${B}/Build/${EDK2_PLATFORM}/${EDK2_BUILD_MODE}_${GCC_VER}/FV/${EDK2_BIN_NAME} ${D}/firmware/uefi.bin
 }
 
 FILES_${PN} = "/firmware"
Signature · 1 line
2.25.1
#5 lore raw

PATCH 6/6 arm/edk2-firmware: set do_configure[cleandirs] to ensure B is empty

In reply to Ross Burton
Change-Id I0df26d6f39613ee65cce5a297dbcd17f299ac0be
---
 meta-arm/recipes-bsp/uefi/edk2-firmware_git.bb | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
meta-arm/recipes-bsp/uefi/edk2-firmware_git.bb +1 -3
index a0f2fbe..39a041f 100644
@@ -33,15 +33,13 @@ inherit deploy
 
 S = "${WORKDIR}/edk2"
 B = "${WORKDIR}/build"
-do_compile[cleandirs] += "${B}"
 
 PACKAGE_ARCH = "${MACHINE_ARCH}"
 COMPATIBLE_MACHINE ?= "invalid"
 
 LDFLAGS[unexport] = "1"
 
-# No configure
-do_configure[noexec] = "1"
+do_configure[cleandirs] += "${B}"
 
 # Set variables as per envsetup
 export GCC5_AARCH64_PREFIX = "${STAGING_BINDIR_TOOLCHAIN}/${TARGET_PREFIX}"
Signature · 1 line
2.25.1
#6 lore raw
In reply to Ross Burton
Quoted 5 lines · Ross Burton

There are no python3-foo-native dependencies, so just set PYTHON to the host python3 (which is in HOSTTOOLS) and remove the python3native inherit.

Change-Id I1234d04df380a71a1e881328157e1d154f3cb49c

Series applied to master.

Thanks,
Jon

Quoted 32 lines
---
 meta-arm/recipes-bsp/uefi/edk2-firmware_git.bb | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
meta-arm/recipes-bsp/uefi/edk2-firmware_git.bb +1 -2
index a343e07..ee8f523 100644
@@ -29,7 +29,6 @@ EDK2_BUILD_MODE = "${@bb.utils.contains('EDK2_BUILD_RELEASE', '1', 'RELEASE', 'D
 
 DEPENDS += "util-linux-native iasl-native"
 
-inherit python3native
 inherit deploy
 
 B = "${WORKDIR}/build"
@@ -48,7 +47,7 @@ export GCC5_AARCH64_PREFIX = "${STAGING_BINDIR_TOOLCHAIN}/${TARGET_PREFIX}"
 export PACKAGES_PATH       = "${S}/edk2:${S}/edk2/edk2-platforms"
 export WORKSPACE           = "${S}/edk2"
 export EDK_TOOLS_PATH      = "${WORKSPACE}/BaseTools"
-export PYTHON_COMMAND      = "${PYTHON}"
+export PYTHON_COMMAND      = "python3"
 export CONF_PATH           = "${WORKSPACE}/Conf"
 
 export BTOOLS_PATH = "${EDK_TOOLS_PATH}/BinWrappers/PosixLike"
Signature · 1 line
2.25.1