Tango recipes for OpenEmbedded Bitbake

Hi tangoers,

for those who need a customised linux distribution including tango, here is the successfull result of my attempt with OpenEmbedded & Poky. (no apt-get required)

It has been tested with a Zedboard (xilinx zynq fpga = dual arm7 cores) (TangoTest devices). I will give a try with raspberry pi 2 and BBB asap.

you need 4 recipes (zeromq omniorb4 tango)

hope it helps…

for beginners, more info here :

attachments are omniorb4_4.1.7.bb, omniorb-native_4.1.7.bb, tango_8.1.2.bb, zeromq_3.2.5.bb 5

tango vdi for testing

(sorry I dont how to edit files name)

Poky (Yocto Project Reference Distro) 1.7 zedboard-zynq7 /dev/ttyPS0

zedboard-zynq7 login: root
root@zedboard-zynq7:~# uname -a
Linux zedboard-zynq7 3.18.0 #5 SMP PREEMPT Mon Jun 8 14:59:40 CEST 2015 armv7l GNU/Linux

root@zedboard-zynq7:~# cat /proc/cpuinfo
processor : 0
model name : ARMv7 Processor rev 0 (v7l)Features : half thumb fastmult vfp edsp neon vfpv3 tls vfpd32
CPU implementer : 0x41
CPU architecture: 7
CPU variant : 0x3
CPU part : 0xc09
CPU revision : 0

processor : 1
model name : ARMv7 Processor rev 0 (v7l)
Features : half thumb fastmult vfp edsp neon vfpv3 tls vfpd32
CPU implementer : 0x41
CPU architecture: 7
CPU variant : 0x3
CPU part : 0xc09
CPU revision : 0

Hardware : Xilinx Zynq Platform
Revision : ffffffff
Serial : 0000000000000000
root@zedboard-zynq7:~# TangoTest test1
Failed to import EventChannelFactory notifd/factory/zedboard-zynq7 from the Tango database
Ready to accept request

Sounds very interesting but I think I am missing some explanations of the intermediate steps _

Let me know if I can help you upload the files mentioned in the post.

Andy

those files are OpenEmbedded/bitbake recipes for tango, omniorb4, zmq.

OpenEmbedded is a collection of tools and recipes to build from scratch a linux embedded system.
it automatically download source code from repository, launch autoconf, cmake or anything else, then cross compile, build packages, … and generate a linux kernel, tailored for your hardware, modules, root filesystem, ext4, ext3, resiserfs, … even the bootloader

it is backed by TI,INTEL,ARM,… definitely the way to go with linux on embedded device

basically you have to install openembedded, then git clone some collections of recipes (meta : generics ones, meta-xilinx : xilinx specifics, …) edit local.conf to describe your hardware and software packages requirements (X11 or not, …)
eventually add some new recipes… It take a couple of hour (need a decent computer)… but very reliable

this is the tango recipes (easy because we use autoconf, bitbake knows what to do)

DESCRIPTION = "tango control system"
LICENSE = "GPLv3 | LGPLv3"
LIC_FILES_CHKSUM = " \
		 file://COPYING;md5=d32239bcb673463ab874e80d47fae504 \
		 file://COPYING.LESSER;md5=6a6a8e020838b23406c81b19c1d46df6 \
"
SRC_URI = "http://downloads.sourceforge.net/project/tango-cs/tango-8.1.2c.tar.gz \
file://p812_1.diff;patch=1 \
file://p812_2.diff;patch=1 \
file://p812_3.diff;patch=1 \
file://p812_4.diff;patch=1 "
SRC_URI[md5sum] = "3dbcc2cf34f8c9395ee72f4ee5ae05dc"
SRC_URI[sha256sum] = "0149e797e5745b1dd8d5d39260889b6da31c84c75c272372255ae8ca3507a116"

EXTRA_OECONF_append += "PATH=${PATH}:${STAGING_BINDIR_NATIVE}/arm-poky-linux-gnueabi/  \
--disable-dbserver \
'--with-zlib=${STAGING_DIR}' \
'OMNI_ROOT=${STAGING_DIR}/../work/armv7a-vfp-neon-poky-linux-gnueabi/omniorb4/4.1.7-r2/package/usr/' \
'ZMQ_ROOT=${STAGING_DIR}/../work/armv7a-vfp-neon-poky-linux-gnueabi/zeromq/3.2.5-r0/package/usr/' \
"
inherit autotools pkgconfig 



I will make you a demo next timeo_0

files are in attachment. we see their size but I can’t edit the file name.

[quote=“Andy”]Sounds very interesting but I think I am missing some explanations of the intermediate steps _

Let me know if I can help you upload the files mentioned in the post.

Andy[/quote]

Hi Raphael,

could you please re-upload your VM? You posted a download link to other forums for a preconfigured VM but the zip-file (2,3 GB) is corrupted.

Many thanks in advance!

Wahid

Sorry Whaid, I dont have access right now to my desktop. I will be back mid August.

The last download link to VDI disk was :

Is it the corrupted one ?
Rgds

Hi Raphael,

yes that’s the link, I downloaded it again but I’m still not able to unpack the archive…

It would be nice if you could upload it again when you are back :slight_smile:

Many Thanks,

Wahid

try this link

tell me if it is okay now …

Hi Raphael,

now it works, thank you

maybe you have some time to write your requirements/advice in this thread about the new VM
feel free to ask if you have specific needs…

http://www.tango-controls.org/community/forums/topic/74/

Hi!

Do you maybe have some tips on how to use the recipes for open-embedded/yocto? I’m trying it since a week and it is still not working with the recipes. Is there a typo in the filename: omniorb4_4.1.7.bb instead of omniorb_4.1.7.bb ?

I tested the VM and hoped your openembedded project was integrated and i could use it from your VM.
I am working on a project where a controlsystem needs to be integrated on embedded devices like the zedboard (we’re planing to develop a customized board with the Zynq Chip, but for now the Zedboard is more then we need for developing). The idea is, that we build a tailored os on the arm core running which is ready to use by plug’n’play in the control system, an automated subscription to the TangoHost / ServerIntegration is planed.

Hi Wahid

sorry for the late response …

did you read the paper :

everything is here I hope…

[quote=“wahid”]Hi!

Do you maybe have some tips on how to use the recipes for open-embedded/yocto? I’m trying it since a week and it is still not working with the recipes. Is there a typo in the filename: omniorb4_4.1.7.bb instead of omniorb_4.1.7.bb ?
[/quote]
yes, you are right it is omniorb4_4.1.7, shared on google drive here :

1)you need a linux host with 150 GB free, high speed internet access

2)install bitbake via git

3)get some extra recipes

I have on my host : (these are recipes, not all are used for our purpose)
meta
meta-oe
meta-selftest
meta-skeleton
meta-xilinx
meta-yocto
meta-yocto-bsp

  1. add tango recipes and hack zmq/omniorb as explained in the paper
    my custom recipes are in meta-skeleton/recipes-core/
    For now, I have those recipes : (redpitaya is a DeviceServer recipe for the redpitaya)
    ds omniORB4 redpitaya tango zeromq

sorry but Openembedded downloads lots of files, cross compile everything, it generates a huge vdi disk (>100GB)
can’t put it online.

there is a learning curve, but it is worth it !
keep me informed of your progress.

Where are you ? Is it for edu. or real hardware ?

Hi Raphael,

At first I want to thank you for your advices and I’m sorry if I disturb you with my annoying questions.

I have some problems with the recipes.

  • Did you write them yourself or is there a repository given? I’m asking because I was looking for the additional files the recipe for omniorb4-4.1.7.bb needs, but the only version I could find in the web is omniorb 4.1.4 and 4.2. I was looking for the patches which i have to include in the files directory.

  • What do you mean with “hack zeromq/omniorb as explained in the paper”?

  • When I use bitbake, can I still use the command: bitbake core-image-minimal ?

  • Like you said I copied the recipes into the ../meta-skeleton/recipes-core/ directory.

Let me show you my directory-tree:

/opt/tango0915/poky/meta-skeleton/
├── conf
│ ├── layer.conf
│ ├── multilib-example2.conf
│ └── multilib-example.conf
├── COPYING.MIT
├── recipes-core
│ ├── busybox
│ │ ├── busybox
│ │ │ └── no_rfkill.cfg
│ │ └── busybox_%.bbappend
│ ├── ds
│ │ └── ds_1.1.1.bb
│ ├── omniorb4
│ │ ├── files
│ │ │ ├── omniorb_4.1.7.patch
│ │ │ ├── omniORB.cfg
│ │ │ ├── omniORB-cross.patch
│ │ │ ├── omniORB_embedded_appl.patch
│ │ │ └── rm_LongDouble.patch
│ │ └── omniorb4_4.1.7.bb
│ ├── tango
│ │ ├── files
│ │ │ ├── p812_1.diff
│ │ │ ├── p812_2.diff
│ │ │ ├── p812_3.diff
│ │ │ └── p812_4.diff
│ │ └── tango_8.1.2.bb
│ └── zeromq
│ └── zeromq_3.2.5.bb
├── recipes-kernel
│ ├── hello-mod
│ │ ├── files
│ │ │ ├── COPYING
│ │ │ ├── hello.c
│ │ │ └── Makefile
│ │ └── hello-mod_0.1.bb
│ └── linux
│ ├── linux-yocto-custom
│ │ ├── 0001-linux-version-tweak.patch
│ │ ├── feature.scc
│ │ └── smp.cfg
│ └── linux-yocto-custom.bb
├── recipes-multilib
│ └── images
│ └── core-image-multilib-example.bb
└── recipes-skeleton
├── service
│ ├── service
│ │ ├── COPYRIGHT
│ │ ├── skeleton
│ │ └── skeleton_test.c
│ └── service_0.1.bb
└── useradd
├── useradd-example
│ ├── file1
│ ├── file2
│ ├── file3
│ └── file4
└── useradd-example.bb


The problem is that I can start bitbake till it gives me errors, because it can’t fetch the needed patches etc. for omniorb.

Maybe you’ll find some time to help me with this problem.

I really appreciate your help.

About me: I’m studying microelectronics / electrical engineering, working as a research student at DESY in Hamburg/Germany and doing this for my master thesis.

1)your directory tree looks correct… your are not far from goal !
and you are right, I didn’t find recipes for 4.1.7 ; I used 4.1.4 and modified it

I have checked my disk :

in directory omniORB4/files, I have these patches :
arm_double.patch omniORB.cfg rm_LongDouble.patch
dynskel.patch omniORB-cross.patch
omniorb_4.1.7.patch omniORB_embedded_appl.patch

so you need some ARM patches (I don’t remember for now where I found them…)

FYI, omniorb compiling is a 2 steps procedure (bootstrapping)
omniorb-arm (zynq target) needs omniorb-x86 (linux host)

caution
there is a little issue in this recipes
during do_install () you need to manualy copy ./tmp/work/x86_64-linux/omniorb-native/4.1.7-r0/build/bin/omniidl to ./tmp/sysroots/x86_64-linux/usr/bin/omniidl

my omniorb4_4.4.1.7.bb




DESCRIPTION = "OmniORB High Performance ORB"
SECTION = "devel"
PRIORITY = "optional"
LICENSE = "LGPL"
REQUIRES += "omniorb-native"
#rp OMNIORNB-NATIVE (no 4)
DEPENDS_virtclass-native += "python-native"
PR = "r2"

LICENSE = "GPLv3 | LGPLv3"
LIC_FILES_CHKSUM = " \
		 file://COPYING;md5=75b02c2872421380bbd47781d2bd75d3 \
"
SRC_URI = "http://downloads.sourceforge.net/project/omniorb/omniORB/omniORB-4.1.7/omniORB-4.1.7.tar.bz2;name=omniORB417tarbz \
file://omniorb_4.1.7.patch;patch=1 \ 
file://omniORB.cfg \
file://omniORB-cross.patch;patch=1 \
file://omniORB_embedded_appl.patch;patch=1 \
file://rm_LongDouble.patch;patch=1 \
"

SRC_URI[omniORB417tarbz.md5sum] = "ce8cbe25418a76a2aac5395399463362"
SRC_URI[omniORB417tarbz.sha256sum] = "2c589ae4e1d814c81f994f1c3da10afb09e3173213b870e9056162b7331e273c"

S = "${WORKDIR}/omniORB-${PV}"

FILES_${PN}-dev += "${datadir}/idl/omniORB/* ${datadir}/idl/omniORB/cos/*"
TARGET_CC_ARCH += "${LDFLAGS}"

inherit autotools pkgconfig 

do_compile () {
        export EmbeddedSystem=1
        export TOOLBINDIR=${STAGING_BINDIR_NATIVE}
	oe_runmake
}

do_compile_virtclass-native() {
        oe_runmake
}

do_install () {
        # Set a variable that the Makefiles obey for install.
        export EmbeddedSystem=1
        autotools_do_install
        install -d ${D}${sysconfdir}
        install -m 0644 ${WORKDIR}/omniORB.cfg ${D}${sysconfdir}
        install -d ${D}${localstatedir}/omninames

	#rp manualy copy ./tmp/work/x86_64-linux/omniorb-native/4.1.7-r0/build/bin/omniidl to /mnt/poky/bbblack/tmp/sysroots/x86_64-linux/usr/bin/omniidl

	#only executable libraries are stripped by the stripper
	chmod +x ${WORKDIR}/image/usr/lib/lib*
}

do_install_virtclass-native() {
        autotools_do_install

	# Ugly hack so libtool does not find native libs when building cross
	# packages We really only build this package for omniidl anyway

        rm -f  ${D}${libdir}/libomni*
}

BBCLASSEXTEND = "native"
NATIVE_INSTALL_WORKS = "1"



actually, you need this extra recipe, for the 1st stage compilation (linux omniidl tool)
omniorb-native_4.1.7.bb

in addition to omniorb4_4.1.7
(put it in the same dir, edit local.conf)

my omniorb-native


SECTION = "devel"
DEPENDS += "python-native"
PR = "r2"
LICENSE = "GPLv3 | LGPLv3"
LIC_FILES_CHKSUM = " \
		 file://COPYING;md5=75b02c2872421380bbd47781d2bd75d3 \
"

SRC_URI = "http://downloads.sourceforge.net/project/omniorb/omniORB/omniORB-4.1.7/omniORB-4.1.7.tar.bz2;name=omniORB417tarbz \
	  file://omniorb_4.1.7.patch;patch=1 \
"

SRC_URI[omniORB417tarbz.md5sum] = "ce8cbe25418a76a2aac5395399463362"
SRC_URI[omniORB417tarbz.sha256sum] = "2c589ae4e1d814c81f994f1c3da10afb09e3173213b870e9056162b7331e273c"

S = "${WORKDIR}/omniORB-${PV}"

inherit native autotools

do_compile () {
        oe_runmake
}
# Ugly hack so libtool does not find native libs when building cross packages
# We really only build this package for omniidl anyway
do_install() {
        rm -f  ${STAGING_LIBDIR_NATIVE}/libomni*
}