From af2deffa61768a72142fdba7563db18759f6bde6 Mon Sep 17 00:00:00 2001 From: Max Krummenacher Date: Tue, 5 Mar 2019 16:04:10 +0100 Subject: populate inital distro Only adds a tdx-x11 distro. Additional flavours to follow. Signed-off-by: Max Krummenacher --- COPYING.MIT | 17 +++++++++++ README | 59 ++++++++++++++++++++++++++++++++++++ conf/distro/include/arm-defaults.inc | 31 +++++++++++++++++++ conf/distro/include/tdx-base.inc | 51 +++++++++++++++++++++++++++++++ conf/distro/tdx-x11.conf | 13 ++++++++ conf/layer.conf | 13 ++++++++ 6 files changed, 184 insertions(+) create mode 100644 COPYING.MIT create mode 100644 README create mode 100644 conf/distro/include/arm-defaults.inc create mode 100644 conf/distro/include/tdx-base.inc create mode 100644 conf/distro/tdx-x11.conf create mode 100644 conf/layer.conf diff --git a/COPYING.MIT b/COPYING.MIT new file mode 100644 index 0000000..fb950dc --- /dev/null +++ b/COPYING.MIT @@ -0,0 +1,17 @@ +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/README b/README new file mode 100644 index 0000000..cfad786 --- /dev/null +++ b/README @@ -0,0 +1,59 @@ +OpenEmbedded/Yocto DISTRO Layer for Toradex Modules +=================================================== + +This layer provides the distro configuration used to build the demo BSP images +provided for ARM based Toradex computer on modules (COM). + +It follows the poky distro, but does switch to the systemd init system. + +For more information on available Toradex COMs please visit: + +https://www.toradex.com/computer-on-modules + +Dependencies +============ + +This layer depends on: + + URI: git://git.openembedded.org/bitbake + branch: 1.40 + revision: HEAD + + URI: git://git.openembedded.org/openembedded-core + layers: meta + branch: thud + revision: HEAD + + URI: git://git.yoctoproject.org/git/meta-yocto + layers: meta-poky + branch: thud + revision: HEAD + +Patches +======= + +This layer is maintained by Toradex. + +When creating a patch of the last commit, use + + git format-patch -s --subject-prefix='meta-toradex-distro][][PATCH' -1 + +To send patches, use + + git send-email --to yocto-patches@toradex.com + + +Building +======== + +See the README in either meta-toradex-nxp or meta-toradex-tegra depending on +your SoC. + +License +======= + +All metadata is MIT licensed unless otherwise stated. Source code and +binaries included in tree for individual recipes is under the LICENSE +stated in each recipe (.bb file) unless otherwise stated. + +This README document is Copyright (C) 2019 Toradex AG. diff --git a/conf/distro/include/arm-defaults.inc b/conf/distro/include/arm-defaults.inc new file mode 100644 index 0000000..87f8adb --- /dev/null +++ b/conf/distro/include/arm-defaults.inc @@ -0,0 +1,31 @@ +# This function changes the default tune for machines which +# are based on armv7a or armv7ve to use common tune value, note +# that we enforce hard-float which is default on Linux microPlatform. +# If you have one of those machines which are armv7a or armv7ve but +# can't support hard-float, please change tune = 'armv7athf' to +# tune = 'armv7at' below but then this is for your own distro. + +def arm_tune_handler(d): + features = d.getVar('TUNE_FEATURES', True).split() + if 'armv7a' in features or 'armv7ve' in features: + tune = 'armv7athf' + if 'bigendian' in features: + tune += 'b' + if 'vfpv3' in features: + tune += '-vfpv3' + if 'vfpv3d16' in features: + tune += '-vfpv3d16' + if 'neon' in features: + tune += '-neon' + if 'vfpv4' in features: + tune += '-vfpv4' + else: + tune = d.getVar('DEFAULTTUNE', True) + return tune + +DEFAULTTUNE_tdx := "${@arm_tune_handler(d)}" +DEFAULTTUNE_torizon := "${@arm_tune_handler(d)}" + +DISTRO_ARM_INSTRUCTION ?= "thumb" +DISTRO_ARM_INSTRUCTION_armv5 ?= "arm" +ARM_INSTRUCTION_SET_tdx ??= "${DISTRO_ARM_INSTRUCTION}" diff --git a/conf/distro/include/tdx-base.inc b/conf/distro/include/tdx-base.inc new file mode 100644 index 0000000..6b7457e --- /dev/null +++ b/conf/distro/include/tdx-base.inc @@ -0,0 +1,51 @@ +require conf/distro/poky.conf +require conf/distro/include/arm-defaults.inc + +DISTRO = "tdx-base" +DISTRO_NAME = "Toradex Distro Base" +DISTRO_VERSION = "2.6-snapshot-${DATE}" + +# These variables are used to set image, kernel and U-Boot versions +# increment TDX_VERMINOR in meta-toradex-demos/classes/toradex-mirrors.bbclass + +TDX_VERMAJOR = "3" +TDX_VERMINOR = "0" +TDX_VERBETA = "b1" +TDX_VERPATCH = "1" +TDX_BUILDNB ?= "" +TDX_VERNIGHTLY ?= "" +TDX_VERDATE ?= "-${DATE}" +TDX_VERDATE[vardepsexclude] = "DATE" + +TDX_VER_PACKAGE_MIN = "${TDX_VERMAJOR}.${TDX_VERMINOR}${TDX_VERBETA}${TDX_BUILDNB}${TDX_VERNIGHTLY}" +TDX_VER_PACKAGE = "${TDX_VER_PACKAGE_MIN}${TDX_VERDATE}" +TDX_VER_ITEM = "${TDX_VERMAJOR}.${TDX_VERMINOR}.${TDX_VERPATCH}" + +SDK_VENDOR = "-tdxsdk" +SDK_NAME_PREFIX = "${DISTRO}" + +MAINTAINER = "Toradex " + +TARGET_VENDOR = "-tdx" + +DISTROOVERRIDES = "tdx" + +# create etc/build/* in the rootfs +INHERIT += "image-buildinfo" + +# Log information on images and packages +INHERIT += "buildhistory" +BUILDHISTORY_COMMIT = "1" + +# Use bluez5 as default. +DISTRO_FEATURES_append = " bluez5" + +IMAGE_LINGUAS ?= "en-us" + +# TODO: review default distro features +DISTRO_FEATURES_append = " pam systemd" +DISTRO_FEATURES_remove = "sysvinit" +VIRTUAL-RUNTIME_init_manager = "systemd" +PACKAGECONFIG_append_pn-qemu-native = " libusb" + +hostname_pn-base-files = "" diff --git a/conf/distro/tdx-x11.conf b/conf/distro/tdx-x11.conf new file mode 100644 index 0000000..45bc504 --- /dev/null +++ b/conf/distro/tdx-x11.conf @@ -0,0 +1,13 @@ +# Toradex Distro with X11 without wayland. +# Using the downstream kernel flavour + +require conf/distro/include/tdx-base.inc + +DISTRO = "tdx-x11" +DISTRO_NAME = "TDX X11" + +# Remove conflicting backends. +DISTRO_FEATURES_remove = "wayland " + +# These are X11 specific +DISTRO_FEATURES_append = " x11" diff --git a/conf/layer.conf b/conf/layer.conf new file mode 100644 index 0000000..95e07ea --- /dev/null +++ b/conf/layer.conf @@ -0,0 +1,13 @@ +# We have a conf and classes directory, add to BBPATH +BBPATH .= ":${LAYERDIR}" + +# We have a packages directory, add to BBFILES +BBFILES += "${LAYERDIR}/recipes-*/*/*.bb \ + ${LAYERDIR}/recipes-*/*/*.bbappend" + +BBFILE_COLLECTIONS += "meta-toradex-distro" +BBFILE_PATTERN_meta-toradex-distro = "^${LAYERDIR}/" +BBFILE_PRIORITY_meta-toradex-distro = "6" + +LAYERDEPENDS_meta-toradex-distro = "core yocto" +LAYERSERIES_COMPAT_meta-toradex-distro = "thud" -- cgit v1.2.3