The Complete Guide to Yocto Images, SDKs and devtool
How a Yocto build becomes a shippable image, how application developers get an SDK, and how devtool speeds up the loop, on Scarthgap 5.0 with BitBake 2.8.

Recipes produce packages. A product ships neither packages nor recipes. It ships an image: a root filesystem, a kernel and the files that put them on a device, in a format the programming tool or the update system understands. And the people who write applications for that device need something else again, a toolchain and a sysroot that match the image, without running the whole Yocto build on every laptop. This guide covers that last third of the Yocto workflow on Scarthgap 5.0 with BitBake 2.8: how images are defined and assembled, how to control their contents, size and formats, how package feeds work, how the standard and extensible SDKs are generated and used, and how devtool turns the edit-build-test loop from hours into minutes. It follows the guide to writing recipes, which produced the packages, and it starts from the guide to the Yocto Project, which explains the build model.
What an image is
An image recipe is a recipe with a different job. A software recipe ends with a set of packages. An image recipe starts from a list of packages, installs them into a directory, and turns the directory into artefacts. Two tasks do the work: do_rootfs populates a root filesystem directory by running the package manager's installation against the package feed that the build has just produced, and do_image and its type-specific siblings convert that directory into files. The class image.bbclass supplies both, and core-image.bbclass adds the standard feature handling.
This is the key to the rest of the guide: images are assembled from packages, not from the build directories of recipes. That is why an unpackaged file never reaches the device, why RDEPENDS pulls packages into the image, and why a package manager database can be left on the device or removed from it.
The output lands in tmp/deploy/images/<machine>/: the root filesystem image in each requested format, the kernel, the device tree blobs, the bootloader files, a manifest of installed packages and a .qemuboot.conf that runqemu reads.
Writing the image recipe
The standard starting point is a recipe that inherits core-image. The image recipe post walks through one in detail:
SUMMARY = "My product image"
LICENSE = "MIT"
inherit core-image
IMAGE_FEATURES += "ssh-server-dropbear"
IMAGE_INSTALL += " \
sensord \
hello \
"
IMAGE_LINGUAS = ""
IMAGE_FSTYPES = "ext4 tar.bz2"
IMAGE_ROOTFS_EXTRA_SPACE = "65536"The recipe sits in your layer, typically in recipes-core/images/, and is built with bitbake my-image. A few rules keep it correct.
Append to IMAGE_INSTALL, never assign. The class sets a base value that includes packagegroup-core-boot, the packages without which the system does not boot, and IMAGE_INSTALL = "..." would replace it. Use += or :append.
Prefer IMAGE_FEATURES over package names when a feature exists. Features such as ssh-server-dropbear, package-management, tools-debug, read-only-rootfs and debug-tweaks expand to the right packages and rootfs behaviour for the current distribution, and the list is in the reference manual's image features section at https://docs.yoctoproject.org/5.0/ref-manual/features.html. debug-tweaks, which permits an empty root password, is a development convenience and must not be in a product image. EXTRA_IMAGE_FEATURES in local.conf merges into every image, which is how a developer enables it without touching the recipe.
Group related packages into a packagegroup recipe when the list grows, and add the group to IMAGE_INSTALL. A group is a recipe that inherits packagegroup and lists packages in RDEPENDS:${PN}. Several images can share one.
Start from core-image rather than require-ing one of Poky's example images. The examples change between releases, and your recipe should state what you want.
Controlling contents: what goes in and what stays out
Three mechanisms govern what ends up in the root filesystem.
Explicit installs and their dependencies. Whatever IMAGE_INSTALL and the expanded features name, plus every package's RDEPENDS, recursively. This is the closure. The way to understand it is to read the manifest.
Recommendations. RRECOMMENDS entries are installed by default but do not stop the build if unavailable. NO_RECOMMENDATIONS = "1" in the image drops them all, and BAD_RECOMMENDATIONS drops named ones. Many surprise packages in an image arrive this way.
Exclusions. PACKAGE_EXCLUDE names packages that must not be installed. The build fails if something requires one, which tells you exactly which dependency drags it in.
Read the closure from the manifest after any build:
sort tmp/deploy/images/qemux86-64/my-image-qemux86-64.rootfs.manifest | head -6base-files qemux86_64 3.0.14
base-passwd core2_64 3.6.3
busybox core2_64 1.36.1
busybox-hwclock core2_64 1.36.1
busybox-syslog core2_64 1.36.1
busybox-udhcpc core2_64 1.36.1The packages, versions and architecture strings depend on your image and release. The manifest has one line per installed package: name, package architecture and version. It is the first thing to read when an image is larger than expected or a package is unexpectedly present.
Seeing size and changes: buildhistory
The manifest tells you what is in an image. To see how an image changes over time, enable the buildhistory class, which records the contents of every build into a git repository:
INHERIT += "buildhistory"
BUILDHISTORY_COMMIT = "1"After a build, the buildhistory/ directory in the build directory holds, for each image, the installed package list with sizes, the image's total size, the file list and the dependency graph, committed to git with one commit per build. The buildhistory-diff script prints the difference between builds:
buildhistory-diff HEAD~1Changes to images/qemux86_64/glibc/my-image (installed-package-names.txt):
Added packages: htop
Changes to images/qemux86_64/glibc/my-image (installed-packages.txt):
htop was added (+312 KiB)
Image size changed from 13112 KiB to 13424 KiB (+312 KiB)The output format and the figures depend on your build, and the sizes above are an illustration of the layout. Teams that run buildhistory in continuous integration get an automatic record of every package and size change per commit, which is the best defence against image growth.
Image formats and partitioning
IMAGE_FSTYPES lists the output formats. Each name corresponds to a conversion step: ext4, ext3, squashfs, squashfs-xz, jffs2, ubifs, cpio.gz, tar.bz2, iso, wic and more. A machine configuration sets a default, and the image recipe or local.conf overrides it. Choose by how the device stores its root filesystem: raw NAND uses UBI and UBIFS, eMMC and SD use ext4 inside a partitioned disk, a RAM disk uses cpio.gz, and a read-only compressed root uses SquashFS.
The wic format is the tool for whole-disk images with several partitions. A kickstart file describes the layout:
part /boot --source bootimg-partition --ondisk sda --fstype=vfat --label boot --active --align 4 --size 64
part / --source rootfs --ondisk sda --fstype=ext4 --label root --align 4
bootloader --ptable gptName it in the image recipe:
IMAGE_FSTYPES += "wic"
WKS_FILE = "my-image.wks"The --source plugins that put a bootloader and its files on the disk differ by machine and boot method (bootimg-partition, bootimg-efi, bootimg-pcbios), so the bootable part of a kickstart is written for your board, and your BSP layer usually ships one to start from. The reference manual's wic chapter at https://docs.yoctoproject.org/5.0/dev-manual/wic.html documents the syntax and the plugins. The result is a single file you can write to a card with dd or bmaptool.
For a device that needs spare space on its root filesystem, IMAGE_ROOTFS_EXTRA_SPACE adds kilobytes, and IMAGE_OVERHEAD_FACTOR scales the size. IMAGE_ROOTFS_SIZE sets a minimum.
Read-only roots, users and last-step changes
Products often mount the root filesystem read-only, so that power loss cannot corrupt it. The feature read-only-rootfs builds the image for that, and arranges for the pieces that must be writable, such as /var/log or /etc state, to be handled by volatile bindings or overlay mounts, which the init system's configuration selects. Everything that writes at run time must be accounted for, and a boot test on hardware is the only reliable check.
Accounts are created at image build time. Services get theirs from the useradd class in their recipes. For the accounts the image itself defines, such as setting a root password hash or adding an operator user, inherit extrausers and set EXTRA_USERS_PARAMS with useradd, usermod and groupadd commands. Never ship a shared default password in a product, and prefer SSH keys installed by the provisioning step.
For final changes that no package owns, ROOTFS_POSTPROCESS_COMMAND runs functions on the assembled root filesystem. Keep it for small things: a version stamp, removing a file, adjusting a configuration. Anything that is a real component belongs in a package.
Package feeds and package management
The image is built from packages, and the build produces those packages in a format chosen by PACKAGE_CLASSES: package_rpm, package_ipk or package_deb. They sit in tmp/deploy/ in a directory for that format, with an index built by bitbake package-index. Two uses follow.
First, an image can carry a package manager and a feed address, so the device can install and update packages: add the package-management image feature and set PACKAGE_FEED_URIS to the URL of the feed, and serve the deploy directory over HTTP. Then dnf or opkg on the device updates individual packages. This suits development, and for a locked-down product it is often replaced by whole-image updates.
Second, the same packages let you update a development board without reflashing: bitbake widget && bitbake package-index, then install on the target. Mixing feeds from different builds is a way to produce inconsistent systems, so treat the feed as belonging to one build and one PR service, as the hash and PR service post explains for feed version ordering.
Testing images
Booting an image in QEMU with runqemu is the first test, and that post shows it. The testimage class goes further: with INHERIT += "testimage", bitbake -c testimage my-image boots the image in QEMU (or a configured target), connects over SSH and runs a suite of tests from meta/lib/oeqa/runtime/cases, plus any you add from your layer. The image needs an SSH server and, for the default suite, the packages the tests exercise. It is the basis for automatic image checks in continuous integration. For services, the ptest feature runs upstream test suites installed in -ptest packages, through ptest-runner.
Why applications need an SDK
An application developer needs a cross compiler and the target's headers and libraries. They do not need, and often cannot run, the whole Yocto build. The SDK is what the build hands them: an installer that unpacks a cross toolchain for the developer's host, a sysroot for the target and an environment script that sets the variables.
Yocto produces two kinds. The standard SDK is a toolchain and a sysroot of the image's libraries and headers, fixed at the time it was built. The extensible SDK includes the same, plus devtool and enough of the build system to build and add recipes, so that a developer can change the platform itself without a full Yocto tree.
The standard SDK
Generate it for an image, with the build environment sourced:
bitbake -c populate_sdk my-imageNOTE: Tasks Summary: Attempted 5312 tasks of which 5190 didn't need to be rerun and all succeeded.The installer appears in tmp/deploy/sdk/:
ls tmp/deploy/sdk/poky-glibc-x86_64-my-image-core2-64-toolchain-5.0.5.host.manifest
poky-glibc-x86_64-my-image-core2-64-toolchain-5.0.5.sh
poky-glibc-x86_64-my-image-core2-64-toolchain-5.0.5.target.manifest
poky-glibc-x86_64-my-image-core2-64-toolchain-5.0.5.testdata.jsonThe name encodes the distribution, the C library, the SDK host architecture, the image, the target's tuning, and the version. The .sh file is a self-extracting installer, and the two manifests list what it contains. Give the installer to developers. They run it on their host:
./poky-glibc-x86_64-my-image-core2-64-toolchain-5.0.5.shPoky (Yocto Project Reference Distro) SDK installer version 5.0.5
=================================================================
Enter target directory for SDK (default: /opt/poky/5.0.5):
You are about to install the SDK to "/opt/poky/5.0.5". Proceed [Y/n]? Y
Extracting SDK...............done
Setting it up...done
SDK has been successfully set up and is ready to be used.
Each time you wish to use the SDK in a new shell session, you need to source the environment setup script e.g.
$ . /opt/poky/5.0.5/environment-setup-core2-64-poky-linuxThe installer text, directory and version follow your distribution and release. Using it is a matter of sourcing the environment script and compiling with the variables it sets:
. /opt/poky/5.0.5/environment-setup-core2-64-poky-linux
echo $CC
$CC hello.c -o hello
file hellox86_64-poky-linux-gcc -m64 -march=nehalem -mtune=generic -mfpmath=sse -msse4.2 --sysroot=/opt/poky/5.0.5/sysroots/core2-64-poky-linux
hello: ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 3.2.0, not strippedThe CC value shows how the compiler is wrapped: the cross compiler name, the architecture flags and the sysroot that points at the target's headers and libraries inside the SDK. The script sets CC, CXX, CFLAGS, LDFLAGS, PKG_CONFIG_SYSROOT_DIR, CONFIGURE_FLAGS and others, so an autotools or CMake project builds against the target with no special options: a ./configure ${CONFIGURE_FLAGS} works, and CMake finds the toolchain file the SDK ships (OE_CMAKE_TOOLCHAIN_FILE).
Choosing what goes in
The SDK's sysroot is built from the image's own packages plus the -dev packages for them, so developers have the headers for every library in the image. Control the content with two variables. TOOLCHAIN_TARGET_TASK lists the packages installed into the target sysroot, and TOOLCHAIN_HOST_TASK lists the tools installed on the host side, such as nativesdk-cmake or nativesdk-gdb:
TOOLCHAIN_TARGET_TASK:append = " libssl-dev libz-staticdev"
TOOLCHAIN_HOST_TASK:append = " nativesdk-cmake nativesdk-meson"Put them in the image recipe or a dedicated SDK configuration. SDKMACHINE selects the architecture the SDK runs on (x86_64 by default, aarch64 and i686 are also possible), which lets you build an SDK for a developer's Arm laptop from your x86 build host. The generic meta-toolchain recipe produces an SDK without any image's libraries, only the toolchain and a minimal sysroot.
The extensible SDK and devtool
The extensible SDK, built with bitbake -c populate_sdk_ext my-image, adds what a platform developer needs: the build system itself in a reduced form, a shared state cache so that the first use does not rebuild everything, and the devtool command. Developers who change recipes and libraries, not just applications, use it. Teams that never change the platform from the SDK side use the standard SDK, which is smaller and simpler.
devtool also works in a full Poky build directory, where it is the recommended way to add and modify recipes. Its model is a workspace: a layer called workspace in the build directory, added to bblayers.conf automatically, that holds the recipes and source trees you are working on, and overrides the real ones while you do. The commands cover the lifecycle of a change.
| Command | What it does |
|---|---|
devtool add <name> <url or path> | Create a recipe for new software and a workspace source tree |
devtool modify <recipe> | Extract an existing recipe's source into the workspace as a git repository |
devtool build <recipe> | Build the recipe from the workspace source |
devtool deploy-target <recipe> user@host | Copy the built files to a running target over SSH |
devtool build-image <image> | Build an image that includes the workspace recipes |
devtool upgrade <recipe> -V <version> | Move a recipe to a newer upstream version |
devtool update-recipe <recipe> | Write source changes back to the recipe as patches |
devtool finish <recipe> <layer> | Move the recipe and patches into a real layer and remove the workspace entry |
devtool reset <recipe> | Remove the recipe from the workspace |
devtool status | List recipes in the workspace and where their sources are |
The inner loop
The case devtool was made for is changing an existing component, for instance fixing a bug in a library the image uses. Without it, the loop is: edit the recipe's patch, rebuild the recipe, rebuild the image, flash, test, which takes many minutes per cycle. With it:
devtool modify widgetNOTE: Starting bitbake server...
NOTE: Adding local source files to srctree...
NOTE: Source tree extracted to /home/builder/poky/build/workspace/sources/widget
NOTE: Recipe widget now set up to build from /home/builder/poky/build/workspace/sources/widgetThe paths follow your build directory. The source is now a git repository in workspace/sources/widget, with the recipe's patches applied as commits. You edit files there with your usual tools. Then:
devtool build widget
devtool deploy-target widget [email protected]NOTE: Successfully built widget
NOTE: Successfully deployed /home/builder/poky/build/tmp/work/core2-64-poky-linux/widget/1.2+git/image to 192.168.7.2devtool build compiles the workspace source with the recipe's own settings, so the build environment is the real one. deploy-target copies the installed files to a running board over SSH and records them, so that devtool undeploy-target can remove them. Compile, deploy and test in a loop that takes seconds to minutes, on actual hardware, with no image rebuild.
When the change is right, commit it in the workspace repository with a good message, and let devtool write it back:
cd workspace/sources/widget
git commit -am "widget: fix off-by-one in buffer length check"
devtool finish widget ../../meta-mycompanyNOTE: Updating patch 0001-widget-fix-off-by-one-in-buffer-length-check.patch for widget
NOTE: Moving recipe file to /home/builder/meta-mycompany/recipes-example/widget
NOTE: Leaving source tree /home/builder/poky/build/workspace/sources/widget as-is; if you no longer need it then please delete it manuallyfinish turns your commits into patch files in the target layer, usually as a .bbappend with the patches in a files/ directory, and removes the recipe from the workspace so that the build is back to using the layer. The commit messages become the patch descriptions, which is why writing them well matters. For patches against the layer's own recipes, finish modifies the recipe itself.
Adding new software
For an application that has no recipe yet, devtool add creates one from a source URL or a local directory:
devtool add sensorctl https://git.example.com/acme/sensorctl.gitThe tool fetches the source, detects the build system, writes a recipe in the workspace and sets the source tree up for you to edit. It uses the same detection as recipetool create, so review the generated recipe: the licence, the dependencies and the version need your attention. devtool edit-recipe sensorctl opens it in your editor. When it builds, devtool finish sensorctl ../../meta-mycompany moves it into your layer.
For code you develop locally, point at a directory instead of a URL, and the workspace recipe builds from it directly, which is the fastest loop for an application that lives in its own repository.
Upgrading
devtool upgrade widget -V 1.3 fetches the new version, rebases your patches onto it, and reports which no longer apply, leaving the work in the workspace to be finished and committed. It is the least painful way to move a recipe forward. devtool latest-version widget asks the upstream for the newest release, which helps schedule updates. The Scarthgap upgrade post uses these tools as part of a release migration.
Using the SDK and devtool together
Teams that distribute an extensible SDK to platform developers get the best of both: developers install it, run devtool inside it, change a library, deploy to a board, and hand back a patch, with no Yocto tree on their laptops. An application team uses the standard SDK, with the toolchain, in their IDE or build system, and builds against whatever the platform team's image provides. Keep the SDK matched to the image: the sysroot has to contain the libraries and headers of the exact build you ship, so regenerate and republish it whenever the image's libraries change.
Inside do_rootfs
Knowing what do_rootfs does explains most image build errors, because they happen in its steps and not in the recipes.
First it creates an empty directory for the root filesystem. It then runs the package manager for the chosen PACKAGE_CLASSES against the packages the build just produced, which is why an image build needs the package index to be current. The manager resolves the list from IMAGE_INSTALL and the features, adds dependencies and recommendations, and unpacks every package into the directory. Errors in this phase name a package and the dependency that cannot be met, such as Nothing provides 'libfoo1', and the cause is nearly always a package that was not built, was excluded, or is renamed.
Then the post-installation scripts run. A package can carry a pkg_postinst script, written in the recipe as pkg_postinst:${PN}(), that does setup work: creating a cache, enabling a unit, adding an account. For image builds, the script is executed against the root filesystem directory at build time when it can be, which is why recipes write them to be safe to run on the host. A script that must run on the real target, for example because it needs the target's own tools, is written to fail at build time with exit 1 when $D is set, and Yocto then defers it to the first boot of the device. That deferral is not available for a read-only root filesystem, so the same image with the read-only-rootfs feature fails to build if any post-install script cannot run at build time. The error names the package, and the fix is in that package's recipe.
Some post-install work cannot simply run in the build environment because it executes target binaries. Yocto handles the common cases with intercepts: small host-side replacements for tools such as ldconfig, depmod and update-mime-database, which run once at the end for all packages that asked for them. The intercept mechanism is why an image build does not need QEMU for ordinary cases, and why a rare package that needs a real target-side execution falls back to the first boot or to QEMU user-mode emulation.
After the scripts, the image classes run the hook lists. ROOTFS_PREPROCESS_COMMAND runs before the post-install scripts and ROOTFS_POSTPROCESS_COMMAND runs after the root filesystem is complete. Later, IMAGE_PREPROCESS_COMMAND and IMAGE_POSTPROCESS_COMMAND run around the creation of the image files themselves. Each is a list of function names separated by semicolons, and you add to it with += and a trailing semicolon, for example ROOTFS_POSTPROCESS_COMMAND += "write_version_file;". Choose the hook by what you need to see: change files before packaging steps that read them in the pre-process list, and edit the finished tree in the post-process list.
Finally, the build removes what a deployed image should not carry: the package manager's database and the feed configuration unless the package-management feature is on, the /var/cache of the package manager, and other build-only files. It writes the manifest, then runs the image type conversions in sequence for each entry of IMAGE_FSTYPES.
When an image build fails, read log.do_rootfs in the image recipe's temp directory. The package manager's own output is there, and the first line that mentions a failure is almost always the cause.
Kernel, device tree and bootloader in the deploy directory
An image recipe does not include the kernel inside the root filesystem unless a package puts it there. The machine configuration decides what the build deploys next to the image: KERNEL_IMAGETYPE names the kernel image format (zImage or Image on Arm, bzImage on x86), KERNEL_DEVICETREE lists the device tree blobs to build, and the bootloader recipe, chosen by PREFERRED_PROVIDER_virtual/bootloader, deploys its binary. They all appear in tmp/deploy/images/<machine>/ beside the root filesystem, and the wic kickstart or the board's flashing procedure combines them.
Two settings control what goes on a boot partition. IMAGE_BOOT_FILES lists files from the deploy directory to copy into the boot partition when you use the bootimg-partition wic plugin, with an optional rename:
IMAGE_BOOT_FILES = "Image bcm2711-rpi-4-b.dtb boot.scr;boot.scr"The entries are examples for a Raspberry Pi 4 board. The syntax is source;destination, and a wildcard is allowed. For machines that boot from the kernel in the root filesystem, install the kernel packages instead, by adding kernel-image and kernel-modules to the image, as the extra packages for a root-mounted kernel setup. Which method a product uses is a board decision, and the BSP layer's documentation says which the board expects.
Kernel modules are packages named kernel-module-<name>, installed by the build only if something depends on them. Adding kernel-modules to IMAGE_INSTALL installs all of them, which is convenient for development and wasteful for a product. A product lists the modules it needs, or sets MACHINE_EXTRA_RRECOMMENDS in the machine configuration so that the modules the hardware needs are installed with the recommended packages.
Keeping images small
Size is a product requirement on many devices, and the work is mostly about removing things, in an order that pays off.
**Read the manifest and
buildhistory.** The largest packages and the unexpected ones show up in a minute, and removing one dependency chain can save more than any tuning.Cut recommendations and locales.
NO_RECOMMENDATIONS = "1"andIMAGE_LINGUAS = ""remove whole classes of packages, and each can be undone for the packages you do need.Choose the policy. The distribution decides the C library, the init system, and the default features. Using musl instead of glibc, or BusyBox init instead of systemd, changes the size of the base system, at a cost in compatibility that you have to test. The
poky-tinydistribution is a starting point for very small systems, with the caveat that it is a reference and not a product policy.Trim features at the distribution level.
DISTRO_FEATURES:removedrops features such asx11,bluetoothorwififor every recipe, so packages build without the dependencies. It rebuilds many recipes, so decide it early.Configure the big components. The kernel configuration and BusyBox's applet list are large levers. BusyBox is configured by fragments in
SRC_URI, as the bbappend post shows, and the kernel by configuration fragments.Compress the filesystem.
squashfs-xzorsquashfs-zstdshrink a read-only root, with a trade-off in CPU time at boot and read time. For flash, compare the compressed size, not the extracted one.Strip and exclude debug data. Debug symbols stay in the
-dbgpackages unlessdbg-pkgsis on, and binaries are stripped at packaging. Check that nodbg-pkgs,dev-pkgsortools-debugremain in a product image.
Measure after every step. A change that looks promising and saves nothing is common, because dependencies pull the package back in through another route, and PACKAGE_EXCLUDE is how you find which one.
Updating devices in the field
An image is built once and has to be replaced many times in the field, and the update design affects how you build it. The common strategies shape the image recipe.
Whole-image updates with an A/B layout keep two root filesystem partitions: the device runs from one and installs the new image into the other, then switches the boot loader to it, with a rollback if the new system fails to start. The tools that implement this are RAUC, SWUpdate and Mender, each with a layer for Yocto that adds the update client to the image and generates update bundles from the build. The partition layout is described in a wic kickstart, and the root filesystem is usually read-only so that the update is the only way the system changes. Consult each project's own documentation for the integration details, since they change between releases.
Package-based updates use the package feed and the package manager on the device. They allow small updates, and they allow the device to drift from what you tested: two devices that received different update sequences can end up in different states. Use them for development and for devices where fine-grained updates are worth the risk.
Delta and file-based updates sit between the two and need support from the update tool.
Whichever you choose, the image recipe has to provide the pieces: the update client package, a data partition for state that survives updates, a bootloader configuration that supports the switch, and a way to provision keys. Plan the partition table and the read-only root before the first release, because changing them later means reflashing the devices already deployed.
The extensible SDK in more detail
The extensible SDK has a few controls that matter when you distribute it. SDK_EXT_TYPE selects how much it contains: full is the default and includes the shared state for the image's recipes so that most things build quickly, and minimal is much smaller and fetches what it needs on demand from a server, which suits an installer you hand to many people. SDK_INCLUDE_TOOLCHAIN = "1" includes the cross toolchain in a minimal SDK. SDK_UPDATE_URL names a server for updates, and developers then run devtool sdk-update to move to a newer build of the platform without reinstalling.
The installer's file name carries -toolchain-ext- to distinguish it from the standard one. An extensible SDK is installed the same way, and then provides the devtool command after you source its environment script. Inside it, devtool works against the SDK's own build system, with the same commands as in a full build directory, and devtool build-image produces an image from the workspace changes. The SDK expects a network or a local sstate mirror for what it does not carry.
Two cautions apply. An extensible SDK is large, because it is a build system, and it has to be regenerated and re-published with each platform release. And developers sometimes treat it as a full replacement for the Yocto tree, which it is not: structural changes such as new layers, new machines or distribution changes belong in the full build.
Developing and debugging applications against the image
The SDK makes the application build match the image, and a few conventions make the day-to-day loop pleasant.
Use the CMake toolchain file that the SDK ships, $OECORE_NATIVE_SYSROOT/usr/share/cmake/OEToolchainConfig.cmake, through the variable OE_CMAKE_TOOLCHAIN_FILE that the environment script sets, so an IDE or a command line can configure projects for the target:
. /opt/poky/5.0.5/environment-setup-core2-64-poky-linux
cmake -S . -B build -DCMAKE_TOOLCHAIN_FILE=$OE_CMAKE_TOOLCHAIN_FILE
cmake --build build-- The C compiler identification is GNU 13.2.0
-- Detecting C compiler ABI info - done
-- Configuring done
-- Generating done
-- Build files have been written to: /home/dev/project/build
[100%] Built target sensorctlThe compiler version and paths follow your SDK. Autotools projects work the same way: ./configure $CONFIGURE_FLAGS uses the variables the environment script defines.
For debugging, add the tools-debug feature to a development image, which installs gdbserver, strace and related tools, and dbg-pkgs if you want debug symbols for the system libraries. Then run the program under gdbserver on the target and connect with the SDK's cross debugger from the host, which finds the target's libraries in the SDK sysroot so that backtraces through system libraries resolve:
gdbserver :2345 /usr/bin/sensorctlProcess /usr/bin/sensorctl created; pid = 412
Listening on port 2345On the host, the SDK environment provides the cross gdb through its prefix variables (the name is ${CROSS_COMPILE}gdb), and the commands set sysroot and target remote <board>:2345 attach it. Because the SDK's sysroot is built from the same packages as the image, the library addresses match. If they do not, the SDK and the image come from different builds, which is the commonest cause of backtraces that make no sense.
Continuous integration for images and SDKs
A reliable pipeline for this part of the workflow is short and has these stages, run on every change to the product layer.
Build the image in a container with pinned layers, with the shared state mirror configured so that most tasks restore, and with
buildhistoryenabled.Run the automatic tests with
testimagein QEMU, and on hardware boards in a lab if you have them, since QEMU cannot test drivers.Check size and content. Fail the build if the image grows beyond a threshold, or if
buildhistory-diffreports a package nobody added deliberately.Generate the licence manifest and archive it with the image, since it is part of the release record.
Build the SDK from the same revision, and publish it with the image so the two always match.
Publish the shared state from the one trusted job, so that developers' builds restore from it.
Archive the release inputs: the layer revisions, the source mirror and the configuration, as the offline post explains.
Every stage is a command you have already seen in this guide, and the discipline is in running all of them for every release, not for the ones that seem risky. Images that ship without the SDK, or SDKs rebuilt later from a different revision, are the source of most "it works on my machine" reports between platform and application teams.
Common problems in the image workflow
| Symptom | Likely cause | What to do |
|---|---|---|
The image does not boot after setting IMAGE_INSTALL | A plain assignment dropped packagegroup-core-boot | Use += or :append |
do_rootfs fails with Nothing provides | A package was excluded, renamed or never built | Check PACKAGE_EXCLUDE and bitbake-layers show-recipes |
Image build fails only with read-only-rootfs | A post-install script cannot run at build time | Fix the package's pkg_postinst |
| The image is far larger than expected | Recommendations, locales or dbg-pkgs/dev-pkgs features | Read the manifest and buildhistory |
| The SDK compiler cannot find a header | The library's -dev package is not in the SDK | Add it to TOOLCHAIN_TARGET_TASK |
devtool deploy-target fails | No SSH access, or the target lacks a writable /usr | Check the connection and the root filesystem mode |
devtool finish leaves no patches | Nothing was committed in the workspace repository | Commit first, then finish |
| Backtraces through libraries are wrong | The SDK and the image come from different builds | Rebuild the SDK from the image revision |
| The wic image does not boot | The kickstart does not match the board's boot method | Start from the BSP's own kickstart |
Checklist for a shippable image
Before an image goes to a customer, check it against this list.
The image is a recipe in your layer, not a
local.confsetting, and it builds from a pinned set of layers.debug-tweaksand other development features are off, and root has no empty password.The manifest contains no package you did not choose, and
buildhistoryshows no unexplained growth.The licence manifest is generated and reviewed, and
INCOMPATIBLE_LICENSEenforces your policy.The root filesystem is read-only if the product needs it, with every writable location accounted for.
The image boots on real hardware and passes your automated tests, not only in QEMU.
An SDK matching the image is built and published to the application team.
The sources and the shared state cache for the release are archived, as the offline post describes.


