7.1.11. oe-init-build-env-memres

This script is one of two scripts that set up the OpenEmbedded build environment. Aside from setting up the environment, this script starts a memory-resident BitBake server. For information on the other setup script, see the "oe-init-build-env" section.

Memory-resident BitBake resides in memory until you specifically remove it using the following BitBake command:

     $ bitbake -m
            

Running this script with the source command in a shell makes changes to PATH and sets other core BitBake variables based on the current working directory. One of these variables is the BBSERVER variable, which allows the OpenEmbedded build system to locate the server that is running BitBake.

You need to run an environment setup script before using BitBake commands. Following is the script syntax:

     $ source oe-init-build-env-memres port_number build_dir
            

Following are some considerations when sourcing this script:

When you run this script, your Yocto Project environment is set up, a Build Directory is created, your working directory becomes the Build Directory, and you are presented with a list of common BitBake targets. Here is an example:

     $ source oe-init-build-env-memres
     No port specified, using dynamically selected port

     ### Shell environment set up for builds. ###

     You can now run 'bitbake <target>'

     Common targets are:
         core-image-minimal
         core-image-sato
         meta-toolchain
         meta-ide-support

     You can also run generated qemu images with a command like 'runqemu qemux86'
     Bitbake server address: 127.0.0.1, server port: 53995
     Bitbake server started on demand as needed, use bitbake -m to shut it down
            

The script gets its default list of common targets from the conf-notes.txt file, which is found in the meta-poky directory within the Source Directory. Should you have custom distributions, it is very easy to modify this configuration file to include your targets for your distribution. See the "Creating a Custom Template Configuration Directory" section in the Yocto Project Development Manual for more information.

By default, running this script without a Build Directory argument creates a build directory named build. If you provide a Build Directory argument and port number when you source the script, the Build Directory is created using that name. For example, the following command starts the BitBake server using port 53995 and creates a Build Directory named mybuilds that is outside of the Source Directory:

     $ source oe-init-build-env-memres 53995 ~/mybuilds
            

The oe-init-build-env-memres script starts a memory resident BitBake server. This BitBake instance uses the bitbake-cookerdaemon.log file, which is located in the Build Directory.

The OpenEmbedded build system uses the template configuration files, which are found by default in the meta-poky/conf directory in the Source Directory. See the "Creating a Custom Template Configuration Directory" section in the Yocto Project Development Manual for more information.

Note

The OpenEmbedded build system does not support file or directory names that contain spaces. If you attempt to run the oe-init-build-env-memres script from a Source Directory that contains spaces in either the filenames or directory names, the script returns an error indicating no such file or directory. Be sure to use a Source Directory free of names containing spaces.