One of the areas in which OpenEmbedded helps you out is by setting various environment variables, such as CC and PATH etc, to values suitable for cross-compiling. If you wish to manually run configure scripts and compile file during development it would be nice to have all those values set for you. This is what devshell does - it provides you with an interactive shell with all the appropriate variables set for cross-compiling.
This is the newer method of obtaining a devshell and is the recommended way for most users now. The newer method requires that the devshell class be added to you configuration by inheriting it. This is usually done in your local.conf or your distributions conf file:
INHERIT += "src_distribute_local insane multimachine devshell"
With the inclusion of this class you'll find that devshell is added as a new task that you can use on recipes:
~%> bitbake -b packages/lzo/lzo_1.08.bb -c listtasks NOTE: package lzo-1.08: started NOTE: package lzo-1.08-r14: task do_listtasks: started do_devshell do_fetchall do_listtasks do_rebuild do_compile do_build do_mrproper do_fetch do_configure do_clean do_populate_staging do_package do_unpack do_install do_package_write do_distribute_sources do_showdata do_qa_staging do_qa_configure do_patch NOTE: package lzo-1.08-r14: task do_listtasks: completed NOTE: package lzo-1.08: completed
To bring up the devshell you call bitbake on a recipe and ask it for the devshell task:
~%> ./bb -b packages/lzo/lzo_1.08.bb -c devshell NOTE: package lzo-1.08: started NOTE: package lzo-1.08-r14: task do_devshell: started [... devshell will appear here ...] NOTE: package lzo-1.08-r14: task do_devshell: completed NOTE: package lzo-1.08: completed
How the devshell appears depends on the settings of the TERMCMD variable - you can see the default settings and other possible values in conf/bitbake.conf. Feel free to try settings this to something else in your local.conf. Usually you will see a new terminal window open which is the devshell window.
The devshell task is inserted after the patch task, so if you have not already run bitbake on the recipe it will download the source and apply any patches prior to opening the shell.
This method of obtaining a devshell works if you using bash as your shell, it does not work if you are using zsh as your shell. Other shells may or may not work.
The devshell addon was the original method that was used to create a devshell.
It requires no changes to your configuration, instead you simply build the devshell recipe:
and then manually startup the shell. Once in the shell you'll usually want to change into the working directory for the recipe you are working on:
~%> ./tmp/deploy/addons/sh4-linux-erouter-titan-devshell bash: alias: `./configure': invalid alias name [OE::sh4-linux-erouter-titan]:~$ cd tmp/work/lzo-1.08-r14/lzo-1.08 [OE::sh4-linux-erouter-titan]:~tmp/work/lzo-1.08-r14/lzo-1.08$
The name of the devshell addon depends on the target architecture, operating system and machine name. So you name will be different - just check for the appropriate name ending in -devshell.