From 18a4418c5f0c182855c3151223c93a3bb0739535 Mon Sep 17 00:00:00 2001 From: Devaraj Ranganna Date: Wed, 19 Oct 2022 17:52:55 +0000 Subject: [PATCH 1/6] cassini-ci: Fix file paths in CI rules Fix the incorrect file paths specified in the CI rules so that CI jobs can be triggered when those files are modified. Signed-off-by: Devaraj Ranganna --- .gitlab/ci/rules.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.gitlab/ci/rules.yml b/.gitlab/ci/rules.yml index 008d3b7..20fa7a8 100644 --- a/.gitlab/ci/rules.yml +++ b/.gitlab/ci/rules.yml @@ -33,8 +33,8 @@ .kas-common: &kas-common - "meta-cassini-config/kas/cassini.yml" - "meta-cassini-config/kas/ci.yml" - - "meta-cassini-config/kas/internal/cassini-base.yml" - - "meta-cassini-config/kas/internal/cassini-release.yml" + - "meta-cassini-config/kas/include/cassini-base.yml" + - "meta-cassini-config/kas/include/cassini-release.yml" .kas-k3s: &kas-k3s - "meta-cassini-config/kas/cassini.yml" @@ -49,7 +49,7 @@ .kas-n1sdp: &kas-n1sdp - "meta-cassini-config/kas/n1sdp.yml" - - "meta-cassini-config/kas/internal/arm-machines.yml" + - "meta-cassini-config/kas/include/arm-machines.yml" .layer-configs: &layer-configs - "meta-cassini-distro/conf/layer.conf" -- GitLab From c35ba8e21d0fd2f9e098dafb351d21666fc423d0 Mon Sep 17 00:00:00 2001 From: Devaraj Ranganna Date: Fri, 28 Oct 2022 08:18:25 +0000 Subject: [PATCH 2/6] cassini-docs: Change abbreviation to full sentence Change the abbreviation `N1SDP` in heading to `Neoverse N1 System Development Platform (N1SDP)`. Signed-off-by: Devaraj Ranganna --- documentation/developer_manual/build_system.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/documentation/developer_manual/build_system.rst b/documentation/developer_manual/build_system.rst index e27bde2..9f41c5b 100644 --- a/documentation/developer_manual/build_system.rst +++ b/documentation/developer_manual/build_system.rst @@ -65,8 +65,8 @@ section of the User Manual. Target Platforms **************** -N1SDP -===== +Neoverse N1 System Development Platform (N1SDP) +=============================================== * **Corresponding value for** ``MACHINE`` **variable**: ``n1sdp``. * **Target Platform Config**: ``meta-cassini-config/kas/n1sdp.yml``. -- GitLab From 31e59b9d436dda24abb3d5015504e3f2447f851b Mon Sep 17 00:00:00 2001 From: Vikas Katariya Date: Wed, 30 Nov 2022 13:34:51 +0000 Subject: [PATCH 3/6] cassini-bsp: Add licensing header Add missing license header to `n1sdp-cassini-extra-settings.inc` Signed-off-by: Vikas Katariya --- .../conf/machine/n1sdp-cassini-extra-settings.inc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/meta-cassini-bsp/conf/machine/n1sdp-cassini-extra-settings.inc b/meta-cassini-bsp/conf/machine/n1sdp-cassini-extra-settings.inc index 9f901c9..dc011ea 100644 --- a/meta-cassini-bsp/conf/machine/n1sdp-cassini-extra-settings.inc +++ b/meta-cassini-bsp/conf/machine/n1sdp-cassini-extra-settings.inc @@ -1,3 +1,7 @@ +# Copyright (c) 2022 Arm Limited or its affiliates. All rights reserved. +# +# SPDX-License-Identifier: MIT + # FFA driver MACHINE_FEATURES:append = " arm-ffa" -- GitLab From 504239c78f01eea65c34ecb30d775cc66cdc8325 Mon Sep 17 00:00:00 2001 From: Vikas Katariya Date: Thu, 8 Dec 2022 17:17:34 +0000 Subject: [PATCH 4/6] cassini-[bsp,distro]: Move `*-extra-settings.inc` Move `N1SDP-cassini-extra-settings.inc` under `include` folder, to align with `meta-arm` repository structure. This allows us to include all machine specific extra-settings under the same directory. Signed-off-by: Vikas Katariya --- .../conf/machine/{ => include}/n1sdp-cassini-extra-settings.inc | 0 meta-cassini-distro/conf/distro/cassini.conf | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) rename meta-cassini-bsp/conf/machine/{ => include}/n1sdp-cassini-extra-settings.inc (100%) diff --git a/meta-cassini-bsp/conf/machine/n1sdp-cassini-extra-settings.inc b/meta-cassini-bsp/conf/machine/include/n1sdp-cassini-extra-settings.inc similarity index 100% rename from meta-cassini-bsp/conf/machine/n1sdp-cassini-extra-settings.inc rename to meta-cassini-bsp/conf/machine/include/n1sdp-cassini-extra-settings.inc diff --git a/meta-cassini-distro/conf/distro/cassini.conf b/meta-cassini-distro/conf/distro/cassini.conf index 95bf751..de9471f 100644 --- a/meta-cassini-distro/conf/distro/cassini.conf +++ b/meta-cassini-distro/conf/distro/cassini.conf @@ -4,7 +4,7 @@ require ${COREBASE}/meta-poky/conf/distro/poky.conf -include conf/machine/${MACHINE}-cassini-extra-settings.inc +include conf/machine/include/${MACHINE}-cassini-extra-settings.inc # Introduce the CASSINI Yocto Distro DISTRO = "cassini" -- GitLab From 6fe3a219b5376f0f25a930ae778403b9e506c5e7 Mon Sep 17 00:00:00 2001 From: Devaraj Ranganna Date: Wed, 19 Oct 2022 17:58:47 +0000 Subject: [PATCH 5/6] cassini-[docs,bsp,config,distro]: Add Corstone-1000-mps3 board support Add support for Corstone-1000-mps3 FPGA board https://developer.arm.com/documentation/102360/0000. The Corstone-1000 platform firmware needs to built using libc-musl library. Therefore, introduced a new Yocto multiconfig `meta-cassini-bsp/conf/multiconfig/firmware.conf`. In addition, use `libc-glibc` override to select patches for Cassini distribution and `libc-musl` override to select patches for Corstone-1000 firmware. Also, add `cassini` override where necessary to make sure yocto layer check doesn't fail. Finally, add Cassini-SDK support to Corstone-1000-mps3. Changelog: feature Signed-off-by: Devaraj Ranganna Signed-off-by: Vikas Katariya --- .../developer_manual/build_system.rst | 23 +++- documentation/user_manual/build.rst | 22 ++-- documentation/variables.py | 1 + meta-cassini-bsp/conf/layer.conf | 3 + ...rstone1000-mps3-cassini-extra-settings.inc | 15 +++ .../conf/multiconfig/firmware.conf | 113 ++++++++++++++++++ .../recipes-bsp/grub/grub-efi_%.bbappend | 6 + .../images/corstone1000-deploy-image.bb | 37 ++++++ .../corstone1000-utils-overlay-image.bb | 19 +++ .../systemd/corstone1000/system.conf | 7 ++ .../systemd/systemd-conf_%.bbappend | 13 ++ .../recipes-kernel/linux/linux-%.bbappend | 16 +++ .../linux-yocto/corstone1000/cgroups.cfg | 9 ++ .../linux-yocto/corstone1000/container.cfg | 5 + .../linux/linux-yocto/corstone1000/extfs.cfg | 8 ++ .../linux/linux-yocto/corstone1000/mmc.cfg | 26 ++++ .../linux-yocto/corstone1000/network.cfg | 26 ++++ .../linux/linux-yocto/corstone1000/sdk.cfg | 1 + .../wic/corstone1000-efidisk.wks.in | 13 ++ .../meta-arm-bsp/wic/corstone1000-grub.cfg | 12 ++ meta-cassini-config/kas/corstone1000-mps3.yml | 19 +++ .../qa-checks/cassini-dictionary | 5 + .../classes/cassini-image.bbclass | 22 ++-- .../conf/distro/include/cassini-sdk.inc | 6 +- .../conf/distro/include/cassini-test.inc | 18 +-- .../base-files/base-files_%.bbappend | 6 +- .../recipes-core/images/cassini-image-base.bb | 3 + .../procps/procps-cassini.inc | 6 +- .../recipes-extended/shadow/shadow_%.bbappend | 2 +- .../recipes-extended/sudo/sudo_%.bbappend | 8 +- .../recipes-kernel/linux/linux-%.bbappend | 6 +- 31 files changed, 423 insertions(+), 53 deletions(-) create mode 100644 meta-cassini-bsp/conf/machine/include/corstone1000-mps3-cassini-extra-settings.inc create mode 100644 meta-cassini-bsp/conf/multiconfig/firmware.conf create mode 100644 meta-cassini-bsp/meta-arm/meta-arm-bsp/recipes-bsp/grub/grub-efi_%.bbappend create mode 100644 meta-cassini-bsp/meta-arm/meta-arm-bsp/recipes-core/images/corstone1000-deploy-image.bb create mode 100644 meta-cassini-bsp/meta-arm/meta-arm-bsp/recipes-core/images/corstone1000-utils-overlay-image.bb create mode 100644 meta-cassini-bsp/meta-arm/meta-arm-bsp/recipes-core/systemd/corstone1000/system.conf create mode 100644 meta-cassini-bsp/meta-arm/meta-arm-bsp/recipes-core/systemd/systemd-conf_%.bbappend create mode 100644 meta-cassini-bsp/meta-arm/meta-arm-bsp/recipes-kernel/linux/linux-%.bbappend create mode 100644 meta-cassini-bsp/meta-arm/meta-arm-bsp/recipes-kernel/linux/linux-yocto/corstone1000/cgroups.cfg create mode 100644 meta-cassini-bsp/meta-arm/meta-arm-bsp/recipes-kernel/linux/linux-yocto/corstone1000/container.cfg create mode 100644 meta-cassini-bsp/meta-arm/meta-arm-bsp/recipes-kernel/linux/linux-yocto/corstone1000/extfs.cfg create mode 100644 meta-cassini-bsp/meta-arm/meta-arm-bsp/recipes-kernel/linux/linux-yocto/corstone1000/mmc.cfg create mode 100644 meta-cassini-bsp/meta-arm/meta-arm-bsp/recipes-kernel/linux/linux-yocto/corstone1000/network.cfg create mode 100644 meta-cassini-bsp/meta-arm/meta-arm-bsp/recipes-kernel/linux/linux-yocto/corstone1000/sdk.cfg create mode 100644 meta-cassini-bsp/meta-arm/meta-arm-bsp/wic/corstone1000-efidisk.wks.in create mode 100644 meta-cassini-bsp/meta-arm/meta-arm-bsp/wic/corstone1000-grub.cfg create mode 100644 meta-cassini-config/kas/corstone1000-mps3.yml diff --git a/documentation/developer_manual/build_system.rst b/documentation/developer_manual/build_system.rst index 9f41c5b..43042f1 100644 --- a/documentation/developer_manual/build_system.rst +++ b/documentation/developer_manual/build_system.rst @@ -74,10 +74,25 @@ Neoverse N1 System Development Platform (N1SDP) This supported target platform is the Neoverse N1 System Development Platform (N1SDP), implemented in |meta-arm-bsp|_. - The ``n1sdp.yml`` **Target Platform Config** includes common - configuration from the ``meta-cassini-config/kas/include/arm-machines.yml`` - which defines the BSPs, layers, and dependencies required when building for - the platform. + To read documentation about the N1SDP, see the + |N1SDP Technical Reference Manual|_. + +Corstone-1000 for MPS3 +====================== + + * **Corresponding value for** ``MACHINE`` **variable**: ``corstone1000-mps3`` + * **Target Platform Config**: ``meta-cassini-config/kas/corstone1000-mps3.yml`` + + This supported target platform is the Corstone-1000 MPS3, implemented in + |meta-arm-bsp|_. + + To read documentation about the Corstone-1000, see the + |Arm Corstone-1000 Technical Overview|_. + +The ``n1sdp.yml`` and ``corstone1000-mps3.yml`` **Target Platform Config** +includes common configuration from the +``meta-cassini-config/kas/include/arm-machines.yml`` which defines the BSPs, +layers, and dependencies required when building for the platform. .. _distribution_image_features_label: diff --git a/documentation/user_manual/build.rst b/documentation/user_manual/build.rst index d7627d2..ca71628 100644 --- a/documentation/user_manual/build.rst +++ b/documentation/user_manual/build.rst @@ -40,20 +40,14 @@ categories: * **Target Platform Configs**: Set the target platform - Cassini currently supports the The Neoverse N1 System Development Platform - (N1SDP), corresponding to the ``n1sdp`` ``MACHINE`` implemented in - |meta-arm-bsp|_. - A single Target Platform Config is therefore provided: - - * ``n1sdp.yml`` to select the N1SDP as the target platform. - - To read documentation about the N1SDP, see the - |N1SDP Technical Reference Manual|_. - -These kas configuration files can be used to build a custom Cassini distribution -by passing one **Base Config**, zero or more **Build Modifier Configs**, -and one **Target Platform Config** to the kas build tool, chained via a colon -(:) character. Examples for this are given later in this document. + For information on supported targets in Cassini and corresponding value + for ``MACHINE`` **variable**, refer to :ref:`target_platforms_label`. + +These kas configuration files can be used to build a custom Cassini +distribution by passing one **Base Config**, zero or more +**Build Modifier Configs**, and one **Target Platform Config** to the kas build +tool, chained via a colon (:) character. Examples for this are given later in +this document. In the next section, guidance is provided for configuring, building and deploying Cassini distributions using these kas configuration files. diff --git a/documentation/variables.py b/documentation/variables.py index 03e1471..b464d0b 100644 --- a/documentation/variables.py +++ b/documentation/variables.py @@ -47,6 +47,7 @@ general_links = { "link:kas Dependencies & installation": f"https://kas.readthedocs.io/en/{kas_version}/userguide.html#dependencies-installation", "link:meta-arm-bsp": f"https://git.yoctoproject.org/meta-arm/tree/meta-arm-bsp/documentation/n1sdp.md?h={yocto_release}", "link:N1SDP Technical Reference Manual": "https://developer.arm.com/documentation/101489/0000", + "link:Arm Corstone-1000 Technical Overview": "https://developer.arm.com/documentation/102360/0000", "link:PEP 8": "https://peps.python.org/pep-0008/", "link:pycodestyle Documentation": "https://pycodestyle.pycqa.org/en/latest/", "link:Shellcheck": "https://github.com/koalaman/shellcheck", diff --git a/meta-cassini-bsp/conf/layer.conf b/meta-cassini-bsp/conf/layer.conf index abe2aba..eb46b43 100644 --- a/meta-cassini-bsp/conf/layer.conf +++ b/meta-cassini-bsp/conf/layer.conf @@ -14,3 +14,6 @@ BBFILES_DYNAMIC += " \ BBFILE_COLLECTIONS += "meta-cassini-bsp" BBFILE_PATTERN_meta-cassini-bsp = "^${LAYERDIR}/" LAYERSERIES_COMPAT_meta-cassini-bsp = "langdale" + +# Root directory for the meta-cassini-bsp/meta-arm/meta-arm-bsp +CASSINI_ARM_BSP_DYNAMIC_DIR := "${LAYERDIR}/meta-arm/meta-arm-bsp" diff --git a/meta-cassini-bsp/conf/machine/include/corstone1000-mps3-cassini-extra-settings.inc b/meta-cassini-bsp/conf/machine/include/corstone1000-mps3-cassini-extra-settings.inc new file mode 100644 index 0000000..30c2118 --- /dev/null +++ b/meta-cassini-bsp/conf/machine/include/corstone1000-mps3-cassini-extra-settings.inc @@ -0,0 +1,15 @@ +# Copyright (c) 2022 Arm Limited or its affiliates. All rights reserved. +# +# SPDX-License-Identifier: MIT + +# Remove initramfs image generation for cassini distribution due to size restrictions +INITRAMFS_IMAGE:remove:libc-glibc = "corstone1000-initramfs-image" + +# Extend the wks search path to find custom wks file +WKS_SEARCH_PATH:prepend:libc-glibc:corstone1000 := "${CASSINI_ARM_BSP_DYNAMIC_DIR}/wic:" +WKS_FILE:libc-glibc:corstone1000 = "corstone1000-efidisk.wks.in" +GRUB_CFG_FILE:libc-glibc:corstone1000 ?= "${CASSINI_ARM_BSP_DYNAMIC_DIR}/wic/corstone1000-grub.cfg" + +# Add grub-efi +EFI_PROVIDER:libc-glibc ?= "grub-efi" +MACHINE_FEATURES:libc-glibc += "efi" diff --git a/meta-cassini-bsp/conf/multiconfig/firmware.conf b/meta-cassini-bsp/conf/multiconfig/firmware.conf new file mode 100644 index 0000000..7278080 --- /dev/null +++ b/meta-cassini-bsp/conf/multiconfig/firmware.conf @@ -0,0 +1,113 @@ +# Based on: meta-poky/conf/distro/poky-tiny.conf +# In open-source project: https://git.yoctoproject.org/poky/tree/meta-poky/conf/distro/poky-tiny.conf?id=eaf8ce9d39a2c0d9c42b32fb6596ab4302f93a1a +# +# Original file: Copyright (c) 2011, Intel Corporation. +# Modifications: Copyright (c) 2022 Arm Limited or its affiliates. All rights reserved. +# +# SPDX-License-Identifier: MIT + +TCLIBC = "musl" + +FULL_OPTIMIZATION="-Os -pipe ${DEBUG_FLAGS}" + +# FIXME: consider adding a new "tiny" feature +#DISTRO_FEATURES_append = " tiny" + +# Distro config is evaluated after the machine config, so we have to explicitly +# set the kernel provider to override a machine config. +PREFERRED_PROVIDER_virtual/kernel = "linux-yocto-tiny" +PREFERRED_VERSION_linux-yocto-tiny ?= "5.15%" + +# We can use packagegroup-core-boot, but in the future we may need a new packagegroup-core-tiny +#POKY_DEFAULT_EXTRA_RDEPENDS += "packagegroup-core-boot" +# Drop kernel-module-af-packet from RRECOMMENDS +POKY_DEFAULT_EXTRA_RRECOMMENDS = "" + +# FIXME: what should we do with this? +TCLIBCAPPEND = "" + +# Disable wide char support for ncurses as we don't include it in +# in the LIBC features below. +# Leave native enable to avoid build failures +ENABLE_WIDEC = "false" +ENABLE_WIDEC:class-native = "true" + +# Drop native language support. This removes the +# eglibc->bash->gettext->l ibc-posix-clang-wchar dependency. +USE_NLS="no" + +# Comment out any of the lines below to disable them in the build +# DISTRO_FEATURES options: +# alsa bluetooth ext2 pcmcia usbgadget usbhost wifi nfs zeroconf pci +DISTRO_FEATURES_TINY = "pci" +DISTRO_FEATURES_NET = "ipv4 ipv6" +DISTRO_FEATURES_USB = "usbhost" +#DISTRO_FEATURES_USBGADGET = "usbgadget" +#DISTRO_FEATURES_WIFI = "wifi" + +DISTRO_FEATURES = "${DISTRO_FEATURES_TINY} \ + ${DISTRO_FEATURES_NET} \ + ${DISTRO_FEATURES_USB} \ + ${DISTRO_FEATURES_USBGADGET} \ + ${DISTRO_FEATURES_WIFI} \ + " + +# Enable LFS - see bug YOCTO #5865 +DISTRO_FEATURES:append:libc-musl = " largefile" + +DISTRO_FEATURES:class-native = "${DISTRO_FEATURES_DEFAULT} ${POKY_DEFAULT_DISTRO_FEATURES}" +DISTRO_FEATURES:class-nativesdk = "${DISTRO_FEATURES_DEFAULT} ${POKY_DEFAULT_DISTRO_FEATURES}" + +# enable mdev/busybox for init +INIT_MANAGER = "mdev-busybox" +VIRTUAL-RUNTIME_dev_manager = "busybox-mdev" +VIRTUAL-RUNTIME_init_manager = "busybox" +VIRTUAL-RUNTIME_initscripts = "initscripts" +VIRTUAL-RUNTIME_keymaps = "keymaps" +VIRTUAL-RUNTIME_login_manager = "busybox" + +# FIXME: Consider adding "modules" to MACHINE_FEATURES and using that in +# packagegroup-core-base to select modutils-initscripts or not. Similar with "net" and +# netbase. + +# By default we only support initramfs. We don't build live as that +# pulls in a lot of dependencies for the live image and the installer, like +# udev, grub, etc. These pull in gettext, which fails to build with wide +# character support. +IMAGE_FSTYPES = "cpio.gz" +QB_DEFAULT_FSTYPE = "cpio.gz" + +# Drop v86d from qemu dependency list (we support serial) +# Drop grub from meta-intel BSPs +# FIXME: A different mechanism is needed here. We could define -tiny +# variants of all compatible machines, but that leads to a lot +# more machine configs to maintain long term. +MACHINE_ESSENTIAL_EXTRA_RDEPENDS = "" + +# The mtrace script included by eglibc is a perl script. This means the system +# will build perl in case this package is installed. Since we don't care about +# this script for the purposes of tiny, remove the dependency from here. +RDEPENDS:${PN}-mtrace:pn-eglibc = "" + +SKIP_RECIPE[build-appliance-image] = "not buildable with poky-tiny" +SKIP_RECIPE[core-image-rt] = "not buildable with poky-tiny" +SKIP_RECIPE[core-image-rt-sdk] = "not buildable with poky-tiny" +SKIP_RECIPE[core-image-sato] = "not buildable with poky-tiny" +SKIP_RECIPE[core-image-sato-dev] = "not buildable with poky-tiny" +SKIP_RECIPE[core-image-sato-sdk] = "not buildable with poky-tiny" +SKIP_RECIPE[core-image-x11] = "not buildable with poky-tiny" +SKIP_RECIPE[core-image-weston] = "not buildable with poky-tiny" + +# Disable python usage in opkg-utils since it won't build with tiny config +PACKAGECONFIG:remove:pn-opkg-utils = "python" + +DISTRO_FEATURES:remove = "pci ipv6 usbhost systemd virtualization seccomp k3s cassini-parsec cassini-security" + +# Cassini specific config options below +# Ensure this config has it's own TMPDIR +TMPDIR:append = "-firmware" + +KERNEL_CLASSES:remove = "containers_kernelcfg_check k3s_kernelcfg_check" + +# Include any machine specific extras +include conf/machine/include/${MACHINE}-firmware-extra-settings.inc diff --git a/meta-cassini-bsp/meta-arm/meta-arm-bsp/recipes-bsp/grub/grub-efi_%.bbappend b/meta-cassini-bsp/meta-arm/meta-arm-bsp/recipes-bsp/grub/grub-efi_%.bbappend new file mode 100644 index 0000000..eb1be47 --- /dev/null +++ b/meta-cassini-bsp/meta-arm/meta-arm-bsp/recipes-bsp/grub/grub-efi_%.bbappend @@ -0,0 +1,6 @@ +# Copyright (c) 2022 Arm Limited or its affiliates. All rights reserved. +# +# SPDX-License-Identifier: MIT + +# Ensure grub supports the required commands +GRUB_BUILDIN:append:corstone1000 = " gzio" diff --git a/meta-cassini-bsp/meta-arm/meta-arm-bsp/recipes-core/images/corstone1000-deploy-image.bb b/meta-cassini-bsp/meta-arm/meta-arm-bsp/recipes-core/images/corstone1000-deploy-image.bb new file mode 100644 index 0000000..ef8a3af --- /dev/null +++ b/meta-cassini-bsp/meta-arm/meta-arm-bsp/recipes-core/images/corstone1000-deploy-image.bb @@ -0,0 +1,37 @@ +# Copyright (c) 2022 Arm Limited or its affiliates. All rights reserved. +# +# SPDX-License-Identifier: MIT + +SUMMARY = "Firmware image deploying multiconfig firmware" + +inherit deploy nopackages + +LICENSE = "MIT" +PACKAGE_ARCH = "${MACHINE_ARCH}" +COMPATIBLE_MACHINE = "(corstone1000-mps3)" +do_configure[noexec] = "1" +do_compile[noexec] = "1" +do_install[noexec] = "1" + +FIRMWARE_BINARIES = "corstone1000-image-${MACHINE}.wic.nopt \ + ${@bb.utils.contains('DISTRO_FEATURES','cassini-test', \ + 'corstone1000-utils-overlay-image-${MACHINE}.tar.bz2', '', d)} \ + " + +do_deploy() { + firmwareloc="${TOPDIR}/tmp-firmware/deploy/images/${MACHINE}" + for firmware in ${FIRMWARE_BINARIES}; do + cp -av ${firmwareloc}/${firmware} ${DEPLOYDIR}/ + if [ -L ${firmwareloc}/${firmware} ]; then + cp -av ${firmwareloc}/$(readlink ${firmwareloc}/${firmware}) ${DEPLOYDIR}/ + fi + done +} + +do_deploy[umask] = "022" +do_deploy[mcdepends] = "mc::firmware:corstone1000-image:do_image_complete \ + ${@bb.utils.contains('DISTRO_FEATURES', 'cassini-test', \ + 'mc::firmware:corstone1000-utils-overlay-image:do_image_complete', '', d)} \ + " + +addtask deploy after do_prepare_recipe_sysroot diff --git a/meta-cassini-bsp/meta-arm/meta-arm-bsp/recipes-core/images/corstone1000-utils-overlay-image.bb b/meta-cassini-bsp/meta-arm/meta-arm-bsp/recipes-core/images/corstone1000-utils-overlay-image.bb new file mode 100644 index 0000000..7819c99 --- /dev/null +++ b/meta-cassini-bsp/meta-arm/meta-arm-bsp/recipes-core/images/corstone1000-utils-overlay-image.bb @@ -0,0 +1,19 @@ +# Copyright (c) 2022 Arm Limited or its affiliates. All rights reserved. +# +# SPDX-License-Identifier: MIT + +SUMMARY = "Overlay image containing bmaptool" +LICENSE = "MIT" + +inherit core-image +inherit nopackages + +PACKAGE_INSTALL = "bmap-tools" + +IMAGE_FEATURES = "" +IMAGE_LINGUAS = "" + +IMAGE_ROOTFS_SIZE = "0" +IMAGE_ROOTFS_EXTRA_SPACE = "0" + +IMAGE_FSTYPES += "tar.bz2" diff --git a/meta-cassini-bsp/meta-arm/meta-arm-bsp/recipes-core/systemd/corstone1000/system.conf b/meta-cassini-bsp/meta-arm/meta-arm-bsp/recipes-core/systemd/corstone1000/system.conf new file mode 100644 index 0000000..1ad5d82 --- /dev/null +++ b/meta-cassini-bsp/meta-arm/meta-arm-bsp/recipes-core/systemd/corstone1000/system.conf @@ -0,0 +1,7 @@ +# Copyright (c) 2022 Arm Limited or its affiliates. All rights reserved. +# +# SPDX-License-Identifier: MIT + +[Manager] +# Change DefaultTimeoutStartSec from 90s to 300s +DefaultTimeoutStartSec = 300s diff --git a/meta-cassini-bsp/meta-arm/meta-arm-bsp/recipes-core/systemd/systemd-conf_%.bbappend b/meta-cassini-bsp/meta-arm/meta-arm-bsp/recipes-core/systemd/systemd-conf_%.bbappend new file mode 100644 index 0000000..e31c3e8 --- /dev/null +++ b/meta-cassini-bsp/meta-arm/meta-arm-bsp/recipes-core/systemd/systemd-conf_%.bbappend @@ -0,0 +1,13 @@ +# Copyright (c) 2022 Arm Limited or its affiliates. All rights reserved. +# +# SPDX-License-Identifier: MIT + +FILESEXTRAPATHS:prepend := "${THISDIR}:" + +SRC_URI:append:corstone1000 = "\ + file://system.conf \ +" + +do_install:append:corstone1000() { + install -D -m0644 ${WORKDIR}/system.conf ${D}${systemd_system_unitdir}.conf.d/01-${PN}.conf +} diff --git a/meta-cassini-bsp/meta-arm/meta-arm-bsp/recipes-kernel/linux/linux-%.bbappend b/meta-cassini-bsp/meta-arm/meta-arm-bsp/recipes-kernel/linux/linux-%.bbappend new file mode 100644 index 0000000..68ded0c --- /dev/null +++ b/meta-cassini-bsp/meta-arm/meta-arm-bsp/recipes-kernel/linux/linux-%.bbappend @@ -0,0 +1,16 @@ +# Copyright (c) 2022 Arm Limited or its affiliates. All rights reserved. +# +# SPDX-License-Identifier: MIT + +FILESEXTRAPATHS:prepend:libc-glibc := "${THISDIR}:${THISDIR}/linux-yocto:" + +SRC_URI:append:libc-glibc:corstone1000 = " \ + file://extfs.cfg \ + file://cgroups.cfg \ + file://mmc.cfg \ + file://container.cfg \ + file://network.cfg \ + ${@bb.utils.contains('DISTRO_FEATURES', \ + 'cassini-sdk', \ + 'file://sdk.cfg ', '', d)} \ + " diff --git a/meta-cassini-bsp/meta-arm/meta-arm-bsp/recipes-kernel/linux/linux-yocto/corstone1000/cgroups.cfg b/meta-cassini-bsp/meta-arm/meta-arm-bsp/recipes-kernel/linux/linux-yocto/corstone1000/cgroups.cfg new file mode 100644 index 0000000..0544241 --- /dev/null +++ b/meta-cassini-bsp/meta-arm/meta-arm-bsp/recipes-kernel/linux/linux-yocto/corstone1000/cgroups.cfg @@ -0,0 +1,9 @@ +CONFIG_CGROUP_SCHED=y +CONFIG_CGROUPS=y +CONFIG_CGROUP_DEBUG=y +CONFIG_CGROUP_DEVICE=y +CONFIG_BLK_CGROUP=y +CONFIG_NET_CLS_CGROUP=y +CONFIG_PERF_EVENTS=y +CONFIG_CGROUP_PERF=y +CONFIG_CGROUP_HUGETLB=y diff --git a/meta-cassini-bsp/meta-arm/meta-arm-bsp/recipes-kernel/linux/linux-yocto/corstone1000/container.cfg b/meta-cassini-bsp/meta-arm/meta-arm-bsp/recipes-kernel/linux/linux-yocto/corstone1000/container.cfg new file mode 100644 index 0000000..ee1cd51 --- /dev/null +++ b/meta-cassini-bsp/meta-arm/meta-arm-bsp/recipes-kernel/linux/linux-yocto/corstone1000/container.cfg @@ -0,0 +1,5 @@ +CONFIG_DM_THIN_PROVISIONING=m +CONFIG_CFS_BANDWIDTH=y +CONFIG_FAIR_GROUP_SCHED=y +CONFIG_RT_GROUP_SCHED=y +CONFIG_IPC_NS=y diff --git a/meta-cassini-bsp/meta-arm/meta-arm-bsp/recipes-kernel/linux/linux-yocto/corstone1000/extfs.cfg b/meta-cassini-bsp/meta-arm/meta-arm-bsp/recipes-kernel/linux/linux-yocto/corstone1000/extfs.cfg new file mode 100644 index 0000000..9dade58 --- /dev/null +++ b/meta-cassini-bsp/meta-arm/meta-arm-bsp/recipes-kernel/linux/linux-yocto/corstone1000/extfs.cfg @@ -0,0 +1,8 @@ +CONFIG_EXT2_FS=y +# CONFIG_EXT2_FS_XATTR is not set +CONFIG_EXT3_FS=y +CONFIG_EXT4_FS=y +# CONFIG_EXT4_FS_POSIX_ACL is not set +# CONFIG_EXT4_FS_SECURITY is not set +# CONFIG_EXT4_DEBUG is not set +CONFIG_AUTOFS4_FS=y diff --git a/meta-cassini-bsp/meta-arm/meta-arm-bsp/recipes-kernel/linux/linux-yocto/corstone1000/mmc.cfg b/meta-cassini-bsp/meta-arm/meta-arm-bsp/recipes-kernel/linux/linux-yocto/corstone1000/mmc.cfg new file mode 100644 index 0000000..948d1a7 --- /dev/null +++ b/meta-cassini-bsp/meta-arm/meta-arm-bsp/recipes-kernel/linux/linux-yocto/corstone1000/mmc.cfg @@ -0,0 +1,26 @@ +CONFIG_REGULATOR=y +# CONFIG_REGULATOR_DEBUG is not set +CONFIG_REGULATOR_FIXED_VOLTAGE=y +# CONFIG_REGULATOR_VIRTUAL_CONSUMER is not set +# CONFIG_REGULATOR_USERSPACE_CONSUMER is not set +# CONFIG_REGULATOR_GPIO is not set +# CONFIG_REGULATOR_VCTRL is not set +# CONFIG_REGULATOR_VEXPRESS is not set +CONFIG_MMC=y +# CONFIG_PWRSEQ_EMMC is not set +CONFIG_PWRSEQ_SIMPLE=y +CONFIG_MMC_BLOCK=y +CONFIG_MMC_BLOCK_MINORS=8 +# CONFIG_SDIO_UART is not set +# CONFIG_MMC_TEST is not set +# CONFIG_MMC_DEBUG is not set +CONFIG_MMC_ARMMMCI=y +# CONFIG_MMC_STM32_SDMMC is not set +# CONFIG_MMC_SDHCI is not set +# CONFIG_MMC_DW is not set +# CONFIG_MMC_VUB300 is not set +# CONFIG_MMC_USHC is not set +# CONFIG_MMC_USDHI6ROL0 is not set +# CONFIG_MMC_CQHCI is not set +# CONFIG_MMC_HSQ is not set +# CONFIG_MMC_MTK is not set diff --git a/meta-cassini-bsp/meta-arm/meta-arm-bsp/recipes-kernel/linux/linux-yocto/corstone1000/network.cfg b/meta-cassini-bsp/meta-arm/meta-arm-bsp/recipes-kernel/linux/linux-yocto/corstone1000/network.cfg new file mode 100644 index 0000000..c1664f6 --- /dev/null +++ b/meta-cassini-bsp/meta-arm/meta-arm-bsp/recipes-kernel/linux/linux-yocto/corstone1000/network.cfg @@ -0,0 +1,26 @@ +CONFIG_NETFILTER=y +CONFIG_NETFILTER_XTABLES=y +CONFIG_NETFILTER_XT_MATCH_ADDRTYPE=m +CONFIG_IP_NF_IPTABLES=m +CONFIG_IP_NF_FILTER=m +CONFIG_NF_NAT=m +CONFIG_NF_CONNTRACK=y +CONFIG_IP_NF_NAT=m +CONFIG_IP_NF_TARGET_MASQUERADE=m +CONFIG_IP_NF_TARGET_REDIRECT=y +CONFIG_IP_SET=m +CONFIG_IP_VS=y +CONFIG_IP_VS_NFCT=y +CONFIG_IP_VS_PROTO_TCP=y +CONFIG_IP_VS_PROTO_UDP=y +CONFIG_IP_VS_RR=m +CONFIG_NETFILTER_NETLINK_LOG=m +CONFIG_NETFILTER_XT_CONNMARK=m +CONFIG_NETFILTER_XT_MATCH_COMMENT=m +CONFIG_NETFILTER_XT_MATCH_LIMIT=m +CONFIG_NETFILTER_XT_MATCH_MARK=m +CONFIG_NETFILTER_XT_MATCH_PHYSDEV=m +CONFIG_NETFILTER_XT_TARGET_NFLOG=m +CONFIG_NETFILTER_XT_TARGET_REDIRECT=m +CONFIG_POSIX_MQUEUE=y +CONFIG_IPC_NS=y diff --git a/meta-cassini-bsp/meta-arm/meta-arm-bsp/recipes-kernel/linux/linux-yocto/corstone1000/sdk.cfg b/meta-cassini-bsp/meta-arm/meta-arm-bsp/recipes-kernel/linux/linux-yocto/corstone1000/sdk.cfg new file mode 100644 index 0000000..e24be27 --- /dev/null +++ b/meta-cassini-bsp/meta-arm/meta-arm-bsp/recipes-kernel/linux/linux-yocto/corstone1000/sdk.cfg @@ -0,0 +1 @@ +CONFIG_KPROBES=y diff --git a/meta-cassini-bsp/meta-arm/meta-arm-bsp/wic/corstone1000-efidisk.wks.in b/meta-cassini-bsp/meta-arm/meta-arm-bsp/wic/corstone1000-efidisk.wks.in new file mode 100644 index 0000000..3a65fd0 --- /dev/null +++ b/meta-cassini-bsp/meta-arm/meta-arm-bsp/wic/corstone1000-efidisk.wks.in @@ -0,0 +1,13 @@ +# Copyright (c) 2022 Arm Limited or its affiliates. All rights reserved. +# +# SPDX-License-Identifier: MIT + +# short-description: Create an EFI disk image +# long-description: Creates a partitioned EFI disk image that the user +# can directly dd to boot media. Uses a custom grub.cfg file to configure the boot. + +part /boot --source bootimg-efi --sourceparams="loader=grub-efi" --ondisk sda --label msdos --active --align 1024 + +part / --source rootfs --ondisk sda --fstype=ext4 --label root --align 1024 --uuid=6a60524d-061d-454a-bfd1-38989910eccd + +bootloader --ptable gpt --configfile="${GRUB_CFG_FILE}" --timeout=5 diff --git a/meta-cassini-bsp/meta-arm/meta-arm-bsp/wic/corstone1000-grub.cfg b/meta-cassini-bsp/meta-arm/meta-arm-bsp/wic/corstone1000-grub.cfg new file mode 100644 index 0000000..0d1e044 --- /dev/null +++ b/meta-cassini-bsp/meta-arm/meta-arm-bsp/wic/corstone1000-grub.cfg @@ -0,0 +1,12 @@ +# Copyright (c) 2022 Arm Limited or its affiliates. All rights reserved. +# +# SPDX-License-Identifier: MIT + +set debug="loader,mm" +set term="vt100" +set default="0" +set timeout="5" + +menuentry 'Arm reference image boot on Corstone1000 (Device Tree)' { + linux /Image.gz earlycon=pl011,0x1a510000 console=ttyAMA0,115200 root=PARTUUID=6a60524d-061d-454a-bfd1-38989910eccd rootwait rootfstype=ext4 verbose debug +} diff --git a/meta-cassini-config/kas/corstone1000-mps3.yml b/meta-cassini-config/kas/corstone1000-mps3.yml new file mode 100644 index 0000000..e773c00 --- /dev/null +++ b/meta-cassini-config/kas/corstone1000-mps3.yml @@ -0,0 +1,19 @@ +# Copyright (c) 2022 Arm Limited or its affiliates. All rights reserved. +# +# SPDX-License-Identifier: MIT + +--- +header: + version: 11 + includes: + - meta-cassini-config/kas/include/arm-machines.yml + +local_conf_header: + corstone1000: | + # Only needed as kas dosn't add it automatically unless you have 2 targets + BBMULTICONFIG ?= "firmware" + + # psa-arch-tests linux userspace application + IMAGE_INSTALL:remove = "secure-partitions-psa-api-tests" + +machine: corstone1000-mps3 diff --git a/meta-cassini-config/qa-checks/cassini-dictionary b/meta-cassini-config/qa-checks/cassini-dictionary index 0f34b06..454df2d 100644 --- a/meta-cassini-config/qa-checks/cassini-dictionary +++ b/meta-cassini-config/qa-checks/cassini-dictionary @@ -21,6 +21,7 @@ appends arm-machines.yml armv8-a armv8a-crc +attestation aws b baremetal @@ -69,6 +70,9 @@ containerization containerized containers_kernelcfg_check.bbclass contributing_documentation_build_validation +corstone-1000 +corstone1000-mps3 +corstone1000-mps3.yml cortex-a customizable customization @@ -179,6 +183,7 @@ meta-virtualization minicom modifiable modifier +mps3 mr multiconfig n1 diff --git a/meta-cassini-distro/classes/cassini-image.bbclass b/meta-cassini-distro/classes/cassini-image.bbclass index 82a5477..072361f 100644 --- a/meta-cassini-distro/classes/cassini-image.bbclass +++ b/meta-cassini-distro/classes/cassini-image.bbclass @@ -8,17 +8,19 @@ IMAGE_BUILDINFO_VARS = " \ inherit core-image extrausers image-buildinfo +IMAGE_FSTYPES:corstone1000 += "wic wic.gz wic.bmap" + # meta-virtualization/recipes-containers/k3s/README.md states that K3s requires # 2GB of space in the rootfs to ensure containers can start CASSINI_ROOTFS_EXTRA_SPACE ?= "2000000" -IMAGE_ROOTFS_EXTRA_SPACE:append = "${@ ' + ${CASSINI_ROOTFS_EXTRA_SPACE}' \ - if '${CASSINI_ROOTFS_EXTRA_SPACE}' \ - else ''}" +IMAGE_ROOTFS_EXTRA_SPACE:append:libc-glibc = "${@ ' + ${CASSINI_ROOTFS_EXTRA_SPACE}' \ + if '${CASSINI_ROOTFS_EXTRA_SPACE}' \ + else ''}" -IMAGE_FEATURES += "ssh-server-openssh bash-completion-pkgs" +IMAGE_FEATURES:libc-glibc = " ssh-server-openssh bash-completion-pkgs" -IMAGE_INSTALL += "\ +IMAGE_INSTALL:append:libc-glibc = " \ bash \ bash-completion-extra \ ca-certificates \ @@ -31,8 +33,8 @@ IMAGE_INSTALL += "\ # Add two users: one with admin access and one without admin access # 'CASSINI_USER_ACCOUNT', 'CASSINI_ADMIN_ACCOUNT' -EXTRA_USERS_PARAMS:prepend = " useradd -p '' ${CASSINI_USER_ACCOUNT}; \ - useradd -p '' ${CASSINI_ADMIN_ACCOUNT}; \ - groupadd ${CASSINI_ADMIN_GROUP}; \ - usermod -aG ${CASSINI_ADMIN_GROUP} ${CASSINI_ADMIN_ACCOUNT}; \ - " +EXTRA_USERS_PARAMS:prepend:libc-glibc = " useradd -p '' ${CASSINI_USER_ACCOUNT}; \ + useradd -p '' ${CASSINI_ADMIN_ACCOUNT}; \ + groupadd ${CASSINI_ADMIN_GROUP}; \ + usermod -aG ${CASSINI_ADMIN_GROUP} ${CASSINI_ADMIN_ACCOUNT}; \ + " diff --git a/meta-cassini-distro/conf/distro/include/cassini-sdk.inc b/meta-cassini-distro/conf/distro/include/cassini-sdk.inc index 48923f0..ec84215 100644 --- a/meta-cassini-distro/conf/distro/include/cassini-sdk.inc +++ b/meta-cassini-distro/conf/distro/include/cassini-sdk.inc @@ -5,7 +5,7 @@ # Config specifc to the cassini-sdk distro feature, enabled using # DISTRO_FEATURES -IMAGE_FEATURES:append = " \ +IMAGE_FEATURES:append:libc-glibc = " \ package-management \ dev-pkgs \ tools-sdk \ @@ -14,6 +14,6 @@ IMAGE_FEATURES:append = " \ debug-tweaks \ ssh-server-openssh" -IMAGE_INSTALL:append = " kernel-base kernel-devsrc kernel-modules" +IMAGE_INSTALL:append:libc-glibc = " kernel-base kernel-devsrc kernel-modules" -IMAGE_INSTALL:append:aarch64 = " gator-daemon" +IMAGE_INSTALL:append:aarch64:libc-glibc = " gator-daemon" diff --git a/meta-cassini-distro/conf/distro/include/cassini-test.inc b/meta-cassini-distro/conf/distro/include/cassini-test.inc index 019e64d..b814a55 100644 --- a/meta-cassini-distro/conf/distro/include/cassini-test.inc +++ b/meta-cassini-distro/conf/distro/include/cassini-test.inc @@ -5,12 +5,14 @@ # Config specifc to the cassini-test distro feature, enabled using # DISTRO_FEATURES -DISTRO_FEATURES:append = " ptest" -EXTRA_IMAGE_FEATURES:append = " debug-tweaks" -IMAGE_INSTALL:append = " jfrog-cli \ - container-engine-integration-tests-ptest \ - k3s-integration-tests-ptest \ - user-accounts-integration-tests-ptest" +DISTRO_FEATURES:append:libc-glibc = " ptest" -IMAGE_INSTALL:append = "${@bb.utils.contains('DISTRO_FEATURES',\ - 'cassini-parsec', ' parsec-simple-e2e-tests-ptest', '', d)}" +EXTRA_IMAGE_FEATURES:append:libc-glibc = " debug-tweaks" + +IMAGE_INSTALL:append:libc-glibc = " jfrog-cli \ + container-engine-integration-tests-ptest \ + k3s-integration-tests-ptest \ + user-accounts-integration-tests-ptest \ + ${@bb.utils.contains('DISTRO_FEATURES',\ + 'cassini-parsec', 'parsec-simple-e2e-tests-ptest', '', d)} \ + " diff --git a/meta-cassini-distro/recipes-core/base-files/base-files_%.bbappend b/meta-cassini-distro/recipes-core/base-files/base-files_%.bbappend index 76658ff..e923898 100644 --- a/meta-cassini-distro/recipes-core/base-files/base-files_%.bbappend +++ b/meta-cassini-distro/recipes-core/base-files/base-files_%.bbappend @@ -2,15 +2,15 @@ # # SPDX-License-Identifier: MIT -FILESEXTRAPATHS:prepend:cassini := "${THISDIR}/files:" +FILESEXTRAPATHS:prepend:libc-glibc:cassini := "${THISDIR}/files:" OVERRIDES:append = "${CASSINI_OVERRIDES}" -SRC_URI:append:cassini = " file://cassini_profile.sh" +SRC_URI:append:libc-glibc:cassini = " file://cassini_profile.sh" CASSINI_SECURITY_UMASK ??= "0027" -do_install:append:cassini() { +do_install:append:libc-glibc:cassini() { # PS1 is set inside cassini_profile.sh sed -i '/PS1/d' ${D}${sysconfdir}/skel/.bashrc diff --git a/meta-cassini-distro/recipes-core/images/cassini-image-base.bb b/meta-cassini-distro/recipes-core/images/cassini-image-base.bb index 11cf6e1..6fe0698 100644 --- a/meta-cassini-distro/recipes-core/images/cassini-image-base.bb +++ b/meta-cassini-distro/recipes-core/images/cassini-image-base.bb @@ -9,3 +9,6 @@ IMAGE_LINGUAS = " " LICENSE = "MIT" inherit cassini-image + +# Ensure cassini-image-* also builds the firmware for platforms that use a different libc +EXTRA_IMAGEDEPENDS:append:corstone1000 = " corstone1000-deploy-image" diff --git a/meta-cassini-distro/recipes-extended/procps/procps-cassini.inc b/meta-cassini-distro/recipes-extended/procps/procps-cassini.inc index 5fc5c8a..b80fc07 100644 --- a/meta-cassini-distro/recipes-extended/procps/procps-cassini.inc +++ b/meta-cassini-distro/recipes-extended/procps/procps-cassini.inc @@ -2,13 +2,13 @@ # # SPDX-License-Identifier: MIT -FILESEXTRAPATHS:prepend:cassini := "${THISDIR}/files:" +FILESEXTRAPATHS:prepend:libc-glibc:cassini := "${THISDIR}/files:" QUIET_PRINTK = "20-quiet-printk.conf" -SRC_URI:append:cassini = "file://${QUIET_PRINTK}" +SRC_URI:append:libc-glibc:cassini = "file://${QUIET_PRINTK}" -do_install:append:cassini() { +do_install:append:libc-glibc:cassini() { install -Dm 0640 ${WORKDIR}/${QUIET_PRINTK} \ ${D}${sysconfdir}/sysctl.d/${QUIET_PRINTK} } diff --git a/meta-cassini-distro/recipes-extended/shadow/shadow_%.bbappend b/meta-cassini-distro/recipes-extended/shadow/shadow_%.bbappend index fa8f709..081a2d9 100644 --- a/meta-cassini-distro/recipes-extended/shadow/shadow_%.bbappend +++ b/meta-cassini-distro/recipes-extended/shadow/shadow_%.bbappend @@ -4,7 +4,7 @@ OVERRIDES:append = "${CASSINI_OVERRIDES}" -do_install:append:cassini() { +do_install:append:libc-glibc:cassini() { # Make sure that users cannot access to each other HOME directory sed -i 's/#HOME_MODE/HOME_MODE/g' ${D}${sysconfdir}/login.defs diff --git a/meta-cassini-distro/recipes-extended/sudo/sudo_%.bbappend b/meta-cassini-distro/recipes-extended/sudo/sudo_%.bbappend index 0b65efa..b4d4194 100644 --- a/meta-cassini-distro/recipes-extended/sudo/sudo_%.bbappend +++ b/meta-cassini-distro/recipes-extended/sudo/sudo_%.bbappend @@ -2,13 +2,13 @@ # # SPDX-License-Identifier: MIT -FILESEXTRAPATHS:prepend:cassini := "${THISDIR}/files:" +FILESEXTRAPATHS:prepend:libc-glibc:cassini := "${THISDIR}/files:" -SRC_URI:append:cassini = " file://cassini_admin_group.in" +SRC_URI:append:libc-glibc:cassini = " file://cassini_admin_group.in" -DEPENDS:append:cassini = " gettext-native" +DEPENDS:append:libc-glibc:cassini = " gettext-native" -do_install:append:cassini() { +do_install:append:libc-glibc:cassini() { export ADMIN_GROUP="${CASSINI_ADMIN_GROUP}" export ADMIN_GROUP_OPTIONS="${CASSINI_ADMIN_GROUP_OPTIONS}" diff --git a/meta-cassini-distro/recipes-kernel/linux/linux-%.bbappend b/meta-cassini-distro/recipes-kernel/linux/linux-%.bbappend index e699e9e..0d387f2 100644 --- a/meta-cassini-distro/recipes-kernel/linux/linux-%.bbappend +++ b/meta-cassini-distro/recipes-kernel/linux/linux-%.bbappend @@ -2,15 +2,15 @@ # # SPDX-License-Identifier: MIT -FILESEXTRAPATHS:prepend:cassini := "${THISDIR}:${THISDIR}/linux-yocto:" +FILESEXTRAPATHS:prepend:libc-glibc:cassini := "${THISDIR}:${THISDIR}/linux-yocto:" # # cassini kmeta # -SRC_URI:append:cassini = " file://cassini-kmeta;type=kmeta;name=cassini-kmeta;destsuffix=cassini-kmeta" +SRC_URI:append:libc-glibc:cassini = " file://cassini-kmeta;type=kmeta;name=cassini-kmeta;destsuffix=cassini-kmeta" # Add gator daemon kernel configs dependencies. -KERNEL_FEATURES:append:cassini:aarch64 = "${@bb.utils.contains('DISTRO_FEATURES', \ +KERNEL_FEATURES:append:libc-glibc:aarch64:cassini = "${@bb.utils.contains('DISTRO_FEATURES', \ 'cassini-sdk', \ ' features/cassini/gator.scc', '', d)}" -- GitLab From 09801347891e4ac2db5fb21af88a95e12dd06630 Mon Sep 17 00:00:00 2001 From: Devaraj Ranganna Date: Wed, 19 Oct 2022 17:58:03 +0000 Subject: [PATCH 6/6] cassini-ci: Add sanity job for Corstone1000-mps3 board Added sanity test to validate Cassini distro booting on Corstone1000-mps3 FPGA board. Signed-off-by: Devaraj Ranganna --- .gitlab-ci.yml | 3 +- .gitlab/ci/corstone1000-image-builds.yml | 61 ++++++++ .gitlab/ci/lava-test.yml | 42 ++++++ .gitlab/ci/rules.yml | 16 ++ .gitlab/ci/templates/image_build.yml.j2 | 41 +++++ .gitlab/ci/trigger-image-builds.yml | 10 ++ .gitlab/ci/yocto-qa.yml | 5 +- .../lava/corstone1000-mps3/sanity_job.yml.j2 | 141 ++++++++++++++++++ 8 files changed, 316 insertions(+), 3 deletions(-) create mode 100644 .gitlab/ci/corstone1000-image-builds.yml create mode 100644 .gitlab/lava/corstone1000-mps3/sanity_job.yml.j2 diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index d38289a..4b8d40c 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -14,7 +14,7 @@ variables: BUILD_PLATFORM: value: none description: Comma seperated list of platforms to build - (none, all-platforms, n1sdp) + (none, all-platforms, corstone1000-mps3, n1sdp) BUILD_HOST_ARCH: value: arm64 description: What build host architecture should be used @@ -48,6 +48,7 @@ include: - local: '.gitlab/ci/rules.yml' - local: '.gitlab/ci/docker-image-builds.yml' - local: '.gitlab/ci/n1sdp-image-builds.yml' + - local: '.gitlab/ci/corstone1000-image-builds.yml' - local: '.gitlab/ci/trigger-image-builds.yml' - local: '.gitlab/ci/docs-build.yml' diff --git a/.gitlab/ci/corstone1000-image-builds.yml b/.gitlab/ci/corstone1000-image-builds.yml new file mode 100644 index 0000000..712120d --- /dev/null +++ b/.gitlab/ci/corstone1000-image-builds.yml @@ -0,0 +1,61 @@ +# Copyright (c) 2022 Arm Limited or its affiliates. All rights reserved. +# +# SPDX-License-Identifier: MIT +--- +.corstone1000_generator: + extends: .generator + variables: + MACHINE: corstone1000-mps3 + RUN_TESTS: 'none' + + +cassini/tests/corstone1000-mps3: + extends: .corstone1000_generator + variables: + RUN_TESTS: sanity + rules: + - if: '($BUILD_IMAGE =~ /all-images/ || $BUILD_IMAGE =~ /k3s/) && + ($BUILD_PLATFORM =~ /all-platforms/ || + $BUILD_PLATFORM =~ /corstone1000-mps3/)' + - !reference [".build-image:rules:k3s", rules] + - !reference [".build-image:rules:corstone1000", rules] + +cassini/security/tests/corstone1000-mps3: + extends: .corstone1000_generator + variables: + RUN_TESTS: sanity + rules: + - if: '($BUILD_IMAGE =~ /all-images/ || $BUILD_IMAGE =~ /k3s/) && + ($BUILD_PLATFORM =~ /all-platforms/ || + $BUILD_PLATFORM =~ /corstone1000-mps3/)' + - !reference [".build-image:rules:k3s-security", rules] + - !reference [".build-image:rules:corstone1000", rules] + +cassini-dev/tests/corstone1000-mps3: + extends: .corstone1000_generator + variables: + RUN_TESTS: sanity + rules: + - if: '($BUILD_IMAGE =~ /all-images/ || $BUILD_IMAGE =~ /k3s/) && + ($BUILD_PLATFORM =~ /all-platforms/ || + $BUILD_PLATFORM =~ /corstone1000-mps3/) + && ($FREQUENCY == "nightly")' + +cassini-dev/security/tests/corstone1000-mps3: + extends: .corstone1000_generator + variables: + RUN_TESTS: sanity + rules: + - if: '($BUILD_IMAGE =~ /all-images/ || $BUILD_IMAGE =~ /k3s/) && + ($BUILD_PLATFORM =~ /all-platforms/ || + $BUILD_PLATFORM =~ /corstone1000-mps3/) + && ($FREQUENCY == "nightly")' + +cassini-sdk/corstone1000-mps3: + extends: .corstone1000_generator + rules: + - if: '($BUILD_IMAGE =~ /all-images/ || $BUILD_IMAGE =~ /k3s/) && + ($BUILD_PLATFORM =~ /all-platforms/ || + $BUILD_PLATFORM =~ /corstone1000-mps3/)' + - !reference [".build-image:rules:k3s-sdk", rules] + - !reference [".build-image:rules:corstone1000", rules] diff --git a/.gitlab/ci/lava-test.yml b/.gitlab/ci/lava-test.yml index 5a6f60f..d77a8b9 100644 --- a/.gitlab/ci/lava-test.yml +++ b/.gitlab/ci/lava-test.yml @@ -38,6 +38,28 @@ sed -i "s/$config$current_value/$config$new_value/" config.txt zip -r ../cassini-firmware.zip * ;; + 'corstone1000-mps3') + echo "Building FPGA image set for Corstone1000 MPS3 board" + mkdir -p ~/.ssh + eval "$(ssh-agent -s)" + if [ -n "${SSH_PRIVATE_GERRIT}+x" ]; then + echo "${SSH_PRIVATE_GERRIT}" | tr -d '\r' | ssh-add - > /dev/null; + fi + ssh-keyscan -t rsa ${CI_SERVER_HOST} >> ~/.ssh/known_hosts + git config --global url.ssh://git@${CI_SERVER_HOST}.insteadOf \ + https://${CI_SERVER_HOST} + git clone https://${CI_SERVER_HOST}/${CORSTONE1000_CI_PATH} + export \ + BUILD_DIR=$(pwd)/../work/build/tmp/deploy/images/corstone1000-mps3/ + # The `LavaPrepTool.py` requires specfic file name to prep for lava + cp ${BUILD_DIR}/corstone1000-image-${MACHINE}.wic.nopt \ + ${BUILD_DIR}/corstone1000-flash-firmware-image-${MACHINE}.wic.nopt + python3 corstone1000-ci/LavaPrepTool.py create_mps3 --config \ + corstone1000-ci/configs/cassini_create_mps3.yml + # LavaPrepTool creates this under cassini-firmware/, but Gitlab is + # looking in the parent directory. So we move it. + mv cassini-firmware.zip ../ + ;; *) echo "Unkown machine ${MACHINE}" exit 1 @@ -118,3 +140,23 @@ junit: - TEST-*-test-report.xml when: always + +.sanity-test: + extends: .submit-cassini-lava-job + variables: + LAVA_JOB: sanity_job.yml + +.sanity-test-results: + extends: .complete-lava-job + after_script: + - python3 .gitlab/scripts/lava-to-junit.py + lava-result.yml + "TEST-${CI_JOB_NAME}-test-report.xml" + artifacts: + paths: + - lava-result.yml + expire_in: 1 day + reports: + junit: + - TEST-*-test-report.xml + when: always diff --git a/.gitlab/ci/rules.yml b/.gitlab/ci/rules.yml index 20fa7a8..955eddb 100644 --- a/.gitlab/ci/rules.yml +++ b/.gitlab/ci/rules.yml @@ -30,6 +30,10 @@ - ".gitlab/ci/n1sdp-image-builds.yml" - ".gitlab/lava/n1sdp/*" +.ci-corstone1000-patterns: &ci-corstone1000-patterns + - ".gitlab/ci/corstone1000-image-builds.yml" + - ".gitlab/lava/corstone1000*/*" + .kas-common: &kas-common - "meta-cassini-config/kas/cassini.yml" - "meta-cassini-config/kas/ci.yml" @@ -51,6 +55,10 @@ - "meta-cassini-config/kas/n1sdp.yml" - "meta-cassini-config/kas/include/arm-machines.yml" +.kas-corstone1000: &kas-corstone1000 + - "meta-cassini-config/kas/corstone1000*.yml" + - "meta-cassini-config/kas/include/arm-machines.yml" + .layer-configs: &layer-configs - "meta-cassini-distro/conf/layer.conf" - "meta-cassini-bsp/conf/layer.conf" @@ -58,6 +66,7 @@ .build-common: &build-common - "meta-cassini-distro/**/*" + - "meta-cassini-bsp/**/*" - "meta-cassini-tests/classes/**/*" - "meta-cassini-tests/conf/**/*" - "meta-cassini-tests/recipes-core/**/*" @@ -82,6 +91,13 @@ - <<: *if-merge-request-or-push changes: *kas-n1sdp +.build-image:rules:corstone1000: + rules: + - <<: *if-merge-request-or-push + changes: *ci-corstone1000-patterns + - <<: *if-merge-request-or-push + changes: *kas-corstone1000 + .build-image:rules:k3s: rules: - <<: *if-merge-request-or-push diff --git a/.gitlab/ci/templates/image_build.yml.j2 b/.gitlab/ci/templates/image_build.yml.j2 index 674e60c..61f2dc3 100644 --- a/.gitlab/ci/templates/image_build.yml.j2 +++ b/.gitlab/ci/templates/image_build.yml.j2 @@ -21,6 +21,16 @@ Image-Build-{{ CI_JOB_NAME_SLUG }}: - echo "IMAGE_ARTIFACT_URL=${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/jobs/${CI_JOB_ID}/artifacts/${ARTIFACT_DIR}/$(readlink ${IMAGE}-{{ MACHINE }}.wic.gz)" >> ${CI_PROJECT_DIR}/build_data.env - echo "IMAGE=${IMAGE}" >> ${CI_PROJECT_DIR}/build_data.env - echo "ARTIFACT_DIR=${ARTIFACT_DIR}" >> ${CI_PROJECT_DIR}/build_data.env +{% if MACHINE == 'corstone1000-mps3' %} + - echo "BL1_IMAGE_ARTIFACT_URL=${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/jobs/${CI_JOB_ID}/artifacts/work/build/tmp/deploy/images/{{ MACHINE }}/bl1.bin" >> ${CI_PROJECT_DIR}/build_data.env + - echo "BL1_IMAGE=bl1.bin" >> ${CI_PROJECT_DIR}/build_data.env + - export UTIL_IMAGE=$(ls -- *-{{ MACHINE }}.tar.bz2 | sed "s/-{{ MACHINE }}\.tar\.bz2//") + - echo "UTIL_IMAGE_ARTIFACT_URL=${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/jobs/${CI_JOB_ID}/artifacts/work/build/tmp/deploy/images/{{ MACHINE }}/$(readlink ${UTIL_IMAGE}-{{ MACHINE }}.tar.bz2)" >> ${CI_PROJECT_DIR}/build_data.env + - echo "UTIL_IMAGE=${UTIL_IMAGE}" >> ${CI_PROJECT_DIR}/build_data.env + - export FW_IMAGE=$(ls -- *-{{ MACHINE }}.wic.nopt | sed "s/-{{ MACHINE }}\.wic\.nopt//") + - echo "FW_IMAGE_ARTIFACT_URL=${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/jobs/${CI_JOB_ID}/artifacts/work/build/tmp/deploy/images/{{ MACHINE }}/$(readlink ${FW_IMAGE}-{{ MACHINE }}.wic.nopt)" >> ${CI_PROJECT_DIR}/build_data.env + - echo "FW_IMAGE=${FW_IMAGE}" >> ${CI_PROJECT_DIR}/build_data.env +{% endif %} # Store built images - | ( @@ -29,7 +39,14 @@ Image-Build-{{ CI_JOB_NAME_SLUG }}: mkdir --parents ${IMAGE_DIR}/{{ CI_JOB_NAME_SLUG }} cp $(readlink ${IMAGE}-{{ MACHINE }}.wic.bmap) ${IMAGE_DIR}/{{ CI_JOB_NAME_SLUG }}/ cp $(readlink ${IMAGE}-{{ MACHINE }}.wic.bz2) ${IMAGE_DIR}/{{ CI_JOB_NAME_SLUG }}/ +{% if MACHINE == 'n1sdp' %} cp *-board-firmware_primary.tar.gz ${IMAGE_DIR}/{{ CI_JOB_NAME_SLUG }}/ +{% elif MACHINE == 'corstone1000-mps3' %} + cp bl1.bin ${IMAGE_DIR}/{{ CI_JOB_NAME_SLUG }}/ + cp $(readlink ${UTIL_IMAGE}-{{ MACHINE }}.tar.bz2) ${IMAGE_DIR}/{{ CI_JOB_NAME_SLUG }}/ + cp $(readlink ${FW_IMAGE}-{{ MACHINE }}.wic.nopt) ${IMAGE_DIR}/{{ CI_JOB_NAME_SLUG }}/ +{% else %} +{% endif %} ) 200>${IMAGE_DIR}/{{ CI_JOB_NAME_SLUG }}.lock - popd # ${KAS_WORK_DIR}/build/tmp/deploy/images/{{ MACHINE }} - chmod 777 ${CI_PROJECT_DIR}/build_data.env @@ -38,7 +55,14 @@ Image-Build-{{ CI_JOB_NAME_SLUG }}: paths: - $KAS_WORK_DIR/build/tmp/deploy/images/{{ MACHINE }}/*-*-*.wic.gz - $KAS_WORK_DIR/build/tmp/deploy/images/{{ MACHINE }}/*-*-*.wic.bmap +{% if MACHINE == 'n1sdp' %} - $KAS_WORK_DIR/build/tmp/deploy/images/{{ MACHINE }}/*-board-firmware_primary.tar.gz +{% elif MACHINE == 'corstone1000-mps3' %} + - $KAS_WORK_DIR//build/tmp/deploy/images/{{ MACHINE }}/bl1.bin + - $KAS_WORK_DIR//build/tmp/deploy/images/{{ MACHINE }}/*-*-*.wic.nopt + - $KAS_WORK_DIR//build/tmp/deploy/images/{{ MACHINE }}/*-*-*.tar.bz2 +{% else %} +{% endif %} - build_data.env reports: dotenv: build_data.env @@ -72,4 +96,21 @@ PTest-{{ CI_JOB_NAME_SLUG }}-Complete: - PTest-{{ CI_JOB_NAME_SLUG }} {% endif %} +{% set can_run = ('all' in RUN_TESTS or 'sanity' in RUN_TESTS.split(',')) %} +{% set force = ('all' in FORCE_TESTS or 'sanity' in FORCE_TESTS.split(',')) %} +{% set should_run = true %} +{% if can_run and (should_run or force) %} +Sanity-Test-{{ CI_JOB_NAME_SLUG }}: + extends: .sanity-test + needs: + - Lava-Test-Prep-{{ CI_JOB_NAME_SLUG }} + variables: + MACHINE: "{{ MACHINE }}" + +Sanity-Test-{{ CI_JOB_NAME_SLUG }}-Complete: + extends: .sanity-test-results + needs: + - Sanity-Test-{{ CI_JOB_NAME_SLUG }} +{% endif %} + {% endif %} diff --git a/.gitlab/ci/trigger-image-builds.yml b/.gitlab/ci/trigger-image-builds.yml index 26cc461..db97c3e 100644 --- a/.gitlab/ci/trigger-image-builds.yml +++ b/.gitlab/ci/trigger-image-builds.yml @@ -18,6 +18,16 @@ merge_jobs: optional: true - job: cassini-dev/security/tests/n1sdp optional: true + - job: cassini/tests/corstone1000-mps3 + optional: true + - job: cassini/security/tests/corstone1000-mps3 + optional: true + - job: cassini-sdk/corstone1000-mps3 + optional: true + - job: cassini-dev/tests/corstone1000-mps3 + optional: true + - job: cassini-dev/security/tests/corstone1000-mps3 + optional: true before_script: - | cat << EOF > ${CI_JOB_FILE} diff --git a/.gitlab/ci/yocto-qa.yml b/.gitlab/ci/yocto-qa.yml index 5c0c21e..447ce04 100644 --- a/.gitlab/ci/yocto-qa.yml +++ b/.gitlab/ci/yocto-qa.yml @@ -8,7 +8,7 @@ check-layers: extends: .kas_build_cassini script: - kas shell --update --force-checkout - meta-cassini-config/kas/n1sdp.yml:meta-cassini-config/kas/tests.yml:meta-cassini-config/kas/cassini.yml:meta-cassini-config/kas/security.yml + meta-cassini-config/kas/cassini.yml:meta-cassini-config/kas/security.yml:meta-cassini-config/kas/${MACHINE}.yml:meta-cassini-config/kas/tests.yml --command "yocto-check-layer-wrapper $CI_PROJECT_DIR/$LAYER --dependency $KAS_WORK_DIR/layers/meta-* $KAS_WORK_DIR/layers/poky/meta-poky @@ -16,6 +16,7 @@ check-layers: --no-auto-dependency" parallel: matrix: - - LAYER: [meta-cassini-distro, meta-cassini-bsp, meta-cassini-tests] + - MACHINE: [n1sdp, corstone1000-mps3] + LAYER: [meta-cassini-distro, meta-cassini-bsp, meta-cassini-tests] rules: - !reference [".layer-check:rules", rules] diff --git a/.gitlab/lava/corstone1000-mps3/sanity_job.yml.j2 b/.gitlab/lava/corstone1000-mps3/sanity_job.yml.j2 new file mode 100644 index 0000000..4a14938 --- /dev/null +++ b/.gitlab/lava/corstone1000-mps3/sanity_job.yml.j2 @@ -0,0 +1,141 @@ +# Copyright (c) 2022 Arm Limited or its affiliates. All rights reserved. +# +# SPDX-License-Identifier: MIT +--- +device_type: mps3 +job_name: {{ CI_JOB_NAME }} +timeouts: + job: + minutes: 560 + +metadata: + source: {{ CI_PROJECT_URL }} + path: .gitlab/lava/corstone1000-mps3/sanity_job.yml.j2 + gitlab-job-url: {{ CI_JOB_URL }} + +priority: medium +visibility: + group: + - cassini + +notify: + criteria: + status: finished + callbacks: + - url: "{{ CI_API_V4_URL }}/projects/{{ CI_PROJECT_ID }}/jobs/{{ TEST_COMPLETE_JOB_ID }}/play" + method: POST + token: "{{ LAVA_CALLBACK_TOKEN }}" + header: "PRIVATE-TOKEN" + dataset: minimal + +actions: + +- boot: + namespace: uart0 + method: new_connection + connection: uart0 + +- boot: + namespace: uart1 + method: new_connection + connection: uart1 + +- boot: + namespace: uart3 + method: new_connection + connection: uart3 + +# Booting the mps3 test suite +- deploy: + to: flasher + images: + recovery_image: + url: "{{ FIRMWARE_ARTIFACT }}" + namespace: target + timeout: + minutes: 5 + +# Run kernel in Flash to copy rootfs overlay to USB stick +- boot: + namespace: target + method: u-boot + timeout: + minutes: 30 + commands: + - run retrieve_kernel_load_addr + - echo Loading kernel from $kernel_addr to memory ... + - unzip $kernel_addr 0x90000000 + - loadm 0x90000000 $kernel_addr_r 0xd00000 + - bootefi $kernel_addr_r $fdtcontroladdr + auto_login: + login_prompt: 'CASSINI unstable corstone1000-mps3' + username: root + prompts: + - '(.*)corstone1000-mps3:' + +# +# Fudge to enable bmap-tool usage +# +- deploy: + namespace: poky + timeout: + minutes: 5 + to: usb + os: oe + images: + image: + url: "{{ UTIL_ARTIFACT }}" + compression: bz2 + uniquify: false + device: usb_storage_device + download: + tool: /usr/bin/wget + options: --no-check-certificate -O - {DOWNLOAD_URL} + prompt: "Connecting to .+" + writer: + tool: /bin/tar + options: -C / -xf - + prompt: 'writing to stdout' + tool: + prompts: + - 'written to stdout' + +# +# Deploy the cassini uefi image stored as artifacts by the build job +# +- deploy: + namespace: secondary_media + timeout: + minutes: 300 + to: usb + os: oe + images: + image: + url: "{{ IMAGE_ARTIFACT }}" + compression: gz + bmap: + url: "{{ BMAP_ARTIFACT }}" + uniquify: false + device: usb_storage_device + writer: + tool: /usr/bin/bmaptool + options: copy {DOWNLOAD_URL} /dev/sda + prompt: 'bmaptool: info' + tool: + prompts: ['copying time: [0-9hms\.\ ]+, copying speed [0-9\.]+ [MK]iB\/sec'] + +- boot: + namespace: secondary_media + method: minimal + timeout: + minutes: 480 + auto_login: + login_prompt: 'CASSINI unstable corstone1000-mps3 ttyAMA0' + username: cassini + login_commands: + - cassini123 + - cassini123 + prompts: + - 'New password: ' + - 'Re-enter new password: ' + - '(.*)corstone1000-mps3:' -- GitLab