From f82e6575acb6ac8e56bf30b73581ae287076552b Mon Sep 17 00:00:00 2001 From: Florian Boor Date: Sat, 2 Jun 2018 00:57:17 +0200 Subject: [PATCH] Initial layer configuration and kc BSP base files --- README | 19 +++ conf/bblayers.conf.sample | 23 ++++ conf/layer.conf | 10 ++ conf/local.conf.sample | 47 +++++++ conf/sdkdefaults.conf | 3 + setup-environment | 268 ++++++++++++++++++++++++++++++++++++++ 6 files changed, 370 insertions(+) create mode 100644 README create mode 100644 conf/bblayers.conf.sample create mode 100644 conf/layer.conf create mode 100644 conf/local.conf.sample create mode 100644 conf/sdkdefaults.conf create mode 100755 setup-environment diff --git a/README b/README new file mode 100644 index 0000000..516f1bf --- /dev/null +++ b/README @@ -0,0 +1,19 @@ +kernel concepts custom Yocto BSP +=============================== + +Supported boards +---------------- + + +Quick Start Guide +----------------- + +Once you have downloaded the source of all projects, you will have to +call: + +$: . ./setup-environment + +After this step, you will be with everything need for build an image. + +Contributing +------------ diff --git a/conf/bblayers.conf.sample b/conf/bblayers.conf.sample new file mode 100644 index 0000000..3626e66 --- /dev/null +++ b/conf/bblayers.conf.sample @@ -0,0 +1,23 @@ +POKY_BBLAYERS_CONF_VERSION = "2" + +BBPATH = "${TOPDIR}" +BSPDIR := "${@os.path.abspath(os.path.dirname(d.getVar('FILE', True)) + '/../..')}" + +BBFILES ?= "" +BBLAYERS = " \ + ${BSPDIR}/yocto/poky/meta \ + ${BSPDIR}/yocto/poky/meta-poky \ + \ + ${BSPDIR}/yocto/meta-openembedded/meta-oe \ + ${BSPDIR}/yocto/meta-openembedded/meta-multimedia \ + ${BSPDIR}/yocto/meta-openembedded/meta-filesystems \ + \ + ${BSPDIR}/yocto/meta-nodejs \ + ${BSPDIR}/yocto/meta-clang \ + ${BSPDIR}/yocto/meta-aspnet \ + ${BSPDIR}/yocto/meta-qt5 \ + \ + ${BSPDIR}/yocto/meta-kc-bsp \ + ${BSPDIR}/yocto/meta-freescale \ + ${BSPDIR}/yocto/meta-kc-karo \ +" \ No newline at end of file diff --git a/conf/layer.conf b/conf/layer.conf new file mode 100644 index 0000000..733432c --- /dev/null +++ b/conf/layer.conf @@ -0,0 +1,10 @@ +# We have a conf and classes directory, add to BBPATH +BBPATH .= ":${LAYERDIR}" + +# We have recipes-* directories, add to BBFILES +BBFILES += "${LAYERDIR}/recipes-*/*/*.bb \ + ${LAYERDIR}/recipes-*/*/*.bbappend" + +BBFILE_COLLECTIONS += "kc-bsp" +BBFILE_PATTERN_kc-bsp = "^${LAYERDIR}/" +BBFILE_PRIORITY_kc-bsp = "10" diff --git a/conf/local.conf.sample b/conf/local.conf.sample new file mode 100644 index 0000000..1675387 --- /dev/null +++ b/conf/local.conf.sample @@ -0,0 +1,47 @@ +PREFERRED_VERSION_linux-karo = "4.9.11" +PREFERRED_VERSION_imx-gpu-viv = "6.2.2.p0-aarch32" + +MACHINE = 'tx6u-8033' +#MACHINE ?= 'tx6q-1030' +DISTRO ?= 'poky' +DISTRO_FEATURES_remove = "wayland systemd x11" +DISTRO_FEATURES_append = "opengl" +PACKAGE_CLASSES ?= "package_ipk" +EXTRA_IMAGE_FEATURES ?= "debug-tweaks splash package-management hwcodecs" +IMAGE_FSTYPES = "tar.gz" +USER_CLASSES ?= "buildstats image-mklibs" +PATCHRESOLVE = "noop" +BB_DISKMON_DIRS = "\ + STOPTASKS,${TMPDIR},1G,100K \ + STOPTASKS,${DL_DIR},1G,100K \ + STOPTASKS,${SSTATE_DIR},1G,100K \ + STOPTASKS,/tmp,100M,100K \ + ABORT,${TMPDIR},100M,1K \ + ABORT,${DL_DIR},100M,1K \ + ABORT,${SSTATE_DIR},100M,1K \ + ABORT,/tmp,10M,1K" +PACKAGECONFIG_append_pn-qemu-native = " sdl" +PACKAGECONFIG_append_pn-nativesdk-qemu = " sdl" +PACKAGECONFIG_append_pn-qtdeclarative = " qtxmlpatterns" +PACKAGECONFIG_append_pn-qtbase = "accessibility qml-debug" +CONF_VERSION = "1" + +ACCEPT_FSL_EULA = "1" + +INHERIT += "archiver" +ARCHIVER_MODE[src] = "original" +ARCHIVER_MODE[diff] = "1" +ARCHIVER_MODE[recipe] = "1" +COPY_LIC_MANIFEST = "1" +COPY_LIC_DIRS = "1" +COPYLEFT_LICENSE_EXCLUDE = "None Closed Proprietory CLOSED" +COPYLEFT_RECIPE_TYPE = "target" +LICENSE_CREATE_PACKAGE = "1" + +BB_DANGLINGAPPENDS_WARNONLY = "1" + +SPLASH = "psplash-mucross" +PREFERRED_PROVIDER_virtual/psplash = "psplash-mucross" +PNBLACKLIST[fbida] = "" + +INHERIT += "rm_work" diff --git a/conf/sdkdefaults.conf b/conf/sdkdefaults.conf new file mode 100644 index 0000000..fc0726a --- /dev/null +++ b/conf/sdkdefaults.conf @@ -0,0 +1,3 @@ +TEMPLATECONF=$PWD/yocto/meta-kc-bsp/conf +MACHINE=tx6u-8033 +DISTRO=poky diff --git a/setup-environment b/setup-environment new file mode 100755 index 0000000..1b95c5a --- /dev/null +++ b/setup-environment @@ -0,0 +1,268 @@ +#!/bin/sh +# -*- mode: shell-script; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- +# +# Copyright (C) 2012, 2013, 2016 O.S. Systems Software LTDA. +# Authored-by: Otavio Salvador +# Copyright (C) 2018 kernel concepts GmbH +# +# 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. +# +# Add options for the script +# Copyright (C) 2013 Freescale Semiconductor, Inc. + +CWD=`pwd` +PROGNAME="setup-environment" + +usage() +{ + echo -e " +Usage: MACHINE= DISTRO= source $PROGNAME +Usage: source $PROGNAME + machine name + distro name + build directory + +The first usage is for creating a new build directory. In this case, the +script creates the build directory , configures it for the +specified and , and prepares the calling shell for running +bitbake on the build directory. + +The second usage is for using an existing build directory. In this case, +the script prepares the calling shell for running bitbake on the build +directory . The build directory configuration is unchanged. +" + + ls yocto/*/conf/machine/*.conf > /dev/null 2>&1 +# ls sources/meta-freescale-distro/conf/distro/fslc-*.conf > /dev/null 2>&1 + if [ $? -eq 0 ]; then + echo -e " +Supported machines: `echo; ls conf/*/conf/machine/*.conf \ +| sed s/\.conf//g | sed -r 's/^.+\///' | xargs -I% echo -e "\t%"` + +Available Poky's distros: `echo; ls yocto/poky/meta-poky/conf/distro/*.conf \ +| sed s/\.conf//g | sed -r 's/^.+\///' | xargs -I% echo -e "\t%"` + +Examples: + +- To create a new Yocto build directory: + $ MACHINE=tx6q-xxxx DISTRO=poky . $PROGNAME build + +- To use an existing Yocto build directory: + $ . $PROGNAME build +" + fi +} + +clean_up() +{ + unset EULA LIST_MACHINES VALID_MACHINE + unset CWD TEMPLATES SHORTOPTS LONGOPTS ARGS PROGNAME + unset generated_config updated + unset MACHINE SDKMACHINE DISTRO OEROOT +} + +# source default sdk configuration +if [ -e sdkdefaults.conf ]; then +. sdkdefaults.conf +fi + + +# get command line options +SHORTOPTS="h" +LONGOPTS="help" + +ARGS=$(getopt --options $SHORTOPTS \ + --longoptions $LONGOPTS --name $PROGNAME -- "$@" ) +# Print the usage menu if invalid options are specified +if [ $? != 0 -o $# -lt 1 ]; then + usage && clean_up + return 1 +fi + +eval set -- "$ARGS" +while true; +do + case $1 in + -h|--help) + usage + clean_up + return 0 + ;; + --) + shift + break + ;; + esac +done + +if [ "$(whoami)" = "root" ]; then + echo "ERROR: do not use the BSP as root. Exiting..." +fi + +if [ ! -e $1/conf/local.conf.sample ]; then + build_dir_setup_enabled="true" +else + build_dir_setup_enabled="false" +fi + +if [ "$build_dir_setup_enabled" = "true" ] && [ -z "$MACHINE" ]; then + usage + echo -e "ERROR: You must set MACHINE when creating a new build directory." + clean_up + return 1 +fi + +if [ -z "$SDKMACHINE" ]; then + SDKMACHINE='i686' +fi + +if [ "$build_dir_setup_enabled" = "true" ] && [ -z "$DISTRO" ]; then + usage + echo -e "ERROR: You must set DISTRO when creating a new build directory." + clean_up + return 1 +fi + + +OEROOT=$PWD/yocto/poky +if [ -e $PWD/yocto/oe-core ]; then + OEROOT=$PWD/yocto/oe-core +fi + +. $OEROOT/oe-init-build-env $CWD/$1 > /dev/null + +# if conf/local.conf not generated, no need to go further +if [ ! -e conf/local.conf ]; then + clean_up && return 1 +fi + +# Clean up PATH, because if it includes tokens to current directories somehow, +# wrong binaries can be used instead of the expected ones during task execution +export PATH="`echo $PATH | sed 's/\(:.\|:\)*:/:/g;s/^.\?://;s/:.\?$//'`" + +generated_config= +if [ "$build_dir_setup_enabled" = "true" ]; then + mv conf/local.conf conf/local.conf.sample + + # Generate the local.conf based on the Yocto defaults + TEMPLATES=$CWD/yocto/meta-kc-bsp/conf + grep -v '^#\|^$' conf/local.conf.sample > conf/local.conf + cat >> conf/local.conf <> conf/local.conf +elif [ -n "$EULA_ACCEPTED" ]; then + # The FSL EULA has been accepted once, so ACCEPT_FSL_EULA is set + # in local.conf. No need to do anything. + : +else + # THE FSL EULA is not set as accepted in local.conf, and EULA is + # not set in the environment, so we need to ask user if he/she + # accepts the FSL EULA: + cat <> conf/local.conf + ;; + n|N) + echo "EULA has not been accepted." + ;; + *) + REPLY= + ;; + esac + done +fi + +cat <' + +Common targets are: + core-image-minimal + meta-toolchain + meta-toolchain-sdk + adt-installer + meta-ide-support + +EOF + +if [ -n "$generated_config" ]; then + cat <