[meta-arm,1/2] arm/edk2-firmware: merge the .bb/.inc files

Submitted by Ross Burton on July 13, 2020, 10:48 a.m. | Patch ID: 174417

Details

Message ID 20200713104804.174263-1-ross@burtonini.com
State New
Headers show

Commit Message

Ross Burton July 13, 2020, 10:48 a.m.
From: Ross Burton <ross.burton@arm.com>

There is no reason to split this recipe between two files, so merge them.

Change-Id: I130cfb0ef78baa3117d5683d4732bc9b86798869
Signed-off-by: Ross Burton <ross.burton@arm.com>
---
 meta-arm/recipes-bsp/uefi/edk2-firmware.inc   | 84 -------------------
 .../recipes-bsp/uefi/edk2-firmware_git.bb     | 84 ++++++++++++++++++-
 2 files changed, 83 insertions(+), 85 deletions(-)
 delete mode 100644 meta-arm/recipes-bsp/uefi/edk2-firmware.inc

Patch hide | download patch | download mbox

diff --git a/meta-arm/recipes-bsp/uefi/edk2-firmware.inc b/meta-arm/recipes-bsp/uefi/edk2-firmware.inc
deleted file mode 100644
index 6696768..0000000
--- a/meta-arm/recipes-bsp/uefi/edk2-firmware.inc
+++ /dev/null
@@ -1,84 +0,0 @@ 
-SUMMARY = "UEFI EDK2 Firmware"
-
-PROVIDES += "virtual/uefi-firmware"
-
-EDK2_BUILD_RELEASE   ?= "0"
-EDK2_PLATFORM        ?= "invalid"
-EDK2_PLATFORM_DSC    ?= ""
-EDK2_BIN_NAME        ?= ""
-EDK2_ARCH            ?= ""
-
-EDK2_BUILD_MODE = "${@bb.utils.contains('EDK2_BUILD_RELEASE', '1', 'RELEASE', 'DEBUG', d)}"
-
-DEPENDS += "util-linux-native iasl-native"
-
-inherit python3native
-inherit deploy
-
-B = "${WORKDIR}/build"
-S = "${WORKDIR}/git"
-
-COMPATIBLE_MACHINE ?= "invalid"
-
-LDFLAGS[unexport] = "1"
-
-# No configure
-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 PYTHON_COMMAND      = "${PYTHON}"
-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])
-}
-
-do_compile() {
-    sed -i -e 's:-I \.\.:-I \.\. ${BUILD_CFLAGS} :' ${EDK_TOOLS_PATH}/Source/C/Makefiles/header.makefile
-    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
-
-    # Build basetools
-    oe_runmake -C ${S}/edk2/BaseTools
-
-    PATH="${WORKSPACE}:${BTOOLS_PATH}:$PATH" \
-    "${S}/edk2/BaseTools/BinWrappers/PosixLike/build" \
-       -a "${EDK2_ARCH}" \
-       -b ${EDK2_BUILD_MODE} \
-       -t ${GCC_VER} \
-       -p "${S}/edk2/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"
-}
-
-FILES_${PN} = "/firmware"
-SYSROOT_DIRS += "/firmware"
-# Skip QA check for relocations in .text of elf binaries
-INSANE_SKIP_${PN} = "textrel"
-
-do_deploy() {
-    # Copy the images to deploy directory
-    cp -rf ${D}/firmware/* ${DEPLOYDIR}/
-}
-addtask deploy after do_install
diff --git a/meta-arm/recipes-bsp/uefi/edk2-firmware_git.bb b/meta-arm/recipes-bsp/uefi/edk2-firmware_git.bb
index 4aadc3c..350af79 100644
--- a/meta-arm/recipes-bsp/uefi/edk2-firmware_git.bb
+++ b/meta-arm/recipes-bsp/uefi/edk2-firmware_git.bb
@@ -1,8 +1,11 @@ 
+SUMMARY = "UEFI EDK2 Firmware"
 DESCRIPTION = "UEFI EDK2 Firmware for Arm reference platforms"
 HOMEPAGE = "https://github.com/tianocore/edk2"
 
 LICENSE = "BSD-2-Clause-Patent"
 
+PROVIDES += "virtual/uefi-firmware"
+
 # EDK2
 LIC_FILES_CHKSUM = "file://edk2/License.txt;md5=2b415520383f7964e96700ae12b4570a"
 # EDK2 Platforms
@@ -16,4 +19,83 @@  SRCREV_edk2           ?= "6ff7c838d09224dd4e4c9b5b93152d8db1b19740"
 SRCREV_edk2-platforms ?= "ed4cc8059ec551032f0d8b8c172e9ec19214a638"
 SRCREV_FORMAT         = "edk2_edk2-platforms"
 
-require edk2-firmware.inc
+EDK2_BUILD_RELEASE   ?= "0"
+EDK2_PLATFORM        ?= "invalid"
+EDK2_PLATFORM_DSC    ?= ""
+EDK2_BIN_NAME        ?= ""
+EDK2_ARCH            ?= ""
+
+EDK2_BUILD_MODE = "${@bb.utils.contains('EDK2_BUILD_RELEASE', '1', 'RELEASE', 'DEBUG', d)}"
+
+DEPENDS += "util-linux-native iasl-native"
+
+inherit python3native
+inherit deploy
+
+B = "${WORKDIR}/build"
+S = "${WORKDIR}/git"
+
+COMPATIBLE_MACHINE ?= "invalid"
+
+LDFLAGS[unexport] = "1"
+
+# No configure
+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 PYTHON_COMMAND      = "${PYTHON}"
+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])
+}
+
+do_compile() {
+    sed -i -e 's:-I \.\.:-I \.\. ${BUILD_CFLAGS} :' ${EDK_TOOLS_PATH}/Source/C/Makefiles/header.makefile
+    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
+
+    # Build basetools
+    oe_runmake -C ${S}/edk2/BaseTools
+
+    PATH="${WORKSPACE}:${BTOOLS_PATH}:$PATH" \
+    "${S}/edk2/BaseTools/BinWrappers/PosixLike/build" \
+       -a "${EDK2_ARCH}" \
+       -b ${EDK2_BUILD_MODE} \
+       -t ${GCC_VER} \
+       -p "${S}/edk2/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"
+}
+
+FILES_${PN} = "/firmware"
+SYSROOT_DIRS += "/firmware"
+# Skip QA check for relocations in .text of elf binaries
+INSANE_SKIP_${PN} = "textrel"
+
+do_deploy() {
+    # Copy the images to deploy directory
+    cp -rf ${D}/firmware/* ${DEPLOYDIR}/
+}
+addtask deploy after do_install

Comments

Jon Mason July 14, 2020, 6:55 p.m.
On Mon, Jul 13, 2020 at 11:48:03AM +0100, Ross Burton wrote:
> From: Ross Burton <ross.burton@arm.com>
> 
> There is no reason to split this recipe between two files, so merge them.
> 
> Change-Id: I130cfb0ef78baa3117d5683d4732bc9b86798869
> Signed-off-by: Ross Burton <ross.burton@arm.com>

Both patches pulled into master.

Thanks,
Jon

> ---
>  meta-arm/recipes-bsp/uefi/edk2-firmware.inc   | 84 -------------------
>  .../recipes-bsp/uefi/edk2-firmware_git.bb     | 84 ++++++++++++++++++-
>  2 files changed, 83 insertions(+), 85 deletions(-)
>  delete mode 100644 meta-arm/recipes-bsp/uefi/edk2-firmware.inc
> 
> diff --git a/meta-arm/recipes-bsp/uefi/edk2-firmware.inc b/meta-arm/recipes-bsp/uefi/edk2-firmware.inc
> deleted file mode 100644
> index 6696768..0000000
> --- a/meta-arm/recipes-bsp/uefi/edk2-firmware.inc
> +++ /dev/null
> @@ -1,84 +0,0 @@
> -SUMMARY = "UEFI EDK2 Firmware"
> -
> -PROVIDES += "virtual/uefi-firmware"
> -
> -EDK2_BUILD_RELEASE   ?= "0"
> -EDK2_PLATFORM        ?= "invalid"
> -EDK2_PLATFORM_DSC    ?= ""
> -EDK2_BIN_NAME        ?= ""
> -EDK2_ARCH            ?= ""
> -
> -EDK2_BUILD_MODE = "${@bb.utils.contains('EDK2_BUILD_RELEASE', '1', 'RELEASE', 'DEBUG', d)}"
> -
> -DEPENDS += "util-linux-native iasl-native"
> -
> -inherit python3native
> -inherit deploy
> -
> -B = "${WORKDIR}/build"
> -S = "${WORKDIR}/git"
> -
> -COMPATIBLE_MACHINE ?= "invalid"
> -
> -LDFLAGS[unexport] = "1"
> -
> -# No configure
> -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 PYTHON_COMMAND      = "${PYTHON}"
> -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])
> -}
> -
> -do_compile() {
> -    sed -i -e 's:-I \.\.:-I \.\. ${BUILD_CFLAGS} :' ${EDK_TOOLS_PATH}/Source/C/Makefiles/header.makefile
> -    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
> -
> -    # Build basetools
> -    oe_runmake -C ${S}/edk2/BaseTools
> -
> -    PATH="${WORKSPACE}:${BTOOLS_PATH}:$PATH" \
> -    "${S}/edk2/BaseTools/BinWrappers/PosixLike/build" \
> -       -a "${EDK2_ARCH}" \
> -       -b ${EDK2_BUILD_MODE} \
> -       -t ${GCC_VER} \
> -       -p "${S}/edk2/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"
> -}
> -
> -FILES_${PN} = "/firmware"
> -SYSROOT_DIRS += "/firmware"
> -# Skip QA check for relocations in .text of elf binaries
> -INSANE_SKIP_${PN} = "textrel"
> -
> -do_deploy() {
> -    # Copy the images to deploy directory
> -    cp -rf ${D}/firmware/* ${DEPLOYDIR}/
> -}
> -addtask deploy after do_install
> diff --git a/meta-arm/recipes-bsp/uefi/edk2-firmware_git.bb b/meta-arm/recipes-bsp/uefi/edk2-firmware_git.bb
> index 4aadc3c..350af79 100644
> --- a/meta-arm/recipes-bsp/uefi/edk2-firmware_git.bb
> +++ b/meta-arm/recipes-bsp/uefi/edk2-firmware_git.bb
> @@ -1,8 +1,11 @@
> +SUMMARY = "UEFI EDK2 Firmware"
>  DESCRIPTION = "UEFI EDK2 Firmware for Arm reference platforms"
>  HOMEPAGE = "https://github.com/tianocore/edk2"
>  
>  LICENSE = "BSD-2-Clause-Patent"
>  
> +PROVIDES += "virtual/uefi-firmware"
> +
>  # EDK2
>  LIC_FILES_CHKSUM = "file://edk2/License.txt;md5=2b415520383f7964e96700ae12b4570a"
>  # EDK2 Platforms
> @@ -16,4 +19,83 @@ SRCREV_edk2           ?= "6ff7c838d09224dd4e4c9b5b93152d8db1b19740"
>  SRCREV_edk2-platforms ?= "ed4cc8059ec551032f0d8b8c172e9ec19214a638"
>  SRCREV_FORMAT         = "edk2_edk2-platforms"
>  
> -require edk2-firmware.inc
> +EDK2_BUILD_RELEASE   ?= "0"
> +EDK2_PLATFORM        ?= "invalid"
> +EDK2_PLATFORM_DSC    ?= ""
> +EDK2_BIN_NAME        ?= ""
> +EDK2_ARCH            ?= ""
> +
> +EDK2_BUILD_MODE = "${@bb.utils.contains('EDK2_BUILD_RELEASE', '1', 'RELEASE', 'DEBUG', d)}"
> +
> +DEPENDS += "util-linux-native iasl-native"
> +
> +inherit python3native
> +inherit deploy
> +
> +B = "${WORKDIR}/build"
> +S = "${WORKDIR}/git"
> +
> +COMPATIBLE_MACHINE ?= "invalid"
> +
> +LDFLAGS[unexport] = "1"
> +
> +# No configure
> +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 PYTHON_COMMAND      = "${PYTHON}"
> +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])
> +}
> +
> +do_compile() {
> +    sed -i -e 's:-I \.\.:-I \.\. ${BUILD_CFLAGS} :' ${EDK_TOOLS_PATH}/Source/C/Makefiles/header.makefile
> +    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
> +
> +    # Build basetools
> +    oe_runmake -C ${S}/edk2/BaseTools
> +
> +    PATH="${WORKSPACE}:${BTOOLS_PATH}:$PATH" \
> +    "${S}/edk2/BaseTools/BinWrappers/PosixLike/build" \
> +       -a "${EDK2_ARCH}" \
> +       -b ${EDK2_BUILD_MODE} \
> +       -t ${GCC_VER} \
> +       -p "${S}/edk2/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"
> +}
> +
> +FILES_${PN} = "/firmware"
> +SYSROOT_DIRS += "/firmware"
> +# Skip QA check for relocations in .text of elf binaries
> +INSANE_SKIP_${PN} = "textrel"
> +
> +do_deploy() {
> +    # Copy the images to deploy directory
> +    cp -rf ${D}/firmware/* ${DEPLOYDIR}/
> +}
> +addtask deploy after do_install
> -- 
> 2.26.2
> 

>
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#851): https://lists.yoctoproject.org/g/meta-arm/message/851
Mute This Topic: https://lists.yoctoproject.org/mt/75474272/3617530
Group Owner: meta-arm+owner@lists.yoctoproject.org
Unsubscribe: https://lists.yoctoproject.org/g/meta-arm/unsub  [oe-patchwork@oe-patch.openembedded.org]
-=-=-=-=-=-=-=-=-=-=-=-