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-obtain'> |
| 6 | |
| 7 | <title>Obtaining the SDK</title> |
| 8 | |
| 9 | <section id='sdk-locating-pre-built-sdk-installers'> |
| 10 | <title>Locating Pre-Built SDK Installers</title> |
| 11 | |
| 12 | <para> |
| 13 | You can use existing, pre-built toolchains by locating and running |
| 14 | an SDK installer script that ships with the Yocto Project. |
| 15 | Using this method, you select and download an architecture-specific |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 16 | SDK installer and then run the script to hand-install the |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 17 | toolchain. |
| 18 | </para> |
| 19 | |
| 20 | <para> |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 21 | Follow these steps to locate and hand-install the toolchain: |
| 22 | <orderedlist> |
| 23 | <listitem><para> |
| 24 | <emphasis>Go to the Installers Directory:</emphasis> |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 25 | Go to <ulink url='&YOCTO_TOOLCHAIN_DL_URL;'></ulink> |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 26 | </para></listitem> |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 27 | <listitem><para> |
Brad Bishop | d5ae7d9 | 2018-06-14 09:52:03 -0700 | [diff] [blame] | 28 | <emphasis>Open the Folder for Your Build Host:</emphasis> |
| 29 | Open the folder that matches your |
| 30 | <ulink url='&YOCTO_DOCS_REF_URL;#build-system-term'>build host</ulink> |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 31 | (i.e. <filename>i686</filename> for 32-bit machines or |
| 32 | <filename>x86_64</filename> for 64-bit machines). |
| 33 | </para></listitem> |
| 34 | <listitem><para> |
| 35 | <emphasis>Locate and Download the SDK Installer:</emphasis> |
| 36 | You need to find and download the installer appropriate for |
Brad Bishop | d5ae7d9 | 2018-06-14 09:52:03 -0700 | [diff] [blame] | 37 | your build host, target hardware, and image type. |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 38 | </para> |
| 39 | |
| 40 | <para>The installer files (<filename>*.sh</filename>) follow |
| 41 | this naming convention: |
| 42 | <literallayout class='monospaced'> |
Brad Bishop | d5ae7d9 | 2018-06-14 09:52:03 -0700 | [diff] [blame] | 43 | poky-glibc-<replaceable>host_system</replaceable>-core-image-<replaceable>type</replaceable>-<replaceable>arch</replaceable>-toolchain[-ext]-<replaceable>release</replaceable>.sh |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 44 | |
| 45 | Where: |
| 46 | <replaceable>host_system</replaceable> is a string representing your development system: |
Brad Bishop | d5ae7d9 | 2018-06-14 09:52:03 -0700 | [diff] [blame] | 47 | "i686" or "x86_64" |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 48 | |
Brad Bishop | d5ae7d9 | 2018-06-14 09:52:03 -0700 | [diff] [blame] | 49 | <replaceable>type</replaceable> is a string representing the image: |
| 50 | "sato" or "minimal" |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 51 | |
| 52 | <replaceable>arch</replaceable> is a string representing the target architecture: |
Brad Bishop | d5ae7d9 | 2018-06-14 09:52:03 -0700 | [diff] [blame] | 53 | "aarch64", "armv5e", "core2-64", "coretexa8hf-neon", "i586", "mips32r2", |
| 54 | "mips64", or "ppc7400" |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 55 | |
| 56 | <replaceable>release</replaceable> is the version of Yocto Project. |
| 57 | |
| 58 | NOTE: |
| 59 | The standard SDK installer does not have the "-ext" string as |
| 60 | part of the filename. |
| 61 | |
| 62 | </literallayout> |
| 63 | The toolchains provided by the Yocto Project are based off of |
| 64 | the <filename>core-image-sato</filename> and |
| 65 | <filename>core-image-minimal</filename> images and contain |
| 66 | libraries appropriate for developing against those images. |
| 67 | </para> |
| 68 | |
Brad Bishop | d5ae7d9 | 2018-06-14 09:52:03 -0700 | [diff] [blame] | 69 | <para>For example, if your build host is a 64-bit x86 system |
| 70 | and you need an extended SDK for a 64-bit core2 target, go |
| 71 | into the <filename>x86_64</filename> folder and download the |
| 72 | following installer: |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 73 | <literallayout class='monospaced'> |
| 74 | poky-glibc-x86_64-core-image-sato-core2-64-toolchain-ext-&DISTRO;.sh |
| 75 | </literallayout> |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 76 | </para></listitem> |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 77 | <listitem><para> |
| 78 | <emphasis>Run the Installer:</emphasis> |
| 79 | Be sure you have execution privileges and run the installer. |
| 80 | Following is an example from the <filename>Downloads</filename> |
| 81 | directory: |
| 82 | <literallayout class='monospaced'> |
| 83 | $ ~/Downloads/poky-glibc-x86_64-core-image-sato-core2-64-toolchain-ext-&DISTRO;.sh |
| 84 | </literallayout> |
| 85 | During execution of the script, you choose the root location |
| 86 | for the toolchain. |
| 87 | See the |
| 88 | "<link linkend='sdk-installed-standard-sdk-directory-structure'>Installed Standard SDK Directory Structure</link>" |
| 89 | section and the |
| 90 | "<link linkend='sdk-installed-extensible-sdk-directory-structure'>Installed Extensible SDK Directory Structure</link>" |
| 91 | section for more information. |
| 92 | </para></listitem> |
| 93 | </orderedlist> |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 94 | </para> |
| 95 | </section> |
| 96 | |
| 97 | <section id='sdk-building-an-sdk-installer'> |
| 98 | <title>Building an SDK Installer</title> |
| 99 | |
| 100 | <para> |
Brad Bishop | d5ae7d9 | 2018-06-14 09:52:03 -0700 | [diff] [blame] | 101 | As an alternative to locating and downloading an SDK installer, |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 102 | you can build the SDK installer. |
| 103 | Follow these steps: |
| 104 | <orderedlist> |
| 105 | <listitem><para> |
| 106 | <emphasis>Set Up the Build Environment:</emphasis> |
| 107 | Be sure you are set up to use BitBake in a shell. |
| 108 | See the |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 109 | "<ulink url='&YOCTO_DOCS_DEV_URL;#dev-preparing-the-build-host'>Preparing the Build Host</ulink>" |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 110 | section in the Yocto Project Development Tasks Manual for |
| 111 | information on how to get a build host ready that is either a |
| 112 | native Linux machine or a machine that uses CROPS. |
| 113 | </para></listitem> |
| 114 | <listitem><para> |
| 115 | <emphasis>Clone the <filename>poky</filename> Repository:</emphasis> |
| 116 | You need to have a local copy of the Yocto Project |
| 117 | <ulink url='&YOCTO_DOCS_REF_URL;#source-directory'>Source Directory</ulink> |
| 118 | (i.e. a local <filename>poky</filename> repository). |
| 119 | See the |
| 120 | "<ulink url='&YOCTO_DOCS_DEV_URL;#cloning-the-poky-repository'>Cloning the <filename>poky</filename> Repository</ulink>" |
| 121 | and possibly the |
| 122 | "<ulink url='&YOCTO_DOCS_DEV_URL;#checking-out-by-branch-in-poky'>Checking Out by Branch in Poky</ulink>" |
| 123 | and |
| 124 | "<ulink url='&YOCTO_DOCS_DEV_URL;#checkout-out-by-tag-in-poky'>Checking Out by Tag in Poky</ulink>" |
| 125 | sections all in the Yocto Project Development Tasks Manual for |
| 126 | information on how to clone the <filename>poky</filename> |
| 127 | repository and check out the appropriate branch for your work. |
| 128 | </para></listitem> |
| 129 | <listitem><para> |
| 130 | <emphasis>Initialize the Build Environment:</emphasis> |
| 131 | While in the root directory of the Source Directory (i.e. |
| 132 | <filename>poky</filename>), run the |
| 133 | <ulink url='&YOCTO_DOCS_REF_URL;#structure-core-script'><filename>&OE_INIT_FILE;</filename></ulink> |
| 134 | environment setup script to define the OpenEmbedded |
| 135 | build environment on your build host. |
| 136 | <literallayout class='monospaced'> |
| 137 | $ source &OE_INIT_FILE; |
| 138 | </literallayout> |
| 139 | Among other things, the script creates the |
| 140 | <ulink url='&YOCTO_DOCS_REF_URL;#build-directory'>Build Directory</ulink>, |
| 141 | which is <filename>build</filename> in this case |
Brad Bishop | d5ae7d9 | 2018-06-14 09:52:03 -0700 | [diff] [blame] | 142 | and is located in the Source Directory. |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 143 | After the script runs, your current working directory |
| 144 | is set to the <filename>build</filename> directory. |
| 145 | </para></listitem> |
| 146 | <listitem><para> |
| 147 | <emphasis>Make Sure You Are Building an Installer for the Correct Machine:</emphasis> |
| 148 | Check to be sure that your |
| 149 | <ulink url='&YOCTO_DOCS_REF_URL;#var-MACHINE'><filename>MACHINE</filename></ulink> |
| 150 | variable in the <filename>local.conf</filename> file in your |
Brad Bishop | d5ae7d9 | 2018-06-14 09:52:03 -0700 | [diff] [blame] | 151 | Build Directory matches the architecture for which you are |
| 152 | building. |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 153 | </para></listitem> |
| 154 | <listitem><para> |
| 155 | <emphasis>Make Sure Your SDK Machine is Correctly Set:</emphasis> |
| 156 | If you are building a toolchain designed to run on an |
| 157 | architecture that differs from your current development host |
Brad Bishop | d5ae7d9 | 2018-06-14 09:52:03 -0700 | [diff] [blame] | 158 | machine (i.e. the build host), be sure that the |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 159 | <ulink url='&YOCTO_DOCS_REF_URL;#var-SDKMACHINE'><filename>SDKMACHINE</filename></ulink> |
| 160 | variable in the <filename>local.conf</filename> file in your |
| 161 | Build Directory is correctly set. |
Brad Bishop | d5ae7d9 | 2018-06-14 09:52:03 -0700 | [diff] [blame] | 162 | <note> |
| 163 | If you are building an SDK installer for the Extensible |
| 164 | SDK, the <filename>SDKMACHINE</filename> value must be |
| 165 | set for the architecture of the machine you are using to |
| 166 | build the installer. |
| 167 | If <filename>SDKMACHINE</filename> is not set appropriately, |
| 168 | the build fails and provides an error message similar to |
| 169 | the following: |
| 170 | <literallayout class='monospaced'> |
| 171 | The extensible SDK can currently only be built for the same architecture as the machine being built on - SDK_ARCH is |
| 172 | set to i686 (likely via setting SDKMACHINE) which is different from the architecture of the build machine (x86_64). |
| 173 | Unable to continue. |
| 174 | </literallayout> |
| 175 | </note> |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 176 | </para></listitem> |
| 177 | <listitem><para> |
| 178 | <emphasis>Build the SDK Installer:</emphasis> |
| 179 | To build the SDK installer for a standard SDK and populate |
| 180 | the SDK image, use the following command form. |
| 181 | Be sure to replace <replaceable>image</replaceable> with |
| 182 | an image (e.g. "core-image-sato"): |
| 183 | <literallayout class='monospaced'> |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 184 | $ bitbake <replaceable>image</replaceable> -c populate_sdk |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 185 | </literallayout> |
| 186 | You can do the same for the extensible SDK using this command |
| 187 | form: |
| 188 | <literallayout class='monospaced'> |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 189 | $ bitbake <replaceable>image</replaceable> -c populate_sdk_ext |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 190 | </literallayout> |
Brad Bishop | d5ae7d9 | 2018-06-14 09:52:03 -0700 | [diff] [blame] | 191 | These commands produce an SDK installer that contains the |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 192 | sysroot that matches your target root filesystem.</para> |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 193 | |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 194 | <para>When the <filename>bitbake</filename> command completes, |
| 195 | the SDK installer will be in |
| 196 | <filename>tmp/deploy/sdk</filename> in the Build Directory. |
| 197 | <note><title>Notes</title> |
| 198 | <itemizedlist> |
| 199 | <listitem><para> |
Brad Bishop | d5ae7d9 | 2018-06-14 09:52:03 -0700 | [diff] [blame] | 200 | By default, the previous BitBake command does not |
| 201 | build static binaries. |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 202 | If you want to use the toolchain to build these |
| 203 | types of libraries, you need to be sure your SDK |
| 204 | has the appropriate static development libraries. |
| 205 | Use the |
| 206 | <ulink url='&YOCTO_DOCS_REF_URL;#var-TOOLCHAIN_TARGET_TASK'><filename>TOOLCHAIN_TARGET_TASK</filename></ulink> |
| 207 | variable inside your <filename>local.conf</filename> |
Brad Bishop | d5ae7d9 | 2018-06-14 09:52:03 -0700 | [diff] [blame] | 208 | file before building the SDK installer. |
| 209 | Doing so ensures that the eventual SDK installation |
| 210 | process installs the appropriate library packages |
| 211 | as part of the SDK. |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 212 | Following is an example using |
| 213 | <filename>libc</filename> static development |
| 214 | libraries: |
| 215 | <literallayout class='monospaced'> |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 216 | TOOLCHAIN_TARGET_TASK_append = " libc-staticdev" |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 217 | </literallayout> |
| 218 | </para></listitem> |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 219 | </itemizedlist> |
| 220 | </note> |
| 221 | </para></listitem> |
| 222 | <listitem><para> |
| 223 | <emphasis>Run the Installer:</emphasis> |
| 224 | You can now run the SDK installer from |
| 225 | <filename>tmp/deploy/sdk</filename> in the Build Directory. |
| 226 | Following is an example: |
| 227 | <literallayout class='monospaced'> |
| 228 | $ cd ~/poky/build/tmp/deploy/sdk |
| 229 | $ ./poky-glibc-x86_64-core-image-sato-core2-64-toolchain-ext-&DISTRO;.sh |
| 230 | </literallayout> |
| 231 | During execution of the script, you choose the root location |
| 232 | for the toolchain. |
| 233 | See the |
| 234 | "<link linkend='sdk-installed-standard-sdk-directory-structure'>Installed Standard SDK Directory Structure</link>" |
| 235 | section and the |
| 236 | "<link linkend='sdk-installed-extensible-sdk-directory-structure'>Installed Extensible SDK Directory Structure</link>" |
| 237 | section for more information. |
| 238 | </para></listitem> |
| 239 | </orderedlist> |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 240 | </para> |
| 241 | </section> |
| 242 | |
| 243 | <section id='sdk-extracting-the-root-filesystem'> |
| 244 | <title>Extracting the Root Filesystem</title> |
| 245 | |
| 246 | <para> |
| 247 | After installing the toolchain, for some use cases you |
| 248 | might need to separately extract a root filesystem: |
| 249 | <itemizedlist> |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 250 | <listitem><para> |
| 251 | You want to boot the image using NFS. |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 252 | </para></listitem> |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 253 | <listitem><para> |
| 254 | You want to use the root filesystem as the |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 255 | target sysroot. |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 256 | </para></listitem> |
| 257 | <listitem><para> |
| 258 | You want to develop your target application |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 259 | using the root filesystem as the target sysroot. |
| 260 | </para></listitem> |
| 261 | </itemizedlist> |
| 262 | </para> |
| 263 | |
| 264 | <para> |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 265 | Follow these steps to extract the root filesystem: |
| 266 | <orderedlist> |
| 267 | <listitem><para> |
| 268 | <emphasis>Locate and Download the Tarball for the Pre-Built |
| 269 | Root Filesystem Image File:</emphasis> |
| 270 | You need to find and download the root filesystem image |
| 271 | file that is appropriate for your target system. |
Brad Bishop | d5ae7d9 | 2018-06-14 09:52:03 -0700 | [diff] [blame] | 272 | These files are kept in machine-specific folders in the |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 273 | <ulink url='&YOCTO_DL_URL;/releases/yocto/yocto-&DISTRO;/machines/'>Index of Releases</ulink> |
| 274 | in the "machines" directory.</para> |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 275 | |
Brad Bishop | d5ae7d9 | 2018-06-14 09:52:03 -0700 | [diff] [blame] | 276 | <para>The machine-specific folders of the "machines" directory |
| 277 | contain tarballs (<filename>*.tar.bz2</filename>) for supported |
| 278 | machines. |
| 279 | These directories also contain flattened root filesystem |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 280 | image files (<filename>*.ext4</filename>), which you can use |
| 281 | with QEMU directly.</para> |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 282 | |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 283 | <para>The pre-built root filesystem image files |
| 284 | follow these naming conventions: |
| 285 | <literallayout class='monospaced'> |
Brad Bishop | d5ae7d9 | 2018-06-14 09:52:03 -0700 | [diff] [blame] | 286 | <!-- |
| 287 | core-image-<replaceable>profile</replaceable>-<replaceable>arch</replaceable>-<replaceable>date_time</replaceable>.rootfs.tar.bz2 |
| 288 | --> |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 289 | core-image-<replaceable>profile</replaceable>-<replaceable>arch</replaceable>.tar.bz2 |
| 290 | |
| 291 | Where: |
| 292 | <replaceable>profile</replaceable> is the filesystem image's profile: |
Brad Bishop | d5ae7d9 | 2018-06-14 09:52:03 -0700 | [diff] [blame] | 293 | lsb, lsb-dev, lsb-sdk, minimal, minimal-dev, minimal-initramfs, |
| 294 | sato, sato-dev, sato-sdk, sato-sdk-ptest. For information on |
| 295 | these types of image profiles, see the "<ulink url='&YOCTO_DOCS_REF_URL;#ref-images'>Images</ulink>" chapter in |
| 296 | the Yocto Project Reference Manual. |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 297 | |
| 298 | <replaceable>arch</replaceable> is a string representing the target architecture: |
Brad Bishop | d5ae7d9 | 2018-06-14 09:52:03 -0700 | [diff] [blame] | 299 | beaglebone-yocto, beaglebone-yocto-lsb, edgerouter, edgerouter-lsb, |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 300 | genericx86, genericx86-64, genericx86-64-lsb, genericx86-lsb and qemu*. |
Brad Bishop | d5ae7d9 | 2018-06-14 09:52:03 -0700 | [diff] [blame] | 301 | |
| 302 | <!--> |
| 303 | <replaceable>date_time</replaceable> is a date and time stamp. |
| 304 | --> |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 305 | |
| 306 | </literallayout> |
| 307 | The root filesystems provided by the Yocto Project are based |
| 308 | off of the <filename>core-image-sato</filename> and |
| 309 | <filename>core-image-minimal</filename> images. |
| 310 | </para> |
| 311 | |
Brad Bishop | d5ae7d9 | 2018-06-14 09:52:03 -0700 | [diff] [blame] | 312 | <para>For example, if you plan on using a BeagleBone device |
| 313 | as your target hardware and your image is a |
| 314 | <filename>core-image-sato-sdk</filename> |
| 315 | image, you can download the following file: |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 316 | <literallayout class='monospaced'> |
Brad Bishop | d5ae7d9 | 2018-06-14 09:52:03 -0700 | [diff] [blame] | 317 | core-image-sato-sdk-beaglebone-yocto.tar.bz2 |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 318 | </literallayout> |
| 319 | </para></listitem> |
| 320 | <listitem><para> |
| 321 | <emphasis>Initialize the Cross-Development Environment:</emphasis> |
Brad Bishop | d5ae7d9 | 2018-06-14 09:52:03 -0700 | [diff] [blame] | 322 | You must <filename>source</filename> the cross-development |
| 323 | environment setup script to establish necessary environment |
| 324 | variables.</para> |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 325 | |
| 326 | <para>This script is located in the top-level directory in |
| 327 | which you installed the toolchain (e.g. |
| 328 | <filename>poky_sdk</filename>).</para> |
| 329 | |
Brad Bishop | d5ae7d9 | 2018-06-14 09:52:03 -0700 | [diff] [blame] | 330 | <para>Following is an example based on the toolchain installed |
| 331 | in the |
| 332 | "<link linkend='sdk-locating-pre-built-sdk-installers'>Locating Pre-Built SDK Installers</link>" |
| 333 | section: |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 334 | <literallayout class='monospaced'> |
| 335 | $ source ~/poky_sdk/environment-setup-core2-64-poky-linux |
| 336 | </literallayout> |
| 337 | </para></listitem> |
| 338 | <listitem><para> |
| 339 | <emphasis>Extract the Root Filesystem:</emphasis> |
| 340 | Use the <filename>runqemu-extract-sdk</filename> command |
| 341 | and provide the root filesystem image.</para> |
| 342 | |
| 343 | <para>Following is an example command that extracts the root |
| 344 | filesystem from a previously built root filesystem image that |
| 345 | was downloaded from the |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 346 | <ulink url='&YOCTO_DOCS_OM_URL;#index-downloads'>Index of Releases</ulink>. |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 347 | This command extracts the root filesystem into the |
| 348 | <filename>core2-64-sato</filename> directory: |
| 349 | <literallayout class='monospaced'> |
Brad Bishop | d5ae7d9 | 2018-06-14 09:52:03 -0700 | [diff] [blame] | 350 | $ runqemu-extract-sdk ~/Downloads/core-image-sato-sdk-beaglebone-yocto.tar.bz2 ~/beaglebone-sato |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 351 | </literallayout> |
| 352 | You could now point to the target sysroot at |
Brad Bishop | d5ae7d9 | 2018-06-14 09:52:03 -0700 | [diff] [blame] | 353 | <filename>beablebone-sato</filename>. |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 354 | </para></listitem> |
| 355 | </orderedlist> |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 356 | </para> |
| 357 | </section> |
| 358 | |
| 359 | <section id='sdk-installed-standard-sdk-directory-structure'> |
| 360 | <title>Installed Standard SDK Directory Structure</title> |
| 361 | |
| 362 | <para> |
| 363 | The following figure shows the resulting directory structure after |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 364 | you install the Standard SDK by running the <filename>*.sh</filename> |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 365 | SDK installation script: |
| 366 | </para> |
| 367 | |
| 368 | <para> |
Brad Bishop | d5ae7d9 | 2018-06-14 09:52:03 -0700 | [diff] [blame] | 369 | <imagedata fileref="figures/sdk-installed-standard-sdk-directory.png" scale="80" align="center" /> |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 370 | </para> |
| 371 | |
| 372 | <para> |
| 373 | The installed SDK consists of an environment setup script for the SDK, |
| 374 | a configuration file for the target, a version file for the target, |
| 375 | and the root filesystem (<filename>sysroots</filename>) needed to |
| 376 | develop objects for the target system. |
| 377 | </para> |
| 378 | |
| 379 | <para> |
| 380 | Within the figure, italicized text is used to indicate replaceable |
| 381 | portions of the file or directory name. |
| 382 | For example, |
| 383 | <replaceable>install_dir</replaceable>/<replaceable>version</replaceable> |
| 384 | is the directory where the SDK is installed. |
| 385 | By default, this directory is <filename>/opt/poky/</filename>. |
| 386 | And, <replaceable>version</replaceable> represents the specific |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 387 | snapshot of the SDK (e.g. <filename>&DISTRO;</filename>). |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 388 | Furthermore, <replaceable>target</replaceable> represents the target |
| 389 | architecture (e.g. <filename>i586</filename>) and |
| 390 | <replaceable>host</replaceable> represents the development system's |
| 391 | architecture (e.g. <filename>x86_64</filename>). |
| 392 | Thus, the complete names of the two directories within the |
| 393 | <filename>sysroots</filename> could be |
| 394 | <filename>i586-poky-linux</filename> and |
| 395 | <filename>x86_64-pokysdk-linux</filename> for the target and host, |
| 396 | respectively. |
| 397 | </para> |
| 398 | </section> |
| 399 | |
| 400 | <section id='sdk-installed-extensible-sdk-directory-structure'> |
| 401 | <title>Installed Extensible SDK Directory Structure</title> |
| 402 | |
| 403 | <para> |
| 404 | The following figure shows the resulting directory structure after |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 405 | you install the Extensible SDK by running the <filename>*.sh</filename> |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 406 | SDK installation script: |
| 407 | </para> |
| 408 | |
| 409 | <para> |
Brad Bishop | d5ae7d9 | 2018-06-14 09:52:03 -0700 | [diff] [blame] | 410 | <imagedata fileref="figures/sdk-installed-extensible-sdk-directory.png" scale="80" align="center" /> |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 411 | </para> |
| 412 | |
| 413 | <para> |
| 414 | The installed directory structure for the extensible SDK is quite |
| 415 | different than the installed structure for the standard SDK. |
| 416 | The extensible SDK does not separate host and target parts in the |
| 417 | same manner as does the standard SDK. |
| 418 | The extensible SDK uses an embedded copy of the OpenEmbedded |
| 419 | build system, which has its own sysroots. |
| 420 | </para> |
| 421 | |
| 422 | <para> |
| 423 | Of note in the directory structure are an environment setup script |
| 424 | for the SDK, a configuration file for the target, a version file for |
Brad Bishop | d5ae7d9 | 2018-06-14 09:52:03 -0700 | [diff] [blame] | 425 | the target, and log files for the OpenEmbedded build system |
| 426 | preparation script run by the installer and BitBake. |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 427 | </para> |
| 428 | |
| 429 | <para> |
| 430 | Within the figure, italicized text is used to indicate replaceable |
| 431 | portions of the file or directory name. |
| 432 | For example, |
| 433 | <replaceable>install_dir</replaceable> is the directory where the SDK |
Brad Bishop | d5ae7d9 | 2018-06-14 09:52:03 -0700 | [diff] [blame] | 434 | is installed, which is <filename>poky_sdk</filename> by default, and |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 435 | <replaceable>target</replaceable> represents the target |
Brad Bishop | d5ae7d9 | 2018-06-14 09:52:03 -0700 | [diff] [blame] | 436 | architecture (e.g. <filename>i586</filename>). |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 437 | </para> |
| 438 | </section> |
| 439 | |
| 440 | </appendix> |
| 441 | <!-- |
| 442 | vim: expandtab tw=80 ts=4 |
| 443 | --> |