summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--classes/sota.bbclass1
-rw-r--r--classes/sota_ls1043ardb.bbclass7
-rw-r--r--conf/layer.conf11
-rw-r--r--dynamic-layers/freescale-layer/recipes-bsp/u-boot/u-boot-qoriq_%.bbappend13
-rw-r--r--dynamic-layers/freescale-layer/recipes-dpaa2/dce/dce_%.bbappend4
-rw-r--r--dynamic-layers/freescale-layer/recipes-extended/dpdk/dpdk_%.bbappend39
-rw-r--r--dynamic-layers/freescale-layer/recipes-security/optee/optee-os-qoriq_%.bbappend24
-rw-r--r--dynamic-layers/freescale-layer/recipes-security/optee/optee-test-qoriq_%.bbappend11
-rw-r--r--dynamic-layers/qoriq-demos/recipes-extended/crconf/crconf_%.bbappend4
-rw-r--r--dynamic-layers/qoriq-demos/recipes-fsl/images/fsl-image-networking-full.bbappend1
-rw-r--r--dynamic-layers/virtualization-layer/recipes-containers/cgroup-lite/cgroup-lite_%.bbappend12
-rw-r--r--recipes-core/packagegroups/packagegroup-core-tools-profile.bbappend1
-rw-r--r--recipes-extended/bc/bc_%.bbappend1
-rw-r--r--scripts/lib/wic/canned-wks/ls1043ardb-ota.wks14
-rw-r--r--scripts/lib/wic/plugins/source/rawcopy2.py93
15 files changed, 236 insertions, 0 deletions
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"
47SOTA_MACHINE_qemux86-64 ?= "qemux86-64" 47SOTA_MACHINE_qemux86-64 ?= "qemux86-64"
48SOTA_MACHINE_am335x-evm ?= "am335x-evm-wifi" 48SOTA_MACHINE_am335x-evm ?= "am335x-evm-wifi"
49SOTA_MACHINE_freedom-u540 ?= "freedom-u540" 49SOTA_MACHINE_freedom-u540 ?= "freedom-u540"
50SOTA_MACHINE_ls1043ardb ?= "ls1043ardb"
50 51
51SOTA_OVERRIDES_BLACKLIST = "ostree ota" 52SOTA_OVERRIDES_BLACKLIST = "ostree ota"
52SOTA_REQUIRED_VARIABLES = "OSTREE_REPO OSTREE_BRANCHNAME OSTREE_OSNAME OSTREE_BOOTLOADER OSTREE_BOOT_PARTITION GARAGE_SIGN_REPO GARAGE_TARGET_NAME" 53SOTA_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 @@
1KERNEL_IMAGETYPES = "fitImage"
2
3OSTREE_KERNEL = "fitImage-${INITRAMFS_IMAGE}-${MACHINE}-${MACHINE}"
4OSTREE_KERNEL_ARGS = "console=ttyS0,115200 ramdisk_size=8192 root=/dev/ram0 rw rootfstype=ext4 ostree_root=/dev/mmcblk0p2"
5
6WKS_FILE_sota = "ls1043ardb-ota.wks"
7IMAGE_BOOT_FILES = "ls1043ardb_boot.scr"
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 += " \
21 aktualizr-shared-prov-creds->aktualizr \ 21 aktualizr-shared-prov-creds->aktualizr \
22 aktualizr-uboot-env-rollback->aktualizr \ 22 aktualizr-uboot-env-rollback->aktualizr \
23" 23"
24
25BBFILES_DYNAMIC += " \
26 virtualization-layer:${LAYERDIR}/dynamic-layers/virtualization-layer/*/*/*.bb \
27 virtualization-layer:${LAYERDIR}/dynamic-layers/virtualization-layer/*/*/*.bbappend \
28 \
29 freescale-layer:${LAYERDIR}/dynamic-layers/freescale-layer/*/*/*.bb \
30 freescale-layer:${LAYERDIR}/dynamic-layers/freescale-layer/*/*/*.bbappend \
31 \
32 qoriq-demos:${LAYERDIR}/dynamic-layers/qoriq-demos/*/*/*.bb \
33 qoriq-demos:${LAYERDIR}/dynamic-layers/qoriq-demos/*/*/*.bbappend \
34"
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 @@
1DEPENDS += "u-boot-mkimage-native"
2
3do_deploy_append_qoriq() {
4
5 cat > ${DEPLOYDIR}/ls1043ardb_boot.txt << EOF
6load mmc 0:2 \${load_addr} /boot/loader/uEnv.txt
7env import -t \${fileaddr} \${filesize}
8load mmc 0:2 \${load_addr} /boot\${kernel_image}
9bootm \${load_addr}
10EOF
11
12 mkimage -A arm64 -O linux -T script -d ${DEPLOYDIR}/ls1043ardb_boot.txt ${DEPLOYDIR}/ls1043ardb_boot.scr
13}
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 @@
1
2do_install () {
3 oe_runmake install DESTDIR=${D}${root_prefix}
4}
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 @@
1
2do_install() {
3 unset LDFLAGS TARGET_LDFLAGS BUILD_LDFLAGS
4
5 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
6
7 # Build and install the DPDK examples
8 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
9 temp=`basename ${APP}`
10 if [ ${temp} = "ipsec-secgw" ] || [ ${temp} = "l2fwd-crypto" ]; then
11 oe_runmake EXTRA_LDFLAGS="-L${STAGING_LIBDIR} --hash-style=gnu" -C ${APP} CONFIG_RTE_LIBRTE_PMD_OPENSSL=y
12 else
13 oe_runmake EXTRA_LDFLAGS="-L${STAGING_LIBDIR} --hash-style=gnu" EXTRA_CFLAGS="--sysroot=${STAGING_DIR_HOST} -I${STAGING_INCDIR}" -C ${APP}
14 fi
15
16 [ ! -d ${D}/${bindir}/dpdk-example ] && install -d 0644 ${D}/${bindir}/dpdk-example
17 install -m 0755 ${S}/examples/`basename ${APP}`/build/`basename ${APP}` \
18 ${D}/${bindir}/dpdk-example/
19 done
20 oe_runmake EXTRA_LDFLAGS="-L${STAGING_LIBDIR} --hash-style=gnu" -C examples/vhost
21 install -m 0755 ${S}/examples/vhost/build/vhost-switch ${D}/${bindir}/dpdk-example/
22 oe_runmake EXTRA_LDFLAGS="-L${STAGING_LIBDIR} --hash-style=gnu" -C examples/cmdif
23
24 install -d 0644 ${D}/usr/share/dpdk/cmdif/include
25 install -d 0644 ${D}/usr/share/dpdk/cmdif/lib
26 cp examples/cmdif/lib/client/fsl_cmdif_client.h examples/cmdif/lib/server/fsl_cmdif_server.h \
27 examples/cmdif/lib/shbp/fsl_shbp.h ${D}/usr/share/dpdk/cmdif/include
28 cp examples/cmdif/lib/${RTE_TARGET}/librte_cmdif.a ${D}/usr/share/dpdk/cmdif/lib
29
30 install -m 0755 ${S}/${RTE_TARGET}/app/testpmd ${D}/${bindir}/dpdk-example/
31 rm -fr ${D}/lib
32 install -d ${D}${nonarch_base_libdir}/modules/${KERNEL_VERSION}/dpdk
33 install -m 0755 ${S}/${RTE_TARGET}/kmod/rte_kni.ko ${D}${nonarch_base_libdir}/modules/${KERNEL_VERSION}/dpdk
34 install -d ${D}/${bindir}/dpdk-example/extras
35 cp -rf ${S}/nxp/* ${D}/${bindir}/dpdk-example/extras/
36 rm ${D}/${datadir}/${RTE_TARGET}/app/dpdk-pmdinfogen
37
38 chown root:root -R ${D}
39}
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 @@
1
2do_install() {
3 #install core on boot directory
4 install -d ${D}/${libdir}/firmware/
5 if [ ${MACHINE} = ls1012afrwy ]; then
6 install -m 644 ${B}/out/arm-plat-ls/core/tee_512mb.bin ${D}/${libdir}/firmware/tee_${MACHINE}_512mb.bin
7 fi
8 install -m 644 ${B}/out/arm-plat-ls/core/tee.bin ${D}/${libdir}/firmware/tee_${MACHINE}.bin
9 #install TA devkit
10 install -d ${D}/usr/include/optee/export-user_ta/
11
12 for f in ${B}/out/arm-plat-ls/export-ta_${OPTEE_ARCH}/* ; do
13 cp -aR $f ${D}/usr/include/optee/export-user_ta/
14 done
15}
16
17do_deploy() {
18 install -d ${DEPLOYDIR}/optee
19 for f in ${D}/${libdir}/firmware/*; do
20 cp $f ${DEPLOYDIR}/optee/
21 done
22}
23
24FILES_${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 @@
1
2do_install () {
3 install -D -p -m0755 ${S}/out/xtest/xtest ${D}${bindir}/xtest
4
5 # install path should match the value set in optee-client/tee-supplicant
6 # default TEEC_LOAD_PATH is /lib
7 mkdir -p ${D}/${libdir}/optee_armtz/
8 install -D -p -m0444 ${S}/out/ta/*/*.ta ${D}/${libdir}/optee_armtz/
9}
10
11FILES_${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 @@
1
2do_install () {
3 oe_runmake install DESTDIR=${D}${root_prefix}
4}
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"
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 @@
1
2do_install() {
3 install -d ${D}/${bindir}
4 install -m 0755 ${S}/scripts/cgroups-mount ${D}/${bindir}
5 install -m 0755 ${S}/scripts/cgroups-umount ${D}/${bindir}
6
7 install -d ${D}${sysconfdir}/init.d
8 install -m 0755 ${WORKDIR}/cgroups-init ${D}${sysconfdir}/init.d/cgroups-init
9
10 install -d ${D}${systemd_unitdir}/system
11 ln -sf /dev/null ${D}${systemd_unitdir}/system/cgroups-init.service
12}
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 = ""
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"
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 @@
1# short-description: Create SD card OTA image for NXP LS1043ARDB
2# long-description:
3# Create an OTA-enabled image that can be written onto a SD card using dd
4# for use with NXP LS1043ARDB SoC.
5# For data layout see Layerscape SDK User Guide, Chapter 4.2, tables 14 and 16.
6#
7part BL2 --source rawcopy2 --sourceparams="file=atf/bl2_sd.pbl" --ondisk mmcblk --no-table --align 4
8part BL3 --source rawcopy2 --sourceparams="file=atf/fip_uboot.bin" --ondisk mmcblk --no-table --align 1024
9part fman-ucode --source rawcopy2 --sourceparams="file=fsl_fman_ucode_ls1043_r1.1_108_4_9.bin" --ondisk mmcblk --no-table --align 9216
10part qe-ucode --source rawcopy2 --sourceparams="file=boot/fsl_qe_ucode_1021_10_A.bin" --ondisk mmcblk --no-table --align 9472
11part uboot-scr --source bootimg-partition --ondisk mmcblk --fstype=msdos --fixed-size=100M --align 65540
12part / --source otaimage --ondisk mmcblk --fstype=ext4 --label root --align 167940
13
14bootloader --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 @@
1# ex:ts=4:sw=4:sts=4:et
2# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
3#
4# This program is free software; you can redistribute it and/or modify
5# it under the terms of the GNU General Public License version 2 as
6# published by the Free Software Foundation.
7#
8# This program is distributed in the hope that it will be useful,
9# but WITHOUT ANY WARRANTY; without even the implied warranty of
10# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11# GNU General Public License for more details.
12#
13# You should have received a copy of the GNU General Public License along
14# with this program; if not, write to the Free Software Foundation, Inc.,
15# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
16#
17
18import logging
19import os
20
21from wic import WicError
22from wic.pluginbase import SourcePlugin
23from wic.misc import exec_cmd, get_bitbake_var
24from wic.filemap import sparse_copy
25
26logger = logging.getLogger('wic')
27
28class RawCopy2Plugin(SourcePlugin):
29 """
30 Populate partition content from raw image file.
31 """
32
33 name = 'rawcopy2'
34
35 @staticmethod
36 def do_image_label(fstype, dst, label):
37 if fstype.startswith('ext'):
38 cmd = 'tune2fs -L %s %s' % (label, dst)
39 elif fstype in ('msdos', 'vfat'):
40 cmd = 'dosfslabel %s %s' % (dst, label)
41 elif fstype == 'btrfs':
42 cmd = 'btrfs filesystem label %s %s' % (dst, label)
43 elif fstype == 'swap':
44 cmd = 'mkswap -L %s %s' % (label, dst)
45 elif fstype == 'squashfs':
46 raise WicError("It's not possible to update a squashfs "
47 "filesystem label '%s'" % (label))
48 else:
49 raise WicError("Cannot update filesystem label: "
50 "Unknown fstype: '%s'" % (fstype))
51
52 exec_cmd(cmd)
53
54 @classmethod
55 def do_prepare_partition(cls, part, source_params, cr, cr_workdir,
56 oe_builddir, bootimg_dir, kernel_dir,
57 rootfs_dir, native_sysroot):
58 """
59 Called to do the actual content population for a partition i.e. it
60 'prepares' the partition to be incorporated into the image.
61 """
62 if not kernel_dir:
63 kernel_dir = get_bitbake_var("DEPLOY_DIR_IMAGE")
64 if not kernel_dir:
65 raise WicError("Couldn't find DEPLOY_DIR_IMAGE, exiting")
66
67 logger.debug('Kernel dir: %s', kernel_dir)
68
69 if 'file' not in source_params:
70 raise WicError("No file specified")
71
72 src = os.path.join(kernel_dir, source_params['file'])
73 dst = os.path.join(cr_workdir, "%s.%s" % (source_params['file'], part.lineno))
74 if not os.path.exists(os.path.dirname(dst)):
75 os.makedirs(os.path.dirname(dst))
76
77 if 'skip' in source_params:
78 sparse_copy(src, dst, skip=int(source_params['skip']))
79 else:
80 sparse_copy(src, dst)
81
82 # get the size in the right units for kickstart (kB)
83 du_cmd = "du -Lbks %s" % dst
84 out = exec_cmd(du_cmd)
85 filesize = int(out.split()[0])
86
87 if filesize > part.size:
88 part.size = filesize
89
90 if part.label:
91 RawCopy2Plugin.do_image_label(part.fstype, dst, part.label)
92
93 part.source_file = dst