BitBake/it

From Openmoko

(Difference between revisions)
Jump to: navigation, search
m (New page: {{Languages|BitBake}} {{stub}} BitBake è uno strumento per la compilazione del codice usato da OpenEmbedded. BitBake recipes sono dei file dichiarativi, semplici da scrivere. Qui...)
 
 
(4 intermediate revisions by one user not shown)
Line 1: Line 1:
 
{{Languages|BitBake}}
 
{{Languages|BitBake}}
{{stub}}
 
  
 
BitBake è uno strumento per la compilazione del codice usato da [[OpenEmbedded]]. [[BitBake recipe]]s sono dei file dichiarativi, semplici da scrivere. Qui vedete un esempio per l'applicazione openmoko-calculator2:
 
BitBake è uno strumento per la compilazione del codice usato da [[OpenEmbedded]]. [[BitBake recipe]]s sono dei file dichiarativi, semplici da scrivere. Qui vedete un esempio per l'applicazione openmoko-calculator2:
Line 17: Line 16:
  
 
==Set Bitbake building environment==
 
==Set Bitbake building environment==
Basically, using bitbake to build your image is very easy.
+
In pratica, usare bitbake per costruire le proprie immagini è molto semplice.
* Get bitbake
+
* scaricare bitbake
* Get OpenEmbedded tree
+
* scaricare il tree di OpenEmbedded
* Set local configuare file
+
* impostare il file di configurazione in locale
* Set building environment variables.
+
* impostare le variabili d'ambiente per la compilazione
All you need is these four things. Lets assume you are using a account named '''build''', and you are working under directory '''moko'''.
+
Tutto quello di cui avete bisogno sono queste quattro semplici cose. Supponiamo qui che voi stiate usando un account chiamato '''build''', e che lavoriate nella cartella '''moko'''.
  
===Get bitbake===
+
===Scaricare bitbake===
  
 
  $cd ~/moko  # Enter the directory
 
  $cd ~/moko  # Enter the directory
 
  $git clone git://git.openmoko.org/git/bitbake.git bitbake-om  # get the bitbake of openmoko.
 
  $git clone git://git.openmoko.org/git/bitbake.git bitbake-om  # get the bitbake of openmoko.
  
Bitbake come for OpenEmbedded, however Openmoko has its own bitbake, named [http://git.openmoko.org/?p=bitbake.git;a=summary bitbake-om]. After cloning the bitbake-om, you have the kitchen comprehensive. You also need recipes to tell you how to cook.
+
Bitbake è sviluppato da OpenEmbedded, nonostante questo Openmoko ha il suo bitbake, chiamato [http://git.openmoko.org/?p=bitbake.git;a=summary bitbake-om]. Dopo aver clonato il tree di bitbake-om, vi ritroverete con una cucina nuova e pronta. A questo punto vi basterà avere delle ricette che vi dicano come cucinare per iniziare.
  
===Get OpenEmbedded tree===
+
===Scaricare il tree di OpenEmbedded===
  
 
  $git clone git://git.openmoko.org/git/openmoko.git openmoko
 
  $git clone git://git.openmoko.org/git/openmoko.git openmoko
Line 37: Line 36:
 
It will clone an [http://git.openmoko.org/?p=openmoko.git;a=summary OE tree from Openmoko git server]. This is the recipes what tell bitbake how to cook. The cloning process spend little time, get a cup of coffee is a good idea when you are waiting.
 
It will clone an [http://git.openmoko.org/?p=openmoko.git;a=summary OE tree from Openmoko git server]. This is the recipes what tell bitbake how to cook. The cloning process spend little time, get a cup of coffee is a good idea when you are waiting.
  
===Set Local configuare file===
+
===Impostare i file di configurazione===
  
 
  $install -d /home/build/moko/local/conf #create the direcotry
 
  $install -d /home/build/moko/local/conf #create the direcotry
Line 66: Line 65:
 
*TMPDIR: All of your building result will place here.
 
*TMPDIR: All of your building result will place here.
  
===Set building environment variables===
+
===Impostare le variabili d'ambiente===
  
 
  $vim build_env  # use your favorite editor
 
  $vim build_env  # use your favorite editor
Line 75: Line 74:
 
  export PATH=/home/build/moko/bitbake-om/bin:$PATH
 
  export PATH=/home/build/moko/bitbake-om/bin:$PATH
  
==Update environment==
+
==Aggiornare l'ambiente==
bitbake-om won't change often. But the OE tree (/home/build/moko/openmoko) almost change everyday. Update them is important so you can get the latest fix.
+
bitbake-om non viene cambiato molto spesso. Tuttavia il tree di OE (/home/build/moko/openmoko) cambia quasi ogni giorno. Aggiornarlo è importante se volete avere gli ultimi fix.
  
 
  $cd /home/build/moko/bitbake-om
 
  $cd /home/build/moko/bitbake-om
Line 83: Line 82:
 
  $git pull
 
  $git pull
  
==Starting use bitbake==
+
==Iniziare con bitbake==
The first time you use bitbake will spend many hours. It have to fetch every source code what you need. To build the meta toolchain, and many basic libraries like glibc.
+
La prima volta che userete bitbake potrebbe richiedere molte ore. Deve prendere tutto il codice sorgente di cui avrete bisogno. Deve costruire l'insieme di strumenti per la compilazione, e molte librerie base come glibc.
  
 
  $source /home/build/moko/build_env  #read in the environment variables.
 
  $source /home/build/moko/build_env  #read in the environment variables.
Line 90: Line 89:
 
  Playing video game for 5 hours, Watching movie for 3 hours and Sleeping for 8 hours.
 
  Playing video game for 5 hours, Watching movie for 3 hours and Sleeping for 8 hours.
  
If you wanna try something like fso image, just ask bitbake to cook another food.
+
Se volete provare a compilare qualche cosa di più impegnativo come l'immagine di fso, basterà dire a bitbake di cucinare un'altra ricetta:
  
 
  $bitbake fso-image
 
  $bitbake fso-image
  
All the recipe are placed in '''/home/build/moko/openmoko/packages'''. For example, fso-image recipe is placed in '''/home/build/moko/openmoko/packages/images/fso-image.bb'''.
+
Tutte le ricette si trovano in '''/home/build/moko/openmoko/packages'''. Per esempio, fso-image si trova in '''/home/build/moko/openmoko/packages/images/fso-image.bb'''.
  
After the building process complete, the opk files are placed in '''/home/build/moko/build/deploy/glibc/opk''', and the image is in '''/home/build/moko/build/deploy/images'''.
+
Al termine del processo di compilazione, i file opk si trovano in '''/home/build/moko/build/deploy/glibc/opk''', e le immagini in '''/home/build/moko/build/deploy/images'''.

Latest revision as of 15:16, 1 December 2008


BitBake è uno strumento per la compilazione del codice usato da OpenEmbedded. BitBake recipes sono dei file dichiarativi, semplici da scrivere. Qui vedete un esempio per l'applicazione openmoko-calculator2:

DESCRIPTION = "A Calculator for Openmoko"
SECTION = "openmoko/tools"
DEPENDS = "libmokoui2"
PV = "0.1.0+svnr${SRCREV}"
PR = "r0"
inherit openmoko2

Il manuale utente è disponibile su BitBake berlios page.

Contents

[edit] Set Bitbake building environment

In pratica, usare bitbake per costruire le proprie immagini è molto semplice.

  • scaricare bitbake
  • scaricare il tree di OpenEmbedded
  • impostare il file di configurazione in locale
  • impostare le variabili d'ambiente per la compilazione

Tutto quello di cui avete bisogno sono queste quattro semplici cose. Supponiamo qui che voi stiate usando un account chiamato build, e che lavoriate nella cartella moko.

[edit] Scaricare bitbake

$cd ~/moko  # Enter the directory
$git clone git://git.openmoko.org/git/bitbake.git bitbake-om  # get the bitbake of openmoko.

Bitbake è sviluppato da OpenEmbedded, nonostante questo Openmoko ha il suo bitbake, chiamato bitbake-om. Dopo aver clonato il tree di bitbake-om, vi ritroverete con una cucina nuova e pronta. A questo punto vi basterà avere delle ricette che vi dicano come cucinare per iniziare.

[edit] Scaricare il tree di OpenEmbedded

$git clone git://git.openmoko.org/git/openmoko.git openmoko

It will clone an OE tree from Openmoko git server. This is the recipes what tell bitbake how to cook. The cloning process spend little time, get a cup of coffee is a good idea when you are waiting.

[edit] Impostare i file di configurazione

$install -d /home/build/moko/local/conf #create the direcotry
$vim local/conf/local.conf # use your favorite editor

Paste these line into the file

ALLOW_EMPTY = "1"
BBFILES := "/home/build/moko/openmoko/packages/*/*.bb"
BB_GIT_CLONE_FOR_SRCREV = "1"
BBINCLUDELOGS = "yes"
BBMASK = ""
DISTRO = "openmoko"
DL_DIR := "/home/build/moko/sources"
EXTENDPE = ""
GLIBC_GENERATE_LOCALES = "en_US.UTF-8"
IMAGE_FSTYPES = "jffs2 tar.gz"
INHERIT += "om-utils"
MACHINE = "om-gta02"
PARALLEL_MAKE = "-j 4"
QA_LOG = "1"
TMPDIR := "/home/build/moko/build/"

Let me explain the meanings of some variables.

  • BBFILES: It tells bitbake where those recipes are.
  • DL_DIR: Bitbake fetch source code and put them here.
  • MACHINE: I build packages for gta02. If you are going to build for gta01, replace it with "om-gta01"
  • PARALLEL_MAKE: Please read the manual of "make" and search the -j option.
  • TMPDIR: All of your building result will place here.

[edit] Impostare le variabili d'ambiente

$vim build_env  # use your favorite editor

Paste these lines into the file

export BBPATH="/home/build/moko/local:/home/build/moko/openmoko"
export PATH=/home/build/moko/bitbake-om/bin:$PATH

[edit] Aggiornare l'ambiente

bitbake-om non viene cambiato molto spesso. Tuttavia il tree di OE (/home/build/moko/openmoko) cambia quasi ogni giorno. Aggiornarlo è importante se volete avere gli ultimi fix.

$cd /home/build/moko/bitbake-om
$git pull
$cd /home/build/moko/openmoko
$git pull

[edit] Iniziare con bitbake

La prima volta che userete bitbake potrebbe richiedere molte ore. Deve prendere tutto il codice sorgente di cui avrete bisogno. Deve costruire l'insieme di strumenti per la compilazione, e molte librerie base come glibc.

$source /home/build/moko/build_env  #read in the environment variables.
$bitbake helloworld # build the simplest case.
Playing video game for 5 hours, Watching movie for 3 hours and Sleeping for 8 hours.

Se volete provare a compilare qualche cosa di più impegnativo come l'immagine di fso, basterà dire a bitbake di cucinare un'altra ricetta:

$bitbake fso-image

Tutte le ricette si trovano in /home/build/moko/openmoko/packages. Per esempio, fso-image si trova in /home/build/moko/openmoko/packages/images/fso-image.bb.

Al termine del processo di compilazione, i file opk si trovano in /home/build/moko/build/deploy/glibc/opk, e le immagini in /home/build/moko/build/deploy/images.

Personal tools
Stub: This is a stub. You can help OpenMokoWiki by expanding it.


BitBake è uno strumento per la compilazione del codice usato da OpenEmbedded. BitBake recipes sono dei file dichiarativi, semplici da scrivere. Qui vedete un esempio per l'applicazione openmoko-calculator2:

DESCRIPTION = "A Calculator for Openmoko"
SECTION = "openmoko/tools"
DEPENDS = "libmokoui2"
PV = "0.1.0+svnr${SRCREV}"
PR = "r0"
inherit openmoko2

Il manuale utente è disponibile su BitBake berlios page.

Set Bitbake building environment

Basically, using bitbake to build your image is very easy.

  • Get bitbake
  • Get OpenEmbedded tree
  • Set local configuare file
  • Set building environment variables.

All you need is these four things. Lets assume you are using a account named build, and you are working under directory moko.

Get bitbake

$cd ~/moko  # Enter the directory
$git clone git://git.openmoko.org/git/bitbake.git bitbake-om  # get the bitbake of openmoko.

Bitbake come for OpenEmbedded, however Openmoko has its own bitbake, named bitbake-om. After cloning the bitbake-om, you have the kitchen comprehensive. You also need recipes to tell you how to cook.

Get OpenEmbedded tree

$git clone git://git.openmoko.org/git/openmoko.git openmoko

It will clone an OE tree from Openmoko git server. This is the recipes what tell bitbake how to cook. The cloning process spend little time, get a cup of coffee is a good idea when you are waiting.

Set Local configuare file

$install -d /home/build/moko/local/conf #create the direcotry
$vim local/conf/local.conf # use your favorite editor

Paste these line into the file

ALLOW_EMPTY = "1"
BBFILES := "/home/build/moko/openmoko/packages/*/*.bb"
BB_GIT_CLONE_FOR_SRCREV = "1"
BBINCLUDELOGS = "yes"
BBMASK = ""
DISTRO = "openmoko"
DL_DIR := "/home/build/moko/sources"
EXTENDPE = ""
GLIBC_GENERATE_LOCALES = "en_US.UTF-8"
IMAGE_FSTYPES = "jffs2 tar.gz"
INHERIT += "om-utils"
MACHINE = "om-gta02"
PARALLEL_MAKE = "-j 4"
QA_LOG = "1"
TMPDIR := "/home/build/moko/build/"

Let me explain the meanings of some variables.

  • BBFILES: It tells bitbake where those recipes are.
  • DL_DIR: Bitbake fetch source code and put them here.
  • MACHINE: I build packages for gta02. If you are going to build for gta01, replace it with "om-gta01"
  • PARALLEL_MAKE: Please read the manual of "make" and search the -j option.
  • TMPDIR: All of your building result will place here.

Set building environment variables

$vim build_env  # use your favorite editor

Paste these lines into the file

export BBPATH="/home/build/moko/local:/home/build/moko/openmoko"
export PATH=/home/build/moko/bitbake-om/bin:$PATH

Update environment

bitbake-om won't change often. But the OE tree (/home/build/moko/openmoko) almost change everyday. Update them is important so you can get the latest fix.

$cd /home/build/moko/bitbake-om
$git pull
$cd /home/build/moko/openmoko
$git pull

Starting use bitbake

The first time you use bitbake will spend many hours. It have to fetch every source code what you need. To build the meta toolchain, and many basic libraries like glibc.

$source /home/build/moko/build_env  #read in the environment variables.
$bitbake helloworld # build the simplest case.
Playing video game for 5 hours, Watching movie for 3 hours and Sleeping for 8 hours.

If you wanna try something like fso image, just ask bitbake to cook another food.

$bitbake fso-image

All the recipe are placed in /home/build/moko/openmoko/packages. For example, fso-image recipe is placed in /home/build/moko/openmoko/packages/images/fso-image.bb.

After the building process complete, the opk files are placed in /home/build/moko/build/deploy/glibc/opk, and the image is in /home/build/moko/build/deploy/images.