3 title: Initializing Your Build Environment
5 https://raw.githubusercontent.com/automotive-grade-linux/docs-sources/master/docs/getting-started/image-workflow-initialize-build-environment.md
8 <!-- WARNING: This file is generated by fetch_docs.js using /home/boron/Documents/AGL/docs-webtemplate/site/_data/tocs/getting_started/master/image-development-workflow-getting-started-book.yml -->
10 # 3. Initializing Your Build Environment
12 Part of the downloaded AGL software is a setup script that you must
13 run to initialize the build environment.
15 ## `aglsetup.sh` Script
17 You can find this script here:
20 $AGL_TOP/meta-agl/scripts/aglsetup.sh
23 The script accepts many options that allow you to define build parameters such
24 as the target hardware (i.e. the machine), build directory, and so forth.
25 Use the following commands to see the available options and script syntax:
30 $ source meta-agl/scripts/aglsetup.sh -h
33 ## AGL Machines (= board support)
35 Your target platform will be selected with the `-m` flag.
36 The MACHINE can be selected from the templates in `meta-agl/templates/machine/*`.
37 Note: This is also the place where you can add new boards.
39 Following is a list of the available machines (level of support varies!):
44 bbe # BeagleBoneEnhanced
45 beaglebone # BeagleBone
46 cubox-i # multiple i.MX6 boards
48 dra7xx-evm # TI DRA7xx-EVM 'vayu'
49 dragonboard-410c # Qualcomm Dragonboard 410c
50 dragonboard-820c # Qualcomm Dragonboard 820c
51 ebisu # Renesas RCar Ebisu
52 h3-salvator-x # Renesas RCar Salvator/H3
53 h3ulcb # Renesas RCar H3
54 h3ulcb-nogfx # Renesas RCar H3 w/o gfx blobs
56 imx6qdlsabreauto # i.MX6 sabreauto
57 intel-corei7-64 # x86-64 (Intel flavour)
58 m3ulcb # Renesas RCar M3
59 m3ulcb-nogfx # Renesas RCAR M3 w/o gfx blobs
60 nitrogen6x # i.MX6 nitrogen board
62 qemuarm64 # Qemu AArch 64 (ARM 64bit)
63 * qemux86-64 # Qemu x86-64
64 raspberrypi3 # Raspberry Pi 3
65 raspberrypi4 # Raspberry Pi 4
71 Before running the `aglsetup.sh`, you should understand what AGL features you
72 want to include as part of your image.
73 The script's help output lists available features and shows you the layers in
76 Following is a list of the available features:
81 agl-all-features :( agl-demo agl-appfw-smack agl-hmi-framework agl-profile-graphical-qt5 agl-profile-graphical agl-pipewire agl-speech-framework agl-netboot )
86 agl-ci-change-features :( agl-demo agl-appfw-smack agl-hmi-framework agl-profile-graphical-qt5 agl-profile-graphical agl-pipewire agl-speech-framework agl-devel agl-netboot agl-pipewire agl-buildstats agl-ptest )
87 agl-ci-change-features-nogfx :( agl-demo agl-appfw-smack agl-hmi-framework agl-profile-graphical-qt5 agl-profile-graphical agl-pipewire agl-speech-framework agl-devel agl-netboot agl-pipewire agl-buildstats agl-ptest )
88 agl-ci-snapshot-features :( agl-demo agl-appfw-smack agl-hmi-framework agl-profile-graphical-qt5 agl-profile-graphical agl-pipewire agl-speech-framework agl-devel agl-netboot agl-archiver agl-pipewire agl-buildstats agl-ptest )
89 agl-ci-snapshot-features-nogfx :( agl-demo agl-appfw-smack agl-hmi-framework agl-profile-graphical-qt5 agl-profile-graphical agl-pipewire agl-speech-framework agl-devel agl-netboot agl-archiver agl-pipewire agl-buildstats agl-ptest )
97 agl-profile-cluster :( agl-profile-graphical )
98 agl-profile-cluster-qt5 :( agl-profile-graphical-qt5 agl-profile-graphical )
100 agl-profile-graphical-qt5 :( agl-profile-graphical )
102 agl-profile-telematics
106 agl-virt-xen :( agl-virt )
107 [meta-agl-cluster-demo]
108 agl-cluster-demo :( agl-profile-cluster-qt5 agl-profile-graphical-qt5 agl-profile-graphical agl-hmi-framework )
109 agl-cluster-demo-preload
111 agl-cluster-demo-support :( agl-gstrecorder )
112 agl-demo :( agl-appfw-smack agl-hmi-framework agl-profile-graphical-qt5 agl-profile-graphical agl-pipewire agl-speech-framework )
114 agl-demo-soundmanager :( agl-appfw-smack agl-hmi-framework agl-profile-graphical-qt5 agl-profile-graphical agl-audio-soundmanager-framework )
117 agl-audio-soundmanager-framework
121 agl-profile-graphical-html5 :( agl-profile-graphical )
123 agl-voiceagent-alexa :( agl-speech-framework )
124 agl-voiceagent-alexa-wakeword :( agl-voiceagent-alexa agl-speech-framework )
128 [meta-agl-telematics-demo]
129 agl-telematics-demo :( agl-profile-telematics )
132 To find out exactly what a feature provides, check out the respective layer and its README.
134 An AGL feature is a configuration that accounts for specific settings
135 and dependencies needed for a particular build.
136 For example, specifying the "agl-demo" feature makes sure that the
137 `aglsetup.sh` script creates configuration files needed to build the
138 image for the AGL demo.
140 Following are brief descriptions of the AGL features you can specify on the
141 `aglsetup.sh` command line:
143 * **agl-all-features**: A set of AGL default features.
144 Do not think of this set of features as all the AGL features.
146 * **agl-appfw-smack**: Enables IoT.bzh Application Framework plus SMACK and
149 * **agl-archiver**: Enables the archiver class for releases.
151 * **agl-ci**: Flags used for Continuous Integration (CI).
152 Using this feature changes the value of the
153 [`IMAGE_FSTYPES`](https://yoctoproject.org/docs/2.4.4/ref-manual/ref-manual.html#var-IMAGE_FSTYPES)
156 * **agl-ci-change-features**: Enables features for CI builds for Gerrit changes.
158 * **agl-ci-change-features-nogfx**: Enables features for CI builds for Gerrit changes
159 for targets that use binary graphics drivers (i.e. builds without graphics).
161 * **agl-ci-snapshot-features**: Enables features for CI daily snapshot builds.
163 * **agl-ci-snapshot-features-nogfx**: Enables features for CI daily snapshot builds for
164 targets that use binary graphics drivers (i.e. builds without graphics).
166 * **agl-devel**: Activates development options such as an empty root password,
167 debuggers, strace, valgrind, and so forth.
169 * **agl-netboot**: Enables network boot support through Trivial File Transfer Protocol (TFTP) and Network Block Device (NBD) protocol.
170 Netboot is needed for CI and useful for development to avoid writing
171 sdcards. Needs additional setup.
174 * **agl-profile**: A group or set of Layers and a Package Group as used
175 by the Yocto Project.
176 This feature helps define dependency for various profiles and layers
177 used during the build.
178 For example, "agl-demo" depends on "agl-profile-graphical-qt", which
179 in turn depends on "agl-profile-graphical", which in turn depends
180 on "agl-profile-core".
182 agl-profile-graphical
183 agl-profile-graphical-html5
184 agl-profile-graphical-qt5
186 agl-profile-telematics
188 **NOTE:** For information on Package Groups, see the
189 "[Customizing Images Using Custom Package Groups](https://www.yoctoproject.org/docs/2.4.4/dev-manual/dev-manual.html#usingpoky-extend-customimage-customtasks)"
190 section in the Yocto Project Development Tasks Manual.
191 You can also find general information about Layers in the
192 "[Layers](https://www.yoctoproject.org/docs/2.4.4/dev-manual/dev-manual.html#yocto-project-layers)"
193 section in that same manual.
196 * **agl-ptest**: Enables
197 [Ptest](https://yoctoproject.org/docs/2.4.4/dev-manual/dev-manual.html#testing-packages-with-ptest)
198 as part of the build.
200 * **agl-sota**: Enables Software Over-the-Air (SOTA) components and dependencies.
201 Includes meta-updater, meta-updater-qemux86-64, meta-filesystems, and meta-python.
203 * **agl-demo**: Enables the layers meta-agl-demo and meta-qt5.
204 You need agl-demo if you are going to build the agl-demo-platform.
206 * **agl-sdl**: Enables or adds SDL to the build.
208 * **agl-pipewire**: Enables AGLs pipewire support.
210 * **agl-audio-soundmanager-framework**: Enables Soundmanager framework, which is an exclusive switch for audio framework.
212 * **agl-localdev**: Adds a local layer named "meta-localdev" in the
213 meta directory and a local.dev.inc configuration file when that file
216 This feature provides a shortcut for using the layer meta-localdev
217 in the top-level folder for easy modifications to your own recipes.
221 Following is an example that initializes the build environment, selects "beaglebone"
222 for the machine, and chooses the "agl-demo" feature, which also includes the
223 "agl-appfw-smack", "agl-devel", and "agl-hmi-framework" features:
226 $ source meta-agl/scripts/aglsetup.sh -m qemux86-64 agl-demo agl-devel
227 aglsetup.sh: Starting
228 Generating configuration files:
229 Build dir: /home/scottrif/workspace_agl/build
231 Features: agl-appfw-smack agl-demo agl-devel
232 Running /home/scottrif/workspace_agl/poky/oe-init-build-env
233 Templates dir: /home/scottrif/workspace_agl/meta-agl/templates/base
234 Config: /home/scottrif/workspace_agl/build/conf/bblayers.conf
235 Config: /home/scottrif/workspace_agl/build/conf/local.conf
236 Setup script: /home/scottrif/workspace_agl/build/conf/setup.sh
237 Executing setup script ... --- beginning of setup script
238 fragment /home/scottrif/workspace_agl/meta-agl/templates/base/01_setup_EULAfunc.sh
239 fragment /home/scottrif/workspace_agl/meta-agl/templates/base/99_setup_EULAconf.sh
242 Generating setup file: /home/scottrif/workspace_agl/build/agl-init-build-env ... OK
245 Shell environment set up for builds.
247 You can now run 'bitbake target'
250 - meta-agl: (core system)
256 agl-image-ivi-crosssdk
260 - meta-agl-demo: (demo with UI)
261 agl-demo-platform (* default demo target)
263 agl-demo-platform-crosssdk
265 agl-demo-platform-html5
269 Running the script creates the Build Directory if it does not already exist.
270 For this example, the Build Directory is "$AGL_TOP/workspace_agl/build".
272 The script's output also indicates the machine and AGL features selected for the build.
274 The script creates two primary configuration files used for the build: `local.conf` and `bblayers.conf`.
275 Both these configuration files are located in the Build Directory in the `conf` folder.
276 If you were to examine these files, you would find standard Yocto Project
277 configurations along with AGL configuration fragments, which are driven by the
278 machine (i.e. beaglebone) and the AGL features specified as part of the
279 script's command line.
281 The end result is configuration files specific for your build in the AGL development environment.
283 Finally, part of the `aglsetup.sh` script makes sure that any End User License Agreements (EULA)
285 You can see that processing in the script's output as well.
287 **NOTE:** Use of the `local.conf` and `bblayers.conf` configuration files is fundamental
288 in the Yocto Project build environment.
289 Consequently, it is fundamental in the AGL build environment.
290 You can find lots of information on configuring builds in the Yocto Project
292 Here are some references if you want to dig into configuration further:
294 * [Customizing Images Using local.conf](https://yoctoproject.org/docs/2.4.4/dev-manual/dev-manual.html#usingpoky-extend-customimage-localconf)
295 * [Local](https://yoctoproject.org/docs/2.4.4/ref-manual/ref-manual.html#ref-varlocality-config-local)
296 * [build/conf/local.conf](https://yoctoproject.org/docs/2.4.4/ref-manual/ref-manual.html#structure-build-conf-local.conf)
297 * [build/conf/bblayers.conf](https://yoctoproject.org/docs/2.4.4/ref-manual/ref-manual.html#structure-build-conf-bblayers.conf)
298 * [BBLAYERS](https://yoctoproject.org/docs/2.4.4/ref-manual/ref-manual.html#var-BBLAYERS)
299 * [User Configuration](https://yoctoproject.org/docs/2.4.4/ref-manual/ref-manual.html#user-configuration)
300 * [Enabling Your Layer](https://yoctoproject.org/docs/2.4.4/dev-manual/dev-manual.html#enabling-your-layer)