2

How can i write own package for recipe in arago project build? I know little bit that it can be bitbake files. But how can i write, no idea. I searched on internet, but failed to find any good source to start. can someone provide me link or example to start?

Regards
Linux Learner.

Embedded Programmer
  • 519
  • 4
  • 8
  • 22

4 Answers4

6

Create own recipe with Yocto using Bitbake:

Use Yocto Project for Embedded systems. It's documentation and support is awesome. You can get started Yocto Project.

Build your own recipe(for the first time build takes quiet good amount of time)

Getting Yocto Project:

Follow step-by-step procedure given Gumstix-YoctoProject-Repo till bitbake gumstix-console-image

Now you got yocto project on your machine. Start writing your own recipes. I will show you how to create a hello world recipe.

1) goto /yocto/poky/<create a folder as meta-robot>
2) goto /yocto/poky/meta-robot/<create a folder as /recipes-robot> and <another folder /conf>
3) goto /yocto/poky/meta-robot/recipes-robot/<create another folder /hello>
4) goto /yocto/poky/meta-robot/recipes-robot/hello/<create a file as 'hello_2.7.bb'>
5) Paste this in your hello_2.7.bb

DESCRIPTION = "GNU Helloworld application" 
SECTION = "examples" 
LICENSE = "GPLv3+" 
LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504" 
PR = "r0" 
SRC_URI[md5sum] = "fc01b05c7f943d3c42124942a2a9bb3a"
SRC_URI[sha256sum] = "fd593b5bcf6d1bb6d7d1bb7eefdccdc0010cf2c4985ccb445ef490f768b927c0"
SRC_URI = "ftp://ftp.gnu.org/gnu/hello/hello-2.7.tar.gz" 
inherit autotools gettext 

6) goto /yocto/poky/meta-robot/conf/<create a file as layer.conf>
7) paste this in your layer.conf file

# We have a conf directory, append to BBPATH
BBPATH .= ":${LAYERDIR}"

# We have a recipes directory, add to BBFILES
BBFILES += "${LAYERDIR}/recipes-*/*/*.bb ${LAYERDIR}/recipes-*/*/*.bbappend"

BBFILE_COLLECTIONS += "meta-robot"
BBFILE_PATTERN_meta-robot := "^${LAYERDIR}/"
BBFILE_PRIORITY_meta-robot = "7"

8) Open /yocto/build/conf/bblayers.conf file
9) Add your recipe folder path in bblayers file
ex: /home/xyz/yocto/poky/meta-robot \
10) open /yocto/poky/meta-gumstix-extras/recipes-images/gumstix/gumstix-console-image.bb file and under TOOLS_INSTALL add your recipe name i.e.hello \
11) Open your terminal type $ cd /yocto
12) $ source ./poky/oe-init-build-env
13) type bitbake gumstix-console-image

That's it. Your image with your own package will be ready in some time.

You can find your image in /yocto/build/tmp/deploy/images/

All the Best.

Zafrullah Syed
  • 1,170
  • 2
  • 15
  • 38
  • First of Thanks Zafrullah Syed. SRC_URI[md5sum],SRC_URI[sha256sum] have some value as you mentioned. But these value will change as i will make my own recipe. whatever, i am thinking, values are depended on data(content of files) check sum. how can i know proper value for my recipe? – Embedded Programmer Nov 08 '13 at 11:53
  • If you are recipe location is on local storage, you can directly generate md5 and sha256 values and add them to your recipe. If you are using your recipes from a remote location say github then you can download your recipe file and generate these values. or, if you are using yor own recipes you can ignore these values also by just commenting like `#LIC_FILES_CHKSUM = "file://README;md5=6ae88ed4026269f1ce69f4c800f36c2b" ` – Zafrullah Syed Nov 08 '13 at 12:28
  • How can i generate md5 and sha256? – Embedded Programmer Nov 09 '13 at 10:51
  • `$ md5sum filename ` `$ sha256 filename ` Add these two in your recipe. – Zafrullah Syed Nov 09 '13 at 14:31
2

Arago is a distribution based on OpenEmbedded project and Bitbake build tool. Logically, you should start with Bitbake manual and OpenEmbedded manual. These are slightly outdated, but still relevant in most part. After that, there is a good, simple tutorial found here.

Also I find #oe channel on FreeNode to be very useful.

EDIT: There is a newer manual for Yocto/Poky that also covers Bitbake and OpenEmbedded.

KBart
  • 1,580
  • 10
  • 18
  • Then which one the latest distributor in embedded system? – Embedded Programmer Sep 24 '13 at 07:25
  • @EmbeddedProgrammer you should choose the one based on your needs. If you use arm based hardware, Angstrom or Arago is the (probably) easiest way to go as TI itself contributes a lot to these projects. Alternative way is Poky which is more platform independent. – KBart Sep 24 '13 at 07:40
1

I think what the other guy has answered to create a new recipe is actually creating a layer.

You can do it by

$ . ./setup-environment build-dir

$ yocto-layer create custom  #here you may change the name to your custom layer name.

If you do this, it will automatically ask you to create an example recipe for you.

But I guess that's not the question.

You need to change or customize .bb file.

It has few fields namely

SOURCE_URI=" "

This is the one where you are getting the source tar file for the package.

Then do_compile = " " and do_install = " ". This may not be easy for a newbee like you and me.

Opal
  • 81,889
  • 28
  • 189
  • 210
manjunath
  • 58
  • 5
1

You can create a recipe using create-recipe or recipetool.

Check the below link for their usage

http://ashversity.blogspot.in/2016/02/creating-new-yocto-recipe.html

ashwanth selvam
  • 486
  • 3
  • 13