From 45294e576cc0a9b48f80b7a2a90b070cdfc96292 Mon Sep 17 00:00:00 2001 From: Eugene Smirnov Date: Wed, 16 Oct 2019 12:52:01 +0200 Subject: Add NXP LS1043ARBD board class Signed-off-by: Eugene Smirnov --- classes/sota.bbclass | 1 + classes/sota_ls1043ardb.bbclass | 7 +++++++ 2 files changed, 8 insertions(+) create mode 100644 classes/sota_ls1043ardb.bbclass diff --git a/classes/sota.bbclass b/classes/sota.bbclass index 71bd303..2aab0b2 100644 --- a/classes/sota.bbclass +++ b/classes/sota.bbclass @@ -47,6 +47,7 @@ SOTA_MACHINE_intel-corei7-64 ?= "minnowboard" SOTA_MACHINE_qemux86-64 ?= "qemux86-64" SOTA_MACHINE_am335x-evm ?= "am335x-evm-wifi" SOTA_MACHINE_freedom-u540 ?= "freedom-u540" +SOTA_MACHINE_ls1043ardb ?= "ls1043ardb" SOTA_OVERRIDES_BLACKLIST = "ostree ota" SOTA_REQUIRED_VARIABLES = "OSTREE_REPO OSTREE_BRANCHNAME OSTREE_OSNAME OSTREE_BOOTLOADER OSTREE_BOOT_PARTITION GARAGE_SIGN_REPO GARAGE_TARGET_NAME" diff --git a/classes/sota_ls1043ardb.bbclass b/classes/sota_ls1043ardb.bbclass new file mode 100644 index 0000000..825c777 --- /dev/null +++ b/classes/sota_ls1043ardb.bbclass @@ -0,0 +1,7 @@ +KERNEL_IMAGETYPES = "fitImage" + +OSTREE_KERNEL = "fitImage-${INITRAMFS_IMAGE}-${MACHINE}-${MACHINE}" +OSTREE_KERNEL_ARGS = "console=ttyS0,115200 ramdisk_size=8192 root=/dev/ram0 rw rootfstype=ext4 ostree_root=/dev/mmcblk0p2" + +WKS_FILE_sota = "ls1043ardb-ota.wks" +IMAGE_BOOT_FILES = "ls1043ardb_boot.scr" -- cgit v1.2.3-54-g00ecf From df3d58ab8e6d54f5ae945869efbf4d2cbfdb9612 Mon Sep 17 00:00:00 2001 From: Eugene Smirnov Date: Wed, 23 Oct 2019 13:42:41 +0200 Subject: Support wic file creation for LS1043ARBD board Current rawcopy function doesn't support files that are located in subdirectories of DEPLOYDIR. Add a new rawcopy2 function to handle that. Shouldn't be necessary once upstream patch is available: https://git.yoctoproject.org/cgit.cgi/poky/commit/scripts/lib/wic/plugins/source/rawcopy.py?h=zeus&id=6fb5afb65de3a2f94d705e93ebdbc1f46299e885 Signed-off-by: Eugene Smirnov --- scripts/lib/wic/canned-wks/ls1043ardb-ota.wks | 14 ++++ scripts/lib/wic/plugins/source/rawcopy2.py | 93 +++++++++++++++++++++++++++ 2 files changed, 107 insertions(+) create mode 100644 scripts/lib/wic/canned-wks/ls1043ardb-ota.wks create mode 100644 scripts/lib/wic/plugins/source/rawcopy2.py diff --git a/scripts/lib/wic/canned-wks/ls1043ardb-ota.wks b/scripts/lib/wic/canned-wks/ls1043ardb-ota.wks new file mode 100644 index 0000000..aed6870 --- /dev/null +++ b/scripts/lib/wic/canned-wks/ls1043ardb-ota.wks @@ -0,0 +1,14 @@ +# short-description: Create SD card OTA image for NXP LS1043ARDB +# long-description: +# Create an OTA-enabled image that can be written onto a SD card using dd +# for use with NXP LS1043ARDB SoC. +# For data layout see Layerscape SDK User Guide, Chapter 4.2, tables 14 and 16. +# +part BL2 --source rawcopy2 --sourceparams="file=atf/bl2_sd.pbl" --ondisk mmcblk --no-table --align 4 +part BL3 --source rawcopy2 --sourceparams="file=atf/fip_uboot.bin" --ondisk mmcblk --no-table --align 1024 +part fman-ucode --source rawcopy2 --sourceparams="file=fsl_fman_ucode_ls1043_r1.1_108_4_9.bin" --ondisk mmcblk --no-table --align 9216 +part qe-ucode --source rawcopy2 --sourceparams="file=boot/fsl_qe_ucode_1021_10_A.bin" --ondisk mmcblk --no-table --align 9472 +part uboot-scr --source bootimg-partition --ondisk mmcblk --fstype=msdos --fixed-size=100M --align 65540 +part / --source otaimage --ondisk mmcblk --fstype=ext4 --label root --align 167940 + +bootloader --ptable msdos diff --git a/scripts/lib/wic/plugins/source/rawcopy2.py b/scripts/lib/wic/plugins/source/rawcopy2.py new file mode 100644 index 0000000..e2166d6 --- /dev/null +++ b/scripts/lib/wic/plugins/source/rawcopy2.py @@ -0,0 +1,93 @@ +# ex:ts=4:sw=4:sts=4:et +# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License version 2 as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# + +import logging +import os + +from wic import WicError +from wic.pluginbase import SourcePlugin +from wic.misc import exec_cmd, get_bitbake_var +from wic.filemap import sparse_copy + +logger = logging.getLogger('wic') + +class RawCopy2Plugin(SourcePlugin): + """ + Populate partition content from raw image file. + """ + + name = 'rawcopy2' + + @staticmethod + def do_image_label(fstype, dst, label): + if fstype.startswith('ext'): + cmd = 'tune2fs -L %s %s' % (label, dst) + elif fstype in ('msdos', 'vfat'): + cmd = 'dosfslabel %s %s' % (dst, label) + elif fstype == 'btrfs': + cmd = 'btrfs filesystem label %s %s' % (dst, label) + elif fstype == 'swap': + cmd = 'mkswap -L %s %s' % (label, dst) + elif fstype == 'squashfs': + raise WicError("It's not possible to update a squashfs " + "filesystem label '%s'" % (label)) + else: + raise WicError("Cannot update filesystem label: " + "Unknown fstype: '%s'" % (fstype)) + + exec_cmd(cmd) + + @classmethod + def do_prepare_partition(cls, part, source_params, cr, cr_workdir, + oe_builddir, bootimg_dir, kernel_dir, + rootfs_dir, native_sysroot): + """ + Called to do the actual content population for a partition i.e. it + 'prepares' the partition to be incorporated into the image. + """ + if not kernel_dir: + kernel_dir = get_bitbake_var("DEPLOY_DIR_IMAGE") + if not kernel_dir: + raise WicError("Couldn't find DEPLOY_DIR_IMAGE, exiting") + + logger.debug('Kernel dir: %s', kernel_dir) + + if 'file' not in source_params: + raise WicError("No file specified") + + src = os.path.join(kernel_dir, source_params['file']) + dst = os.path.join(cr_workdir, "%s.%s" % (source_params['file'], part.lineno)) + if not os.path.exists(os.path.dirname(dst)): + os.makedirs(os.path.dirname(dst)) + + if 'skip' in source_params: + sparse_copy(src, dst, skip=int(source_params['skip'])) + else: + sparse_copy(src, dst) + + # get the size in the right units for kickstart (kB) + du_cmd = "du -Lbks %s" % dst + out = exec_cmd(du_cmd) + filesize = int(out.split()[0]) + + if filesize > part.size: + part.size = filesize + + if part.label: + RawCopy2Plugin.do_image_label(part.fstype, dst, part.label) + + part.source_file = dst -- cgit v1.2.3-54-g00ecf From 5b75b280f9c1edf0c9c22dc82c0f37017e8bc42f Mon Sep 17 00:00:00 2001 From: Eugene Smirnov Date: Wed, 23 Oct 2019 16:34:49 +0200 Subject: Resolve multiple conflicts of NXP layers with usrmerge Signed-off-by: Eugene Smirnov --- conf/layer.conf | 11 ++++++ .../recipes-bsp/u-boot/u-boot-qoriq_%.bbappend | 13 ++++++++ .../recipes-dpaa2/dce/dce_%.bbappend | 4 +++ .../recipes-extended/dpdk/dpdk_%.bbappend | 39 ++++++++++++++++++++++ .../optee/optee-os-qoriq_%.bbappend | 24 +++++++++++++ .../optee/optee-test-qoriq_%.bbappend | 11 ++++++ .../recipes-extended/crconf/crconf_%.bbappend | 4 +++ .../cgroup-lite/cgroup-lite_%.bbappend | 12 +++++++ .../packagegroup-core-tools-profile.bbappend | 1 + 9 files changed, 119 insertions(+) create mode 100644 dynamic-layers/freescale-layer/recipes-bsp/u-boot/u-boot-qoriq_%.bbappend create mode 100644 dynamic-layers/freescale-layer/recipes-dpaa2/dce/dce_%.bbappend create mode 100644 dynamic-layers/freescale-layer/recipes-extended/dpdk/dpdk_%.bbappend create mode 100644 dynamic-layers/freescale-layer/recipes-security/optee/optee-os-qoriq_%.bbappend create mode 100644 dynamic-layers/freescale-layer/recipes-security/optee/optee-test-qoriq_%.bbappend create mode 100644 dynamic-layers/qoriq-demos/recipes-extended/crconf/crconf_%.bbappend create mode 100644 dynamic-layers/virtualization-layer/recipes-containers/cgroup-lite/cgroup-lite_%.bbappend create mode 100644 recipes-core/packagegroups/packagegroup-core-tools-profile.bbappend diff --git a/conf/layer.conf b/conf/layer.conf index 035a46b..44db931 100644 --- a/conf/layer.conf +++ b/conf/layer.conf @@ -21,3 +21,14 @@ SIGGEN_EXCLUDE_SAFE_RECIPE_DEPS += " \ aktualizr-shared-prov-creds->aktualizr \ aktualizr-uboot-env-rollback->aktualizr \ " + +BBFILES_DYNAMIC += " \ + virtualization-layer:${LAYERDIR}/dynamic-layers/virtualization-layer/*/*/*.bb \ + virtualization-layer:${LAYERDIR}/dynamic-layers/virtualization-layer/*/*/*.bbappend \ + \ + freescale-layer:${LAYERDIR}/dynamic-layers/freescale-layer/*/*/*.bb \ + freescale-layer:${LAYERDIR}/dynamic-layers/freescale-layer/*/*/*.bbappend \ + \ + qoriq-demos:${LAYERDIR}/dynamic-layers/qoriq-demos/*/*/*.bb \ + qoriq-demos:${LAYERDIR}/dynamic-layers/qoriq-demos/*/*/*.bbappend \ +" diff --git a/dynamic-layers/freescale-layer/recipes-bsp/u-boot/u-boot-qoriq_%.bbappend b/dynamic-layers/freescale-layer/recipes-bsp/u-boot/u-boot-qoriq_%.bbappend new file mode 100644 index 0000000..1b66418 --- /dev/null +++ b/dynamic-layers/freescale-layer/recipes-bsp/u-boot/u-boot-qoriq_%.bbappend @@ -0,0 +1,13 @@ +DEPENDS += "u-boot-mkimage-native" + +do_deploy_append_qoriq() { + + cat > ${DEPLOYDIR}/ls1043ardb_boot.txt << EOF +load mmc 0:2 \${load_addr} /boot/loader/uEnv.txt +env import -t \${fileaddr} \${filesize} +load mmc 0:2 \${load_addr} /boot\${kernel_image} +bootm \${load_addr} +EOF + + mkimage -A arm64 -O linux -T script -d ${DEPLOYDIR}/ls1043ardb_boot.txt ${DEPLOYDIR}/ls1043ardb_boot.scr +} diff --git a/dynamic-layers/freescale-layer/recipes-dpaa2/dce/dce_%.bbappend b/dynamic-layers/freescale-layer/recipes-dpaa2/dce/dce_%.bbappend new file mode 100644 index 0000000..85b55de --- /dev/null +++ b/dynamic-layers/freescale-layer/recipes-dpaa2/dce/dce_%.bbappend @@ -0,0 +1,4 @@ + +do_install () { + oe_runmake install DESTDIR=${D}${root_prefix} +} diff --git a/dynamic-layers/freescale-layer/recipes-extended/dpdk/dpdk_%.bbappend b/dynamic-layers/freescale-layer/recipes-extended/dpdk/dpdk_%.bbappend new file mode 100644 index 0000000..994c6b2 --- /dev/null +++ b/dynamic-layers/freescale-layer/recipes-extended/dpdk/dpdk_%.bbappend @@ -0,0 +1,39 @@ + +do_install() { + unset LDFLAGS TARGET_LDFLAGS BUILD_LDFLAGS + + oe_runmake EXTRA_LDFLAGS="-L${STAGING_LIBDIR} --hash-style=gnu" WERROR_FLAGS="-w" V=1 T="${RTE_TARGET}" DESTDIR="${D}" install CONFIG_RTE_EAL_IGB_UIO=n CONFIG_RTE_KNI_KMOD=y CONFIG_RTE_LIBRTE_PMD_OPENSSL=y + + # Build and install the DPDK examples + for APP in examples/l2fwd examples/l3fwd examples/l2fwd-qdma examples/l2fwd-crypto examples/ipsec-secgw examples/kni examples/ip_fragmentation examples/ip_reassembly; do + temp=`basename ${APP}` + if [ ${temp} = "ipsec-secgw" ] || [ ${temp} = "l2fwd-crypto" ]; then + oe_runmake EXTRA_LDFLAGS="-L${STAGING_LIBDIR} --hash-style=gnu" -C ${APP} CONFIG_RTE_LIBRTE_PMD_OPENSSL=y + else + oe_runmake EXTRA_LDFLAGS="-L${STAGING_LIBDIR} --hash-style=gnu" EXTRA_CFLAGS="--sysroot=${STAGING_DIR_HOST} -I${STAGING_INCDIR}" -C ${APP} + fi + + [ ! -d ${D}/${bindir}/dpdk-example ] && install -d 0644 ${D}/${bindir}/dpdk-example + install -m 0755 ${S}/examples/`basename ${APP}`/build/`basename ${APP}` \ + ${D}/${bindir}/dpdk-example/ + done + oe_runmake EXTRA_LDFLAGS="-L${STAGING_LIBDIR} --hash-style=gnu" -C examples/vhost + install -m 0755 ${S}/examples/vhost/build/vhost-switch ${D}/${bindir}/dpdk-example/ + oe_runmake EXTRA_LDFLAGS="-L${STAGING_LIBDIR} --hash-style=gnu" -C examples/cmdif + + install -d 0644 ${D}/usr/share/dpdk/cmdif/include + install -d 0644 ${D}/usr/share/dpdk/cmdif/lib + cp examples/cmdif/lib/client/fsl_cmdif_client.h examples/cmdif/lib/server/fsl_cmdif_server.h \ + examples/cmdif/lib/shbp/fsl_shbp.h ${D}/usr/share/dpdk/cmdif/include + cp examples/cmdif/lib/${RTE_TARGET}/librte_cmdif.a ${D}/usr/share/dpdk/cmdif/lib + + install -m 0755 ${S}/${RTE_TARGET}/app/testpmd ${D}/${bindir}/dpdk-example/ + rm -fr ${D}/lib + install -d ${D}${nonarch_base_libdir}/modules/${KERNEL_VERSION}/dpdk + install -m 0755 ${S}/${RTE_TARGET}/kmod/rte_kni.ko ${D}${nonarch_base_libdir}/modules/${KERNEL_VERSION}/dpdk + install -d ${D}/${bindir}/dpdk-example/extras + cp -rf ${S}/nxp/* ${D}/${bindir}/dpdk-example/extras/ + rm ${D}/${datadir}/${RTE_TARGET}/app/dpdk-pmdinfogen + + chown root:root -R ${D} +} diff --git a/dynamic-layers/freescale-layer/recipes-security/optee/optee-os-qoriq_%.bbappend b/dynamic-layers/freescale-layer/recipes-security/optee/optee-os-qoriq_%.bbappend new file mode 100644 index 0000000..20e6216 --- /dev/null +++ b/dynamic-layers/freescale-layer/recipes-security/optee/optee-os-qoriq_%.bbappend @@ -0,0 +1,24 @@ + +do_install() { + #install core on boot directory + install -d ${D}/${libdir}/firmware/ + if [ ${MACHINE} = ls1012afrwy ]; then + install -m 644 ${B}/out/arm-plat-ls/core/tee_512mb.bin ${D}/${libdir}/firmware/tee_${MACHINE}_512mb.bin + fi + install -m 644 ${B}/out/arm-plat-ls/core/tee.bin ${D}/${libdir}/firmware/tee_${MACHINE}.bin + #install TA devkit + install -d ${D}/usr/include/optee/export-user_ta/ + + for f in ${B}/out/arm-plat-ls/export-ta_${OPTEE_ARCH}/* ; do + cp -aR $f ${D}/usr/include/optee/export-user_ta/ + done +} + +do_deploy() { + install -d ${DEPLOYDIR}/optee + for f in ${D}/${libdir}/firmware/*; do + cp $f ${DEPLOYDIR}/optee/ + done +} + +FILES_${PN} = "${libdir}/firmware/" diff --git a/dynamic-layers/freescale-layer/recipes-security/optee/optee-test-qoriq_%.bbappend b/dynamic-layers/freescale-layer/recipes-security/optee/optee-test-qoriq_%.bbappend new file mode 100644 index 0000000..81f1905 --- /dev/null +++ b/dynamic-layers/freescale-layer/recipes-security/optee/optee-test-qoriq_%.bbappend @@ -0,0 +1,11 @@ + +do_install () { + install -D -p -m0755 ${S}/out/xtest/xtest ${D}${bindir}/xtest + + # install path should match the value set in optee-client/tee-supplicant + # default TEEC_LOAD_PATH is /lib + mkdir -p ${D}/${libdir}/optee_armtz/ + install -D -p -m0444 ${S}/out/ta/*/*.ta ${D}/${libdir}/optee_armtz/ +} + +FILES_${PN} += "${libdir}/optee_armtz/" diff --git a/dynamic-layers/qoriq-demos/recipes-extended/crconf/crconf_%.bbappend b/dynamic-layers/qoriq-demos/recipes-extended/crconf/crconf_%.bbappend new file mode 100644 index 0000000..911a20c --- /dev/null +++ b/dynamic-layers/qoriq-demos/recipes-extended/crconf/crconf_%.bbappend @@ -0,0 +1,4 @@ + +do_install () { + oe_runmake install DESTDIR=${D}${root_prefix} +} diff --git a/dynamic-layers/virtualization-layer/recipes-containers/cgroup-lite/cgroup-lite_%.bbappend b/dynamic-layers/virtualization-layer/recipes-containers/cgroup-lite/cgroup-lite_%.bbappend new file mode 100644 index 0000000..e6c843f --- /dev/null +++ b/dynamic-layers/virtualization-layer/recipes-containers/cgroup-lite/cgroup-lite_%.bbappend @@ -0,0 +1,12 @@ + +do_install() { + install -d ${D}/${bindir} + install -m 0755 ${S}/scripts/cgroups-mount ${D}/${bindir} + install -m 0755 ${S}/scripts/cgroups-umount ${D}/${bindir} + + install -d ${D}${sysconfdir}/init.d + install -m 0755 ${WORKDIR}/cgroups-init ${D}${sysconfdir}/init.d/cgroups-init + + install -d ${D}${systemd_unitdir}/system + ln -sf /dev/null ${D}${systemd_unitdir}/system/cgroups-init.service +} diff --git a/recipes-core/packagegroups/packagegroup-core-tools-profile.bbappend b/recipes-core/packagegroups/packagegroup-core-tools-profile.bbappend new file mode 100644 index 0000000..5f29e63 --- /dev/null +++ b/recipes-core/packagegroups/packagegroup-core-tools-profile.bbappend @@ -0,0 +1 @@ +SYSTEMTAP = "" -- cgit v1.2.3-54-g00ecf From 0d1e24871a0be3cf385fe192574782fd98782d28 Mon Sep 17 00:00:00 2001 From: Eugene Smirnov Date: Wed, 23 Oct 2019 16:35:21 +0200 Subject: Add OTA image types Signed-off-by: Eugene Smirnov --- .../qoriq-demos/recipes-fsl/images/fsl-image-networking-full.bbappend | 1 + 1 file changed, 1 insertion(+) create mode 100644 dynamic-layers/qoriq-demos/recipes-fsl/images/fsl-image-networking-full.bbappend diff --git a/dynamic-layers/qoriq-demos/recipes-fsl/images/fsl-image-networking-full.bbappend b/dynamic-layers/qoriq-demos/recipes-fsl/images/fsl-image-networking-full.bbappend new file mode 100644 index 0000000..92ff0ec --- /dev/null +++ b/dynamic-layers/qoriq-demos/recipes-fsl/images/fsl-image-networking-full.bbappend @@ -0,0 +1 @@ +IMAGE_FSTYPES_qoriq_append = " ostreepush garagesign garagecheck ota-ext4 ostree.tar.bz2 ota.tar.xz wic" -- cgit v1.2.3-54-g00ecf From ed4904004603ce5a53940f78aa9b68bc023fdbcf Mon Sep 17 00:00:00 2001 From: Eugene Smirnov Date: Fri, 25 Oct 2019 14:41:17 +0200 Subject: Resolve busybox and bc conflict For details see upstream patch: https://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/meta/recipes-extended/bc/bc_1.07.1.bb?h=warrior&id=3e6fa6f4a755c878a7a509f5c46aa1d83b9ee992 Signed-off-by: Eugene Smirnov --- recipes-extended/bc/bc_%.bbappend | 1 + 1 file changed, 1 insertion(+) create mode 100644 recipes-extended/bc/bc_%.bbappend diff --git a/recipes-extended/bc/bc_%.bbappend b/recipes-extended/bc/bc_%.bbappend new file mode 100644 index 0000000..3e80e88 --- /dev/null +++ b/recipes-extended/bc/bc_%.bbappend @@ -0,0 +1 @@ +ALTERNATIVE_${PN} += "bc" -- cgit v1.2.3-54-g00ecf