How to write own package for recipe in arago proje

2019-05-21 10:19发布

问题:

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.

回答1:

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.



回答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.



回答3:

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.



回答4:

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