Yocto Legato Builds

This topic provides info about working with Legato and Yocto.

The Yocto Project is an open source collaboration project that provides templates, tools and methods to help you create custom Linux-based systems for embedded products regardless of the hardware architecture.

Legato is compatible with Yocto 1.7.2

Yocto Linux Directories

Untar the file Legato-Dist-Source-mdm9x15-SWI9X15Y_07.04.06.00.tar.bz2 to a directory (available at Legato Downloads):

$ cd <some directory>
$ tar xvjfLegato-Dist-Source-mdm9x15-SWI9X15Y_07.04.06.00.tar.bz2

These file/directories will be extracted:

  • linux-yocto-3.4.git - Linux kernel - 14.1.0.Beta.rc2
  • Legato-Yocto1_7 - Sierra Wireless specific layers
  • meta-swi - Hardware adaptations
  • meta-swi-extras - Build scripts and proprietary code

Yocto uses a layered model for its build system. In Legato, device-specific layers are meta-swi-[target] and meta-swi-bin.

Yocto 1.7.2 and poky environment documentation is available at Yocto docs

WP85 and Yocto

The following table lists details about Yocto support for the WP85 module.

legato-image.wp85.ubi requires fakeroot 1.10.2 for generation.
File Type Partition Filename Def. Description
bootloader image mtd0 appsboot.mbn * LK (little-kernel), provides fastboot
kernel image mtd1 boot-yocto-mdm9x15.2k.img * kernel (uncompressed) + mdm9x15-image-initramfs
rootfs image mtd2 mdm9x15-image-minimal-swi-mdm9x15.2k.ubi * rootfs as ubi (actual rootfs filesystem is squashfs, read-only)
mdm9x15-image-minimal-swi-mdm9x15.2k.yaffs2 rootfs as yaffs2 format (not working)
legato image mtd3 legato-image.wp85.ubi * legato as ubi (actual filesystem is squashfs, require fakeroot > 1.10.2 for generation)
legato-image.wp85.yaffs2 legato as yaffs2 (not working)
packages boot_wp85.cwe package with bootloader
boot-yocto_wp85.cwe package with bootloader + yocto (= kernel + rootfs)
boot-yocto-legato_wp85.cwe package with bootloader + yocto (= kernel + rootfs) + legato
legato-image.wp85.cwe package with legato
yocto_wp85.cwe package with yocto (= kernel + rootfs)
yocto-legato_wp85.cwe package with yocto (= kernel + rootfs) + legato

Pre-built Yocto Image

The prebuilt directory contains a kernel and root file system that can be built using the command below. It's the same as what's flashed on the device, and can be used to return to a known state.

  • kernel - kernel image
  • rootfs - smallish root file system ready for basic development.

Instructions on how to flash these images to the device are given in the file README.bsp.

Rebuild Yocto Image

Instructions for rebuilding the image are contained in the file Legato-Yocto1_6/meta-swi-extras/README.build

Running the build script with no arguments will print out the help message. There is also a file called stdbuild.sh to build the images with common options. This can take a long time the first time you run it. Once the build is complete, you'll find new images in the directory:


Links are created at the end of the build to point to the latest kernel (kernel) and root file system (rootfs)

You can’t rebuild Yocto images on Ubuntu 13.10.

Linux Flash Yocto

You can flash the Yocto images on Linux;, the device must be in fastboot mode. From the shell prompt on the device run:

root@swi-mdm9x15:~# sys_reboot bootloader

After a few seconds, the device will enumerate as an Android Bootloader Device. You can test this on the development PC with:

dave@devpc$ fastboot devices

Then erase and rewrite the kernel and root filesystem partitions using the fastboot command (the partitions are called kernel and rootfs):

dave@devpc $ fastboot erase kernel
dave@devpc $ fastboot erase rootfs
dave@devpc $ fastboot flash kernel kernel
dave@devpc $ fastboot flash rootfs rootfs
dave@devpc $ fastboot reboot
finished. total time: 0.001s
You have to use the micro-USB connection for fastboot

Custom Yocto Image

Because the Legato image is a Yocto-compliant BSP, there are many options for customizing.

Here's the easy way to add some packages to the rootfs:


For more complex customizations, refer to the Yocto documentation.

Copyright (C) Sierra Wireless Inc. Use of this work is subject to license.