[meta-ti] [master/thud][PATCH 01/42] ti-pdk-fetch: add class for common pdk sources
Khem Raj
raj.khem at gmail.com
Fri Nov 15 09:14:15 PST 2019
On Fri, 2019-11-15 at 10:14 -0500, Jacob Stiffler wrote:
> Recently individual components and LLD sources have been combined
> into a single PDK repo. Use this class to specify the common source.
> Also use this class to keep the sources separate from each other when
> building. This keeps the build identical to previous recipes while
> keeping control on interdependencies.
>
> Signed-off-by: Jacob Stiffler <j-stiffler at ti.com>
> ---
> classes/ti-pdk-fetch.bbclass | 31 +++++++++++++++++++++++++++++++
> 1 file changed, 31 insertions(+)
> create mode 100644 classes/ti-pdk-fetch.bbclass
>
> diff --git a/classes/ti-pdk-fetch.bbclass b/classes/ti-pdk-
> fetch.bbclass
> new file mode 100644
> index 0000000..6e36e3b
> --- /dev/null
> +++ b/classes/ti-pdk-fetch.bbclass
> @@ -0,0 +1,31 @@
> +TI_PDK_GIT_URI ?= "git://git.ti.com/processor-sdk/pdk.git"
> +TI_PDK_GIT_BRANCH ?= "master"
> +TI_PDK_GIT_PROTOCOL ?= "git"
> +TI_PDK_SRCREV ?= "a609fa636c4d899e5dd3d7a89a1c070b854849b0"
> +
> +TI_PDK_VERSION ?= "2019.11.0+git${SRCPV}"
> +
> +TI_PDK_SRC = "_tmp_pdk"
> +SRC_URI =
> "${TI_PDK_GIT_URI};branch=${TI_PDK_GIT_BRANCH};protocol=${TI_PDK_GIT_
> PROTOCOL};destsuffix=${TI_PDK_SRC}"
> +SRCREV = "${TI_PDK_SRCREV}"
> +
> +PV = "${TI_PDK_VERSION}"
> +
> +TI_PDK_COMP ?= ""
> +TI_PDK_COMP_PATH = "${@'${TI_PDK_COMP}'.replace('.','/')}"
> +
> +S = "${WORKDIR}/git/${TI_PDK_COMP_PATH}"
> +
> +# Extract only required sources from PDK
> +python do_unpack_append() {
> + if len(d.getVar('TI_PDK_COMP') or '') > 0:
> + import subprocess
> +
> + src =
> os.path.join(d.getVar('TI_PDK_SRC'),'packages',d.getVar('TI_PDK_COMP_
> PATH'))
> +
> + # Package up only the required sources
> + cmd = 'tar -cf - -C %s -p -S . | tar -xf - -C %s' % (src,
> d.getVar('S'))
> + subprocess.check_output(cmd, shell=True,
> stderr=subprocess.STDOUT)
> +
> + bb.utils.remove(d.getVar('TI_PDK_SRC'), recurse=True)
> +}
perhaps looking in work-shared idea from kernel or gcc or clang
packages could make it better where, you only untar sources once
> --
> 2.7.4
>
More information about the meta-ti
mailing list