From 358961f2b188f8fb33b1bd3cd0206a1d1708c2cd Mon Sep 17 00:00:00 2001 From: Alex Gonzalez Date: Tue, 31 Jan 2017 17:36:53 +0100 Subject: [PATCH 1/6] sdk: mkproject: Remove variant support from usage This feature is deprecated and will be permanently removed in future. Signed-off-by: Alex Gonzalez --- sdk/mkproject.sh | 5 ----- 1 file changed, 5 deletions(-) diff --git a/sdk/mkproject.sh b/sdk/mkproject.sh index 946dad902..beecfed5a 100755 --- a/sdk/mkproject.sh +++ b/sdk/mkproject.sh @@ -48,14 +48,9 @@ Usage: source ${MKP_SCRIPTNAME} [OPTIONS] -l list supported platforms -p select platform for the project - -v select platform variant Supported platforms: $(display_supported_platforms) -See platform include files for supported variant names: - -${MKP_SCRIPTPATH}/sources/meta-digi/meta-digi-arm/conf/machine/include/.inc - EOF } From d0f727afebd42f7ddb90248d9e07aee30cbd103f Mon Sep 17 00:00:00 2001 From: Alex Gonzalez Date: Tue, 31 Jan 2017 12:52:16 +0100 Subject: [PATCH 2/6] sdk: mkproject: Generalize to use from custom layer. Signed-off-by: Alex Gonzalez --- sdk/mkproject.sh | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/sdk/mkproject.sh b/sdk/mkproject.sh index beecfed5a..aff70c3ad 100755 --- a/sdk/mkproject.sh +++ b/sdk/mkproject.sh @@ -48,6 +48,7 @@ Usage: source ${MKP_SCRIPTNAME} [OPTIONS] -l list supported platforms -p select platform for the project + -m Layer with the supported platforms (defaults to meta-digi) Supported platforms: $(display_supported_platforms) @@ -148,28 +149,31 @@ if ! cmp -s ${MKP_SCRIPTPATH}/${MKP_SCRIPTNAME} ${MKP_SCRIPTPATH}/sources/meta-d return fi -## Get available platforms -MKP_AVAILABLE_PLATFORMS="$(echo $(ls -1 ${MKP_CONFIGPATH}/*/local.conf.sample | sed -e 's,^.*config/\([^/]\+\)/local\.conf\.sample,\1,g'))" - # Verify if this is a new project (so we do NOT customize it) [ -r "${MKP_PROJECTPATH}/conf/bblayers.conf" -a -r "${MKP_PROJECTPATH}/conf/local.conf" ] && MKP_OLD_PROJECT="1" # The script needs to be sourced (not executed) so make sure to # initialize OPTIND variable for getopts. OPTIND=1 -while getopts "lp:v:" c; do +while getopts "lp:v:m:" c; do case "${c}" in l) MKP_LIST_PLATFORMS="y";; p) MKP_PLATFORM="${OPTARG}";; v) MKP_VARIANT="${OPTARG}";; + m) MKP_CONFIGPATH="${MKP_SCRIPTPATH}/sources/${OPTARG}/sdk/config";; esac done +## Get available platforms +MKP_AVAILABLE_PLATFORMS="$(echo $(ls -1 ${MKP_CONFIGPATH}/*/local.conf.sample | sed -e 's,^.*config/\([^/]\+\)/local\.conf\.sample,\1,g'))" + ## Sanity checks if [ "${BASH_SOURCE}" = "${0}" ]; then error "This script needs to be sourced" elif [ ${#} -eq 0 ] ; then usage +elif [ ! -d "${MKP_CONFIGPATH}" ]; then + error "selected platform configuration directory \"${MKP_CONFIGPATH}\" does not exist" elif [ -n "${MKP_LIST_PLATFORMS}" ]; then display_supported_platforms elif [ -z "${MKP_PLATFORM}" ]; then From 26187f47c66085b7fb2a811a36529f6032c365cd Mon Sep 17 00:00:00 2001 From: Alex Gonzalez Date: Tue, 31 Jan 2017 12:35:34 +0100 Subject: [PATCH 3/6] meta-digi-arm: Add weak assignment for Linux and U-Boot This will allow to override the variable easily. Signed-off-by: Alex Gonzalez --- meta-digi-arm/recipes-bsp/u-boot/u-boot-dey-rev_2013.01.inc | 2 +- meta-digi-arm/recipes-bsp/u-boot/u-boot-dey_2015.04.bb | 2 +- .../recipes-digi/trustfence/trustfence-sign-tools_1.0.bb | 2 +- meta-digi-arm/recipes-kernel/linux/linux-dey.inc | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey-rev_2013.01.inc b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey-rev_2013.01.inc index 709bbd97a..03d459756 100644 --- a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey-rev_2013.01.inc +++ b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey-rev_2013.01.inc @@ -4,7 +4,7 @@ SRCBRANCH = "v2013.01/dub-2.0/maint" SRCREV = "${AUTOREV}" # Select internal or Github U-Boot repo -UBOOT_GIT_URI = "${@base_conditional('DIGI_INTERNAL_GIT', '1' , '${DIGI_GIT}u-boot-denx.git', '${DIGI_GITHUB_GIT}/u-boot.git', d)}" +UBOOT_GIT_URI ?= "${@base_conditional('DIGI_INTERNAL_GIT', '1' , '${DIGI_GIT}u-boot-denx.git', '${DIGI_GITHUB_GIT}/u-boot.git', d)}" SRC_URI = "${UBOOT_GIT_URI};branch=${SRCBRANCH}" diff --git a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey_2015.04.bb b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey_2015.04.bb index e54eac91c..f5fd1534f 100644 --- a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey_2015.04.bb +++ b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey_2015.04.bb @@ -15,7 +15,7 @@ SRCBRANCH = "v2015.04/master" SRCREV = "${AUTOREV}" # Select internal or Github U-Boot repo -UBOOT_GIT_URI = "${@base_conditional('DIGI_INTERNAL_GIT', '1' , '${DIGI_GIT}u-boot-denx.git', '${DIGI_GITHUB_GIT}/u-boot.git', d)}" +UBOOT_GIT_URI ?= "${@base_conditional('DIGI_INTERNAL_GIT', '1' , '${DIGI_GIT}u-boot-denx.git', '${DIGI_GITHUB_GIT}/u-boot.git', d)}" SRC_URI = " \ ${UBOOT_GIT_URI};branch=${SRCBRANCH} \ diff --git a/meta-digi-arm/recipes-digi/trustfence/trustfence-sign-tools_1.0.bb b/meta-digi-arm/recipes-digi/trustfence/trustfence-sign-tools_1.0.bb index b528613a3..3b93c3537 100644 --- a/meta-digi-arm/recipes-digi/trustfence/trustfence-sign-tools_1.0.bb +++ b/meta-digi-arm/recipes-digi/trustfence/trustfence-sign-tools_1.0.bb @@ -8,7 +8,7 @@ SRCREV = "${AUTOREV}" S = "${WORKDIR}" # Select internal or Github U-Boot repo -UBOOT_GIT_URI = "${@base_conditional('DIGI_INTERNAL_GIT', '1' , '${DIGI_GIT}u-boot-denx.git', '${DIGI_GITHUB_GIT}/u-boot.git', d)}" +UBOOT_GIT_URI ?= "${@base_conditional('DIGI_INTERNAL_GIT', '1' , '${DIGI_GIT}u-boot-denx.git', '${DIGI_GITHUB_GIT}/u-boot.git', d)}" SRC_URI = " \ ${UBOOT_GIT_URI};branch=${SRCBRANCH} \ diff --git a/meta-digi-arm/recipes-kernel/linux/linux-dey.inc b/meta-digi-arm/recipes-kernel/linux/linux-dey.inc index 45990474e..04584d422 100644 --- a/meta-digi-arm/recipes-kernel/linux/linux-dey.inc +++ b/meta-digi-arm/recipes-kernel/linux/linux-dey.inc @@ -13,7 +13,7 @@ inherit kernel fsl-kernel-localversion LOCALVERSION = "-dey" # Select internal or Github Linux repo -LINUX_GIT_URI = "${@base_conditional('DIGI_INTERNAL_GIT', '1' , '${DIGI_GIT}linux-2.6.git', '${DIGI_GITHUB_GIT}/linux.git', d)}" +LINUX_GIT_URI ?= "${@base_conditional('DIGI_INTERNAL_GIT', '1' , '${DIGI_GIT}linux-2.6.git', '${DIGI_GITHUB_GIT}/linux.git', d)}" SRC_URI = " \ ${LINUX_GIT_URI};branch=${SRCBRANCH} \ From 9a1e8d2d41d9a2e6721713d7155004cc9e7ae1a1 Mon Sep 17 00:00:00 2001 From: Alex Gonzalez Date: Wed, 1 Feb 2017 11:34:33 +0100 Subject: [PATCH 4/6] sdk: build: Add custom layer machine support Signed-off-by: Alex Gonzalez --- sdk/build.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sdk/build.sh b/sdk/build.sh index a39856427..875522cc5 100755 --- a/sdk/build.sh +++ b/sdk/build.sh @@ -144,6 +144,10 @@ if [ -z "${DY_MFG_IMAGE}" ] && echo ${JOB_NAME} | grep -qs 'dey.*mfg'; then DY_MFG_IMAGE="true" fi +if [ -n "${DY_MACHINES_LAYER}" ]; then + MACHINES_LAYER="-m ${DY_MACHINES_LAYER}" +fi + # Per-platform data while read _pl _var _tgt; do # DY_BUILD_VARIANTS comes from Jenkins environment: @@ -221,7 +225,7 @@ for platform in ${DY_PLATFORMS}; do # mixing environments between different platform's projects ( export TEMPLATECONF="${TEMPLATECONF:+${TEMPLATECONF}/${platform}}" - MKP_PAGER="" . ${YOCTO_INST_DIR}/mkproject.sh -p ${platform} ${_this_var_arg} <<< "y" + MKP_PAGER="" . ${YOCTO_INST_DIR}/mkproject.sh -p ${platform} ${MACHINES_LAYER} ${_this_var_arg} <<< "y" # Set a common DL_DIR and SSTATE_DIR for all platforms sed -i -e "/^#DL_DIR ?=/cDL_DIR ?= \"${YOCTO_PROJ_DIR}/downloads\"" \ -e "/^#SSTATE_DIR ?=/cSSTATE_DIR ?= \"${YOCTO_PROJ_DIR}/sstate-cache\"" \ From e0bc435685c3d837d7d4ca7185bfd370f2511650 Mon Sep 17 00:00:00 2001 From: Alex Gonzalez Date: Wed, 1 Feb 2017 11:35:21 +0100 Subject: [PATCH 5/6] sdk: build: Add ccimx6ulsom platform. This is the manufacturing test harness used for the CC6UL module manufacturing test process. Signed-off-by: Alex Gonzalez --- sdk/build.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/sdk/build.sh b/sdk/build.sh index 875522cc5..178f8b78a 100755 --- a/sdk/build.sh +++ b/sdk/build.sh @@ -169,6 +169,7 @@ done<<-_EOF_ ccimx6sbc DONTBUILDVARIANTS dey-image-qt ccimx6ulsbc DONTBUILDVARIANTS dey-image-qt ccimx6ulstarter DONTBUILDVARIANTS core-image-base + ccimx6ulsom DONTBUILDVARIANTS dey-image-mft-module-min _EOF_ YOCTO_IMGS_DIR="${WORKSPACE}/images" From 6a431c5363411dd4dbcfba8134dfed090fdd1713 Mon Sep 17 00:00:00 2001 From: "Diaz de Grenu, Jose" Date: Wed, 1 Feb 2017 13:51:22 +0100 Subject: [PATCH 6/6] meta-digi-arm: fix encrypted env support when using ubootenv The caam encryption check was only done from fw_env_write and fw_env_read functions, which are not called when using the functions exported as a library. Move the check_caam_encryption() call to fw_env_open(), which is called from all code paths. A similar check for AES encryption cannot be moved because it requires the AES key as an argument. https://jira.digi.com/browse/DEL-3616 Signed-off-by: Diaz de Grenu, Jose --- ...ent-support-for-environment-encrypti.patch | 35 +++++++------------ 1 file changed, 13 insertions(+), 22 deletions(-) diff --git a/meta-digi-arm/recipes-bsp/u-boot/u-boot-fw-utils/0001-tools-env-implement-support-for-environment-encrypti.patch b/meta-digi-arm/recipes-bsp/u-boot/u-boot-fw-utils/0001-tools-env-implement-support-for-environment-encrypti.patch index 922ca71d6..75d3e1360 100644 --- a/meta-digi-arm/recipes-bsp/u-boot/u-boot-fw-utils/0001-tools-env-implement-support-for-environment-encrypti.patch +++ b/meta-digi-arm/recipes-bsp/u-boot/u-boot-fw-utils/0001-tools-env-implement-support-for-environment-encrypti.patch @@ -1,7 +1,7 @@ From: "Diaz de Grenu, Jose" Date: Tue, 23 Aug 2016 13:05:05 +0200 -Subject: [PATCH] tools: env: implement support for environment encryption by - CAAM +Subject: [PATCH] tools: env: implement support for environment encryption + by CAAM https://jira.digi.com/browse/DEL-2836 @@ -10,8 +10,8 @@ Signed-off-by: Diaz de Grenu, Jose configs/sandbox_defconfig | 1 + tools/env/Makefile | 2 +- tools/env/caam_keyblob.h | 45 +++++++++++++++ - tools/env/fw_env.c | 140 ++++++++++++++++++++++++++++++++++++++++++++++ - 4 files changed, 187 insertions(+), 1 deletion(-) + tools/env/fw_env.c | 138 ++++++++++++++++++++++++++++++++++++++++++++++ + 4 files changed, 185 insertions(+), 1 deletion(-) create mode 100644 tools/env/caam_keyblob.h diff --git a/configs/sandbox_defconfig b/configs/sandbox_defconfig @@ -89,7 +89,7 @@ index 000000000000..1e33b3f01a05 +#endif /* CAAM_KEYBLOB_H */ \ No newline at end of file diff --git a/tools/env/fw_env.c b/tools/env/fw_env.c -index daa02a760e37..09f06c874b17 100644 +index daa02a760e37..806c2fb6d550 100644 --- a/tools/env/fw_env.c +++ b/tools/env/fw_env.c @@ -21,6 +21,7 @@ @@ -233,16 +233,7 @@ index daa02a760e37..09f06c874b17 100644 /* * Print the current definition of one, or more, or all * environment variables -@@ -259,6 +368,8 @@ int fw_printenv (int argc, char *argv[]) - argc -= 2; - } - -+ check_caam_encryption(); -+ - if (fw_env_open()) - return -1; - -@@ -334,6 +445,15 @@ int fw_env_close(void) +@@ -334,6 +443,15 @@ int fw_env_close(void) } } @@ -258,16 +249,16 @@ index daa02a760e37..09f06c874b17 100644 /* * Update CRC */ -@@ -504,6 +624,8 @@ int fw_setenv(int argc, char *argv[]) - argc -= 2; - } +@@ -1191,6 +1309,8 @@ int fw_env_open(void) + struct env_image_single *single; + struct env_image_redundant *redundant; + check_caam_encryption(); + - if (argc < 2) { - errno = EINVAL; + if (parse_config ()) /* should fill envdevices */ return -1; -@@ -1229,6 +1351,15 @@ int fw_env_open(void) + +@@ -1229,6 +1349,15 @@ int fw_env_open(void) return ret; } @@ -283,7 +274,7 @@ index daa02a760e37..09f06c874b17 100644 crc0_ok = (crc0 == *environment.crc); if (!HaveRedundEnv) { if (!crc0_ok) { -@@ -1286,6 +1417,15 @@ int fw_env_open(void) +@@ -1286,6 +1415,15 @@ int fw_env_open(void) return ret; }