Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 1 | <!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" |
| 2 | "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" |
| 3 | [<!ENTITY % poky SYSTEM "../poky.ent"> %poky; ] > |
| 4 | |
| 5 | <appendix id='sdk-appendix-customizing'> |
| 6 | |
Brad Bishop | 37a0e4d | 2017-12-04 01:01:44 -0500 | [diff] [blame] | 7 | <title>Customizing the Extensible SDK</title> |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 8 | |
| 9 | <para> |
Brad Bishop | 37a0e4d | 2017-12-04 01:01:44 -0500 | [diff] [blame] | 10 | This appendix presents customizations you can apply to the extensible SDK. |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 11 | </para> |
| 12 | |
| 13 | <section id='sdk-configuring-the-extensible-sdk'> |
| 14 | <title>Configuring the Extensible SDK</title> |
| 15 | |
| 16 | <para> |
| 17 | The extensible SDK primarily consists of a pre-configured copy of |
| 18 | the OpenEmbedded build system from which it was produced. |
| 19 | Thus, the SDK's configuration is derived using that build system and |
| 20 | the following filters, which the OpenEmbedded build system applies |
| 21 | against <filename>local.conf</filename> and |
| 22 | <filename>auto.conf</filename> if they are present: |
| 23 | <itemizedlist> |
| 24 | <listitem><para> |
| 25 | Variables whose values start with "/" are excluded since the |
| 26 | assumption is that those values are paths that are likely to |
| 27 | be specific to the build host. |
| 28 | </para></listitem> |
| 29 | <listitem><para> |
| 30 | Variables listed in |
| 31 | <ulink url='&YOCTO_DOCS_REF_URL;#var-SDK_LOCAL_CONF_BLACKLIST'><filename>SDK_LOCAL_CONF_BLACKLIST</filename></ulink> |
| 32 | are excluded. |
| 33 | The default value blacklists |
| 34 | <ulink url='&YOCTO_DOCS_REF_URL;#var-CONF_VERSION'><filename>CONF_VERSION</filename></ulink>, |
| 35 | <ulink url='&YOCTO_DOCS_REF_URL;#var-BB_NUMBER_THREADS'><filename>BB_NUMBER_THREADS</filename></ulink>, |
| 36 | <ulink url='&YOCTO_DOCS_REF_URL;#var-PARALLEL_MAKE'><filename>PARALLEL_MAKE</filename></ulink>, |
| 37 | <ulink url='&YOCTO_DOCS_REF_URL;#var-PRSERV_HOST'><filename>PRSERV_HOST</filename></ulink>, |
| 38 | and |
| 39 | <ulink url='&YOCTO_DOCS_REF_URL;#var-SSTATE_MIRRORS'><filename>SSTATE_MIRRORS</filename></ulink>. |
| 40 | </para></listitem> |
| 41 | <listitem><para> |
| 42 | Variables listed in |
| 43 | <ulink url='&YOCTO_DOCS_REF_URL;#var-SDK_LOCAL_CONF_WHITELIST'><filename>SDK_LOCAL_CONF_WHITELIST</filename></ulink> |
| 44 | are included. |
| 45 | Including a variable in the value of |
| 46 | <filename>SDK_LOCAL_CONF_WHITELIST</filename> overrides either |
| 47 | of the above two conditions. |
| 48 | The default value is blank. |
| 49 | </para></listitem> |
| 50 | <listitem><para> |
| 51 | Classes inherited globally with |
| 52 | <ulink url='&YOCTO_DOCS_REF_URL;#var-INHERIT'><filename>INHERIT</filename></ulink> |
| 53 | that are listed in |
| 54 | <ulink url='&YOCTO_DOCS_REF_URL;#var-SDK_INHERIT_BLACKLIST'><filename>SDK_INHERIT_BLACKLIST</filename></ulink> |
| 55 | are disabled. |
| 56 | Using <filename>SDK_INHERIT_BLACKLIST</filename> to disable |
| 57 | these classes is is the typical method to disable classes that |
| 58 | are problematic or unnecessary in the SDK context. |
| 59 | The default value blacklists the |
| 60 | <ulink url='&YOCTO_DOCS_REF_URL;#ref-classes-buildhistory'><filename>buildhistory</filename></ulink> |
| 61 | and |
| 62 | <ulink url='&YOCTO_DOCS_REF_URL;#ref-classes-icecc'><filename>icecc</filename></ulink> |
| 63 | classes. |
| 64 | </para></listitem> |
| 65 | </itemizedlist> |
| 66 | Additionally, the contents of <filename>conf/sdk-extra.conf</filename>, |
| 67 | when present, are appended to the end of |
| 68 | <filename>conf/local.conf</filename> within the produced SDK, without |
| 69 | any filtering. |
| 70 | The <filename>sdk-extra.conf</filename> file is particularly useful |
| 71 | if you want to set a variable value just for the SDK and not the |
| 72 | OpenEmbedded build system used to create the SDK. |
| 73 | </para> |
| 74 | </section> |
| 75 | |
| 76 | <section id='adjusting-the-extensible-sdk-to-suit-your-build-system-setup'> |
| 77 | <title>Adjusting the Extensible SDK to Suit Your Build System Setup</title> |
| 78 | |
| 79 | <para> |
| 80 | In most cases, the extensible SDK defaults should work. |
| 81 | However, some cases exist for which you might consider making |
| 82 | adjustments: |
| 83 | <itemizedlist> |
| 84 | <listitem><para> |
| 85 | If your SDK configuration inherits additional classes |
| 86 | using the |
| 87 | <ulink url='&YOCTO_DOCS_REF_URL;#var-INHERIT'><filename>INHERIT</filename></ulink> |
| 88 | variable and you do not need or want those classes enabled in |
| 89 | the SDK, you can blacklist them by adding them to the |
| 90 | <ulink url='&YOCTO_DOCS_REF_URL;#var-SDK_INHERIT_BLACKLIST'><filename>SDK_INHERIT_BLACKLIST</filename></ulink> |
| 91 | variable. |
| 92 | The default value of <filename>SDK_INHERIT_BLACKLIST</filename> |
| 93 | is set using the "?=" operator. |
| 94 | Consequently, you will need to either set the complete value |
| 95 | using "=" or append the value using "_append". |
| 96 | </para></listitem> |
| 97 | <listitem><para> |
| 98 | If you have classes or recipes that add additional tasks to |
| 99 | the standard build flow (i.e. that execute as part of building |
| 100 | the recipe as opposed to needing to be called explicitly), then |
| 101 | you need to do one of the following: |
| 102 | <itemizedlist> |
| 103 | <listitem><para> |
| 104 | Ensure the tasks are shared state tasks (i.e. their |
| 105 | output is saved to and can be restored from the shared |
| 106 | state cache), or that the tasks are able to be |
| 107 | produced quickly from a task that is a shared state |
| 108 | task and add the task name to the value of |
| 109 | <ulink url='&YOCTO_DOCS_REF_URL;#var-SDK_RECRDEP_TASKS'><filename>SDK_RECRDEP_TASKS</filename></ulink>. |
| 110 | </para></listitem> |
| 111 | <listitem><para> |
| 112 | Disable the tasks if they are added by a class and |
| 113 | you do not need the functionality the class provides |
| 114 | in the extensible SDK. |
| 115 | To disable the tasks, add the class to |
| 116 | <filename>SDK_INHERIT_BLACKLIST</filename> as previously |
| 117 | described. |
| 118 | </para></listitem> |
| 119 | </itemizedlist> |
| 120 | </para></listitem> |
| 121 | <listitem><para> |
| 122 | Generally, you want to have a shared state mirror set up so |
| 123 | users of the SDK can add additional items to the SDK after |
| 124 | installation without needing to build the items from source. |
| 125 | See the |
| 126 | "<link linkend='sdk-providing-additional-installable-extensible-sdk-content'>Providing Additional Installable Extensible SDK Content</link>" |
| 127 | section for information. |
| 128 | </para></listitem> |
| 129 | <listitem><para> |
| 130 | If you want users of the SDK to be able to easily update the |
| 131 | SDK, you need to set the |
| 132 | <ulink url='&YOCTO_DOCS_REF_URL;#var-SDK_UPDATE_URL'><filename>SDK_UPDATE_URL</filename></ulink> |
| 133 | variable. |
| 134 | For more information, see the |
| 135 | "<link linkend='sdk-providing-updates-after-installing-the-extensible-sdk'>Providing Updates After Installing the Extensible SDK</link>" |
| 136 | section. |
| 137 | </para></listitem> |
| 138 | <listitem><para> |
| 139 | If you have adjusted the list of files and directories that |
| 140 | appear in |
| 141 | <ulink url='&YOCTO_DOCS_REF_URL;#var-COREBASE'><filename>COREBASE</filename></ulink> |
| 142 | (other than layers that are enabled through |
| 143 | <filename>bblayers.conf</filename>), then you must list these |
| 144 | files in |
| 145 | <ulink url='&YOCTO_DOCS_REF_URL;#var-COREBASE_FILES'><filename>COREBASE_FILES</filename></ulink> |
| 146 | so that the files are copied into the SDK. |
| 147 | </para></listitem> |
| 148 | <listitem><para> |
| 149 | If your OpenEmbedded build system setup uses a different |
| 150 | environment setup script other than |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 151 | <ulink url='&YOCTO_DOCS_REF_URL;#structure-core-script'><filename>&OE_INIT_FILE;</filename></ulink>, |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 152 | then you must set |
| 153 | <ulink url='&YOCTO_DOCS_REF_URL;#var-OE_INIT_ENV_SCRIPT'><filename>OE_INIT_ENV_SCRIPT</filename></ulink> |
| 154 | to point to the environment setup script you use. |
| 155 | <note> |
| 156 | You must also reflect this change in the value used for the |
| 157 | <filename>COREBASE_FILES</filename> variable as previously |
| 158 | described. |
| 159 | </note> |
| 160 | </para></listitem> |
| 161 | </itemizedlist> |
| 162 | </para> |
| 163 | </section> |
| 164 | |
| 165 | <section id='sdk-changing-the-appearance-of-the-extensible-sdk'> |
| 166 | <title>Changing the Appearance of the Extensible SDK</title> |
| 167 | |
| 168 | <para> |
| 169 | You can change the title shown by the SDK installer by setting the |
| 170 | <ulink url='&YOCTO_DOCS_REF_URL;#var-SDK_TITLE'><filename>SDK_TITLE</filename></ulink> |
| 171 | variable. |
| 172 | By default, this title is derived from |
| 173 | <ulink url='&YOCTO_DOCS_REF_URL;#var-DISTRO_NAME'><filename>DISTRO_NAME</filename></ulink> |
| 174 | when it is set. |
| 175 | If the <filename>DISTRO_NAME</filename> variable is not set, the title |
| 176 | is derived from the |
| 177 | <ulink url='&YOCTO_DOCS_REF_URL;#var-DISTRO'><filename>DISTRO</filename></ulink> |
| 178 | variable. |
| 179 | </para> |
| 180 | </section> |
| 181 | |
| 182 | <section id='sdk-providing-updates-after-installing-the-extensible-sdk'> |
| 183 | <title>Providing Updates After Installing the Extensible SDK</title> |
| 184 | |
| 185 | <para> |
| 186 | When you make changes to your configuration or to the metadata and |
| 187 | if you want those changes to be reflected in installed SDKs, you need |
| 188 | to perform additional steps to make it possible for those that use |
| 189 | the SDK to update their installations with the |
| 190 | <filename>devtool sdk-update</filename> command: |
| 191 | <orderedlist> |
| 192 | <listitem><para> |
| 193 | Arrange to be created a directory that can be shared over |
| 194 | HTTP or HTTPS. |
| 195 | </para></listitem> |
| 196 | <listitem><para> |
| 197 | Set the |
| 198 | <ulink url='&YOCTO_DOCS_REF_URL;#var-SDK_UPDATE_URL'><filename>SDK_UPDATE_URL</filename></ulink> |
| 199 | variable to point to the corresponding HTTP or HTTPS URL. |
| 200 | Setting this variable causes any SDK built to default to that |
| 201 | URL and thus, the user does not have to pass the URL to the |
| 202 | <filename>devtool sdk-update</filename> command. |
| 203 | </para></listitem> |
| 204 | <listitem><para> |
| 205 | Build the extensible SDK normally (i.e., use the |
| 206 | <filename>bitbake -c populate_sdk_ext</filename> <replaceable>imagename</replaceable> |
| 207 | command). |
| 208 | </para></listitem> |
| 209 | <listitem><para> |
| 210 | Publish the SDK using the following command: |
| 211 | <literallayout class='monospaced'> |
| 212 | $ oe-publish-sdk <replaceable>some_path</replaceable>/sdk-installer.sh <replaceable>path_to_shared/http_directory</replaceable> |
| 213 | </literallayout> |
| 214 | You must repeat this step each time you rebuild the SDK |
| 215 | with changes that you want to make available through the |
| 216 | update mechanism. |
| 217 | </para></listitem> |
| 218 | </orderedlist> |
| 219 | </para> |
| 220 | |
| 221 | <para> |
| 222 | Completing the above steps allows users of the existing SDKs to |
| 223 | simply run <filename>devtool sdk-update</filename> to retrieve the |
| 224 | latest updates. |
| 225 | See the |
| 226 | "<link linkend='sdk-updating-the-extensible-sdk'>Updating the Extensible SDK</link>" |
| 227 | section for further information. |
| 228 | </para> |
| 229 | </section> |
| 230 | |
| 231 | <section id='sdk-providing-additional-installable-extensible-sdk-content'> |
| 232 | <title>Providing Additional Installable Extensible SDK Content</title> |
| 233 | |
| 234 | <para> |
| 235 | If you want the users of the extensible SDK you are building to be |
| 236 | able to add items to the SDK without needing to build the |
| 237 | items from source, you need to do a number of things: |
| 238 | <orderedlist> |
| 239 | <listitem><para> |
| 240 | Ensure the additional items you want the user to be able to |
| 241 | install are actually built. |
| 242 | You can ensure these items are built a number of different |
| 243 | ways: 1) Build them explicitly, perhaps using one or more |
| 244 | "meta" recipes that depend on lists of other recipes to keep |
| 245 | things tidy, or 2) Build the "world" target and set |
| 246 | <filename>EXCLUDE_FROM_WORLD_pn-</filename><replaceable>recipename</replaceable> |
| 247 | for the recipes you do not want built. |
| 248 | See the |
| 249 | <ulink url='&YOCTO_DOCS_REF_URL;#var-EXCLUDE_FROM_WORLD'><filename>EXCLUDE_FROM_WORLD</filename></ulink> |
| 250 | variable for additional information. |
| 251 | </para></listitem> |
| 252 | <listitem><para> |
| 253 | Expose the <filename>sstate-cache</filename> directory |
| 254 | produced by the build. |
| 255 | Typically, you expose this directory over HTTP or HTTPS. |
| 256 | </para></listitem> |
| 257 | <listitem><para> |
| 258 | Set the appropriate configuration so that the produced SDK |
| 259 | knows how to find the configuration. |
| 260 | The variable you need to set is |
| 261 | <ulink url='&YOCTO_DOCS_REF_URL;#var-SSTATE_MIRRORS'><filename>SSTATE_MIRRORS</filename></ulink>: |
| 262 | <literallayout class='monospaced'> |
| 263 | SSTATE_MIRRORS = "file://.* http://<replaceable>example</replaceable>.com/<replaceable>some_path</replaceable>/sstate-cache/PATH" |
| 264 | </literallayout> |
| 265 | You can set the <filename>SSTATE_MIRRORS</filename> variable |
| 266 | in two different places: |
| 267 | <itemizedlist> |
| 268 | <listitem><para> |
| 269 | If the mirror value you are setting is appropriate to |
| 270 | be set for both the OpenEmbedded build system that is |
| 271 | actually building the SDK and the SDK itself (i.e. the |
| 272 | mirror is accessible in both places or it will fail |
| 273 | quickly on the OpenEmbedded build system side, and its |
| 274 | contents will not interfere with the build), then you |
| 275 | can set the variable in your |
| 276 | <filename>local.conf</filename> or custom distro |
| 277 | configuration file. |
| 278 | You can then "whitelist" the variable through |
| 279 | to the SDK by adding the following: |
| 280 | <literallayout class='monospaced'> |
| 281 | SDK_LOCAL_CONF_WHITELIST = "SSTATE_MIRRORS" |
| 282 | </literallayout> |
| 283 | </para></listitem> |
| 284 | <listitem><para> |
| 285 | Alternatively, if you just want to set the |
| 286 | <filename>SSTATE_MIRRORS</filename> variable's value |
| 287 | for the SDK alone, create a |
| 288 | <filename>conf/sdk-extra.conf</filename> either in |
| 289 | your |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 290 | <ulink url='&YOCTO_DOCS_REF_URL;#build-directory'>Build Directory</ulink> |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 291 | or within any layer and put your |
| 292 | <filename>SSTATE_MIRRORS</filename> setting within |
| 293 | that file. |
| 294 | <note> |
| 295 | This second option is the safest option should |
| 296 | you have any doubts as to which method to use when |
| 297 | setting <filename>SSTATE_MIRRORS</filename>. |
| 298 | </note> |
| 299 | </para></listitem> |
| 300 | </itemizedlist> |
| 301 | </para></listitem> |
| 302 | </orderedlist> |
| 303 | </para> |
| 304 | </section> |
| 305 | |
| 306 | <section id='sdk-minimizing-the-size-of-the-extensible-sdk-installer-download'> |
| 307 | <title>Minimizing the Size of the Extensible SDK Installer Download</title> |
| 308 | |
| 309 | <para> |
| 310 | By default, the extensible SDK bundles the shared state artifacts for |
| 311 | everything needed to reconstruct the image for which the SDK was built. |
| 312 | This bundling can lead to an SDK installer file that is a Gigabyte or |
| 313 | more in size. |
| 314 | If the size of this file causes a problem, you can build an SDK that |
| 315 | has just enough in it to install and provide access to the |
| 316 | <filename>devtool command</filename> by setting the following in your |
| 317 | configuration: |
| 318 | <literallayout class='monospaced'> |
| 319 | SDK_EXT_TYPE = "minimal" |
| 320 | </literallayout> |
| 321 | Setting |
| 322 | <ulink url='&YOCTO_DOCS_REF_URL;#var-SDK_EXT_TYPE'><filename>SDK_EXT_TYPE</filename></ulink> |
| 323 | to "minimal" produces an SDK installer that is around 35 Mbytes in |
| 324 | size, which downloads and installs quickly. |
| 325 | You need to realize, though, that the minimal installer does not |
| 326 | install any libraries or tools out of the box. |
| 327 | These must be installed either "on the fly" or through actions you |
| 328 | perform using <filename>devtool</filename> or explicitly with the |
| 329 | <filename>devtool sdk-install</filename> command. |
| 330 | </para> |
| 331 | |
| 332 | <para> |
| 333 | In most cases, when building a minimal SDK you will need to also enable |
| 334 | bringing in the information on a wider range of packages produced by |
| 335 | the system. |
| 336 | This is particularly true so that <filename>devtool add</filename> |
| 337 | is able to effectively map dependencies it discovers in a source tree |
| 338 | to the appropriate recipes. |
| 339 | Also so that the <filename>devtool search</filename> command |
| 340 | is able to return useful results. |
| 341 | </para> |
| 342 | |
| 343 | <para> |
| 344 | To facilitate this wider range of information, you would additionally |
| 345 | set the following: |
| 346 | <literallayout class='monospaced'> |
| 347 | SDK_INCLUDE_PKGDATA = "1" |
| 348 | </literallayout> |
| 349 | See the |
| 350 | <ulink url='&YOCTO_DOCS_REF_URL;#var-SDK_INCLUDE_PKGDATA'><filename>SDK_INCLUDE_PKGDATA</filename></ulink> |
| 351 | variable for additional information. |
| 352 | </para> |
| 353 | |
| 354 | <para> |
| 355 | Setting the <filename>SDK_INCLUDE_PKGDATA</filename> variable as |
| 356 | shown causes the "world" target to be built so that information |
| 357 | for all of the recipes included within it are available. |
| 358 | Having these recipes available increases build time significantly and |
| 359 | increases the size of the SDK installer by 30-80 Mbytes depending on |
| 360 | how many recipes are included in your configuration. |
| 361 | </para> |
| 362 | |
| 363 | <para> |
| 364 | You can use |
| 365 | <filename>EXCLUDE_FROM_WORLD_pn-</filename><replaceable>recipename</replaceable> |
| 366 | for recipes you want to exclude. |
| 367 | However, it is assumed that you would need to be building the "world" |
| 368 | target if you want to provide additional items to the SDK. |
| 369 | Consequently, building for "world" should not represent undue |
| 370 | overhead in most cases. |
| 371 | <note> |
| 372 | If you set <filename>SDK_EXT_TYPE</filename> to "minimal", |
| 373 | then providing a shared state mirror is mandatory so that items |
| 374 | can be installed as needed. |
| 375 | See the |
| 376 | "<link linkend='sdk-providing-additional-installable-extensible-sdk-content'>Providing Additional Installable Extensible SDK Content</link>" |
| 377 | section for more information. |
| 378 | </note> |
| 379 | </para> |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 380 | |
| 381 | <para> |
| 382 | You can explicitly control whether or not to include the toolchain |
| 383 | when you build an SDK by setting the |
| 384 | <ulink url='&YOCTO_DOCS_REF_URL;#var-SDK_INCLUDE_TOOLCHAIN'><filename>SDK_INCLUDE_TOOLCHAIN</filename></ulink> |
| 385 | variable to "1". |
| 386 | In particular, it is useful to include the toolchain when you |
| 387 | have set <filename>SDK_EXT_TYPE</filename> to |
| 388 | "minimal", which by default, excludes the toolchain. |
| 389 | Also, it is helpful if you are building a small SDK for use with |
| 390 | an IDE, such as Eclipse, or some other tool where you do not want |
| 391 | to take extra steps to install a toolchain. |
| 392 | </para> |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 393 | </section> |
| 394 | </appendix> |
| 395 | <!-- |
| 396 | vim: expandtab tw=80 ts=4 |
| 397 | --> |