diff options
10 files changed, 237 insertions, 0 deletions
diff --git a/schulung_tools/layer-building/yocto/README b/schulung_tools/layer-building/yocto/README new file mode 100644 index 0000000..56a3534 --- /dev/null +++ b/schulung_tools/layer-building/yocto/README @@ -0,0 +1,22 @@ +These are a set of scripts jogness uses to create the yocto layers for the +trainer image. These scripts are run on the trainer image. + +NOTE: This may or may not be of use to anyone other than jogness. + +get-full-eclipse-mirror.sh +- uses eclipse to mirror the eclipse and yocto repositories for eclipse + +get-git-mirrors.sh +- clones some git repos + +build-yocto.sh +- build all the recipes/tasks used in the training + +machines +- a directory containing special building for specific machines + +build-all.sh +- calls build-yocto.sh for the training machines + +make-tarballs.sh +- builds the final layer tarballs diff --git a/schulung_tools/layer-building/yocto/build-all.sh b/schulung_tools/layer-building/yocto/build-all.sh new file mode 100755 index 0000000..83562c6 --- /dev/null +++ b/schulung_tools/layer-building/yocto/build-all.sh @@ -0,0 +1,7 @@ +#!/bin/sh +set -x +set -e + +./build-yocto.sh qemux86 +./build-yocto.sh qemuarm +./build-yocto.sh vexpress diff --git a/schulung_tools/layer-building/yocto/build-yocto.sh b/schulung_tools/layer-building/yocto/build-yocto.sh new file mode 100755 index 0000000..323941e --- /dev/null +++ b/schulung_tools/layer-building/yocto/build-yocto.sh @@ -0,0 +1,56 @@ +#!/bin/bash +set -x +set -e + +test $# -eq 1 || exit 1 +test -w /home/prebuilt || exit 1 +test -w /home/downloads || exit 1 +test -d /opt/mirrors/poky.git || exit 1 + +MACHINE=$1 + +setup_extra() { + echo -n +} + +build_extra() { + echo -n +} + +test ! -f machines/$MACHINE.source || . ./machines/$MACHINE.source + +mkdir -p ~/yocto/source ~/yocto/build + +DOCHECKOUT=0 +if [ ! -d ~/yocto/source/poky ]; then + git clone -b yocto-2.5.1 /opt/mirrors/poky.git ~/yocto/source/poky + DOCHECKOUT=1 +fi +cd ~/yocto/source/poky +if [ $DOCHECKOUT -eq 1 ]; then + git checkout -b yocto-2.5.1-schulung +fi + +. ./oe-init-build-env ~/yocto/build/$MACHINE + +cp conf/local.conf.orig conf/local.conf || cp conf/local.conf conf/local.conf.orig +cat << EOF >> conf/local.conf + +MACHINE = "$MACHINE" +DL_DIR = "/home/downloads" +#BB_NO_NETWORK = "1" +PACKAGE_CLASSES = "package_ipk" +SSTATE_DIR = "/home/prebuilt/$MACHINE/sstate-cache" +EOF + +setup_extra + +bitbake meta-toolchain +bitbake meta-ide-support +bitbake core-image-minimal +bitbake -c populate_sdk core-image-minimal + +build_extra + +cp conf/bblayers.conf /home/prebuilt/$MACHINE/ +cp conf/local.conf /home/prebuilt/$MACHINE/ diff --git a/schulung_tools/layer-building/yocto/get-full-eclipse-mirror.sh b/schulung_tools/layer-building/yocto/get-full-eclipse-mirror.sh new file mode 100755 index 0000000..919f72e --- /dev/null +++ b/schulung_tools/layer-building/yocto/get-full-eclipse-mirror.sh @@ -0,0 +1,24 @@ +#!/bin/sh +set -x +set -e + +test -w /opt/mirrors || exit 1 + +ECL="/opt/eclipse/eclipse -nosplash -verbose -application" + +AM="$EARGS org.eclipse.equinox.p2.metadata.repository.mirrorApplication" +AA="$EARGS org.eclipse.equinox.p2.artifact.repository.mirrorApplication" + +P1="download.eclipse.org/releases/oxygen" +P2="download.eclipse.org/tm/updates/4.0" +P3="downloads.yoctoproject.org/releases/eclipse-plugin/2.5.1/oxygen" + +go() +{ + $ECL $AM -source http://$1 -destination file:/opt/mirrors/$1 + $ECL $AA -source http://$1 -destination file:/opt/mirrors/$1 +} + +go $P1 +go $P2 +go $P3 diff --git a/schulung_tools/layer-building/yocto/get-git-mirrors.sh b/schulung_tools/layer-building/yocto/get-git-mirrors.sh new file mode 100755 index 0000000..369c703 --- /dev/null +++ b/schulung_tools/layer-building/yocto/get-git-mirrors.sh @@ -0,0 +1,11 @@ +#!/bin/sh +set -x +set -e + +test -w /opt/mirrors || exit 1 + +cd /opt/mirrors + +git clone --mirror git://git.yoctoproject.org/poky.git +git clone --mirror git://git.yoctoproject.org/yocto-docs.git +git clone --mirror git://git.yoctoproject.org/meta-freescale.git diff --git a/schulung_tools/layer-building/yocto/machines/imx6qdlsabresd.source b/schulung_tools/layer-building/yocto/machines/imx6qdlsabresd.source new file mode 100644 index 0000000..8290e3c --- /dev/null +++ b/schulung_tools/layer-building/yocto/machines/imx6qdlsabresd.source @@ -0,0 +1,28 @@ +test -d /home/devel/meta-freescale || exit 1 + +setup_extra() { +cat << EOF >> conf/local.conf +IMAGE_FSTYPES += "wic" +EOF + +cat << 'EOF' > conf/bblayers.conf +# POKY_BBLAYERS_CONF_VERSION is increased each time build/conf/bblayers.conf +# changes incompatibly +POKY_BBLAYERS_CONF_VERSION = "2" + +BBPATH = "${TOPDIR}" +BBFILES ?= "" + +BBLAYERS ?= " \ + /home/devel/yocto/source/poky/meta \ + /home/devel/yocto/source/poky/meta-poky \ + /home/devel/yocto/source/poky/meta-yocto-bsp \ + /home/devel/meta-freescale \ + " +EOF +} + +build_extra() { +bitbake core-image-weston +bitbake -c populate_sdk core-image-weston +} diff --git a/schulung_tools/layer-building/yocto/machines/qemuarm.source b/schulung_tools/layer-building/yocto/machines/qemuarm.source new file mode 100644 index 0000000..7e8b837 --- /dev/null +++ b/schulung_tools/layer-building/yocto/machines/qemuarm.source @@ -0,0 +1,5 @@ +setup_extra() { +cat << EOF >> conf/local.conf +EXTRA_IMAGE_FEATURES = "debug-tweaks eclipse-debug" +EOF +} diff --git a/schulung_tools/layer-building/yocto/machines/qemux86.source b/schulung_tools/layer-building/yocto/machines/qemux86.source new file mode 100644 index 0000000..7e8b837 --- /dev/null +++ b/schulung_tools/layer-building/yocto/machines/qemux86.source @@ -0,0 +1,5 @@ +setup_extra() { +cat << EOF >> conf/local.conf +EXTRA_IMAGE_FEATURES = "debug-tweaks eclipse-debug" +EOF +} diff --git a/schulung_tools/layer-building/yocto/machines/vexpress.source b/schulung_tools/layer-building/yocto/machines/vexpress.source new file mode 100644 index 0000000..3f6f63d --- /dev/null +++ b/schulung_tools/layer-building/yocto/machines/vexpress.source @@ -0,0 +1,48 @@ +test -d /home/prebuilt/meta-schulung || exit 1 + +metapath=/home/devel/meta-schulung +wkspath=$metapath/scripts/lib/wic/canned-wks +bbfile=$metapath/recipes-core/busybox/busybox_1.29.3.bb + +setup_extra() { +cat << EOF >> conf/local.conf +DISTRO = "schulung" +SCHULUNG_FEATURES = "devel" +CORE_IMAGE_EXTRA_INSTALL = "hello" +#CORE_IMAGE_EXTRA_INSTALL += "simplehello" +IMAGE_FSTYPES += "wic" +EOF + +if [ ! -d $metapath ]; then + cd `dirname $metapath` + cp -a /home/prebuilt/meta-schulung . + cd - +fi + +cp $wkspath/core-image-schulung.$MACHINE.wks \ + $wkspath/core-image-minimal.$MACHINE.wks + +mv $bbfile $bbfile.orig || true + +cat << 'EOF' > conf/bblayers.conf +# POKY_BBLAYERS_CONF_VERSION is increased each time build/conf/bblayers.conf +# changes incompatibly +POKY_BBLAYERS_CONF_VERSION = "2" + +BBPATH = "${TOPDIR}" +BBFILES ?= "" + +BBLAYERS ?= " \ + /home/devel/yocto/source/poky/meta \ + /home/devel/yocto/source/poky/meta-poky \ + /home/devel/yocto/source/poky/meta-yocto-bsp \ + /home/devel/meta-schulung \ + " +EOF +} + +build_extra() { +mv $bbfile.orig $bbfile || true +bitbake core-image-schulung +bitbake -c populate_sdk core-image-schulung +} diff --git a/schulung_tools/layer-building/yocto/make-tarballs.sh b/schulung_tools/layer-building/yocto/make-tarballs.sh new file mode 100755 index 0000000..6b744dc --- /dev/null +++ b/schulung_tools/layer-building/yocto/make-tarballs.sh @@ -0,0 +1,31 @@ +#!/bin/sh +set -x +set -e + +cd / + +tar cf /home/devel/layer-mirrors-eclipse-plugins-oxygen-sumo.tar \ + opt/mirrors/download.eclipse.org \ + opt/mirrors/downloads.yoctoproject.org + +tar cf /home/devel/layer-mirrors-poky.tar \ + opt/mirrors/poky.git \ + opt/mirrors/yocto-docs.git + +tar cf /home/devel/layer-yocto-prebuilt-meta-schulung.tar \ + home/prebuilt/meta-schulung + +tar cf /home/devel/layer-yocto-prebuilt-start-vexpress.tar \ + home/prebuilt/start_vexpress.sh + +tar cf /home/devel/layer-yocto-sumo-downloads.tar \ + home/downloads + +tar cf /home/devel/layer-yocto-sumo-prebuilt-qemuarm.tar \ + home/prebuilt/qemuarm + +tar cf /home/devel/layer-yocto-sumo-prebuilt-qemux86.tar \ + home/prebuilt/qemux86 + +tar cf /home/devel/layer-yocto-sumo-prebuilt-vexpress.tar \ + home/prebuilt/vexpress |
