# Leaf swi-linux wp77xx

**URL:** <https://forum.legato.io/t/leaf-swi-linux-wp77xx/4554>\
**Category:** Legato Application Framework\
**Created:** [July 12, 2019, 4:39am UTC](https://forum.legato.io/t/leaf-swi-linux-wp77xx/4554 "2019-07-12T04:39:11Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![shib](https://avatars.discourse-cdn.com/v4/letter/s/f6c823/32.png) [@shib](https://forum.legato.io/u/shib)\
**Post date:** [July 12, 2019, 4:39am UTC](https://forum.legato.io/t/leaf-swi-linux-wp77xx/4554/1 "2019-07-12T04:39:11Z")

</div>

I am trying out leaf, but I am not having much luck.  
I have set up a workspace for the wp77xx and retrieved the linux source.

When I try to build from source, I am getting errors saying that layers for the mdm9x06 are missing.  
Looking at bblayers.conf I can see layers for the mdm9x28 and also for the mdm9x06.  
If I have a look at the manifest.json file I can see it says MACH is an mdm9x06 and the LINUX\_IMAGES and SYSROOT directories are for the mdm9x06.

Is there a bug in the manifest.json file?

---

<div class="post-metadata">

**Author:** ![shib](https://avatars.discourse-cdn.com/v4/letter/s/f6c823/32.png) [@shib](https://forum.legato.io/u/shib)\
**Post date:** [July 15, 2019, 1:44am UTC](https://forum.legato.io/t/leaf-swi-linux-wp77xx/4554/2 "2019-07-15T01:44:19Z")

</div>

I am a bit confused about few things.

In firmware release 9, 9.1, and 11, when downloading from [source.sierrawireless.com](http://source.sierrawireless.com) yocto was always built for an mdm9x28.  
When using leaf, suddenly yocto is built for an mdm9x06.  
Looking at the product technical specification for the WP77XX the core is a mdm9x06 core.

Would the linux source built for an mdm9x28 be incompatible with an mdm9x06?

This is only half the problem though, as when I try to build the linux source after downloading using leaf it is missing the meta-swi-mdm9x06 layer and the build fails.

---

<div class="post-metadata">

**Author:** ![CoRfr](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.legato.io/corfr/32/69_2.png) [@CoRfr](https://forum.legato.io/u/CoRfr)\
**Post date:** [August 29, 2019, 4:14pm UTC](https://forum.legato.io/t/leaf-swi-linux-wp77xx/4554/3 "2019-08-29T16:14:49Z")

</div>

Hi @shib,

from the linux point of view mdm9x06/mdm9x07/mdm9x28 are the same.  
You’re right that wp77 is a mdm9x06, while wp76 is mdm9x07.  
However for the Yocto build, in both cases we should be building using MACH=mdm9x28.  
I’m confused as to how it would get mdm9x06, can you provide some logs?

Thanks

---

<div class="post-metadata">

**Author:** ![shib](https://avatars.discourse-cdn.com/v4/letter/s/f6c823/32.png) [@shib](https://forum.legato.io/u/shib)\
**Post date:** [August 30, 2019, 12:25am UTC](https://forum.legato.io/t/leaf-swi-linux-wp77xx/4554/4 "2019-08-30T00:25:41Z")

</div>

FYI this is also my post: [Leaf swi-linux wp77xx - #9 by CoRfr - WP Series - Sierra Wireless Forum](https://forum.sierrawireless.com/t/leaf-swi-linux-wp77xx/16982/9)

I think my whole problem was executing the builds from within the leaf shell.  
When I did a make clean and rebuilt everything normally it built OK - for the toolchain as well.

I set up my leaf environment for a WP77XX following the leaf guide and then downloaded and switched to using the source.  
I was perhaps confused as to the purpose of the leaf shell, and thought I had to do everything leaf from inside the leaf shell.  
If you enter a leaf shell and echo $MACH you see it reports an mdm9x06.  
When you try to build the linux source from within the leaf shell it messes everything up, adding layers that don’t exist.

```auto
mangoh@mangoh-virtualbox:~/leaf$ leaf shell
Leaf Shell /bin/bash started in Leaf environment.

(lsh:profile1) mangoh@mangoh-virtualbox:~/leaf$ echo $MACH
mdm9x06

```

---

<div class="post-metadata">

**Author:** ![mehdiALL1](https://avatars.discourse-cdn.com/v4/letter/m/f6c823/32.png) [@mehdiALL1](https://forum.legato.io/u/mehdiALL1)\
**Post date:** [September 4, 2019, 9:03am UTC](https://forum.legato.io/t/leaf-swi-linux-wp77xx/4554/5 "2019-09-04T09:03:36Z")

</div>

@shib,  
What did you want to build exactly with Leaf? Linux source (Yocto) is not existing under Leaf? there is only the .cwe

```
(lsh:SWI-WP77) user@ITE00174:~/leafworkspace/leaf-data/current/wp77-linux-image$ ll
total 28956
drwxr--r-- 2 user user 4096 avril 25 00:26 ./
drwxrwxr-x 43 user user 4096 sept. 4 10:06 ../
-rw-r--r-- 1 user user 29634972 avril 25 00:26 linux.cwe
-rw-r--r-- 1 user user 443 avril 25 00:26 manifest.json

```

And in my manifest, I don’t have “MACH is an mdm9x06 and the LINUX\_IMAGES and SYSROOT”

```
(lsh:SWI-WP77) user@ITE00174:~/leafworkspace/leaf-data/current/wp77-linux-image$ cat manifest.json
{
    "env": {
        "WP77XX_LINUX_IMAGES": "@{DIR}"
    },
    "info": {
        "name": "wp77-linux-image",
        "version": "SWI9X06Y_02.22.12.00",
        "description": "Linux Image for WP77",
        "date": "Wed Apr 24 22:26:24 UTC 2019",
        "requires": [
            "swi-license_1.1",
            "swi-verify-license_latest"
        ],
        "tags": [
            "wp77xx"
        ],
        "leafMinVersion": "1.6"
    }

```

---

<div class="post-metadata">

**Author:** ![shib](https://avatars.discourse-cdn.com/v4/letter/s/f6c823/32.png) [@shib](https://forum.legato.io/u/shib)\
**Post date:** [September 4, 2019, 11:46pm UTC](https://forum.legato.io/t/leaf-swi-linux-wp77xx/4554/6 "2019-09-04T23:46:04Z")

</div>

Hi Mehdi,

The instructions to get the Linux source through leaf are in the docs.  
When you get the Linux source through leaf it creates: `leaf-data/profile/wp77-linux-src/manifest.json`  
That manifest.json file contains the following:

```auto
{
    "install": [
        {
            "command": [
                "/bin/sh",
                "-c",
                "/bin/sh $LEAF_PREREQ_ROOT/swi-verify-license_latest/postinstall.sh @{NAME} @{VERSION}"
            ],
            "verbose": true,
            "ignoreFail": true
        }
    ],
    "sync": [
        {
            "command": [
                "@{DIR:swi-cloneutils_latest}/swi-clone",
                "-s",
                "swi-linux",
                "-Im",
                "wp77xx",
                "-It",
                "external",
                "-Iv",
                "SWI9X06Y_02.22.12.00",
                "-Ip",
                "mdm9x06"
            ],
            "verbose": true
        }
    ],
    "env": {
        "MACH": "${MACH:-mdm9x06}",
        "WP77XX_LINUX_IMAGES": "${SWI_LINUX_CLONE}/build_bin/tmp/deploy/images/swi-mdm9x06-wp",
        "WP77XX_TOOLCHAIN_DIR": "${SWI_LINUX_CLONE}/build_bin/tmp/sysroots/`uname -m`-linux/usr/bin/arm-poky-linux-gnueabi",
        "WP77XX_TOOLCHAIN_PREFIX": "arm-poky-linux-gnueabi-",
        "WP77XX_SYSROOT": "${SWI_LINUX_CLONE}/build_bin/tmp/sysroots/swi-mdm9x06-wp"
    },
    "info": {
        "name": "wp77-linux-src",
        "version": "SWI9X06Y_02.22.12.00",
        "description": "Linux distribution source code metadata and prerequisites",
        "date": "Wed Jun 5 14:58:29 UTC 2019",
        "requires": [
            "swi-license_1.1",
            "swi-verify-license_latest",
            "swi-aptdeps-linux-src_1.0",
            "swi-verify-aptdeps_latest"
        ],
        "depends": [
            "swi-cloneutils_latest"
        ],
        "tags": [
            "wp77xx"
        ],
        "leafMinVersion": "1.6"
    }
}

```

---

<div class="post-metadata">

**Author:** ![CoRfr](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.legato.io/corfr/32/69_2.png) [@CoRfr](https://forum.legato.io/u/CoRfr)\
**Post date:** [September 5, 2019, 5:32am UTC](https://forum.legato.io/t/leaf-swi-linux-wp77xx/4554/7 "2019-09-05T05:32:11Z")

</div>

> [@shib](#):
>
> “MACH”: “${MACH:-mdm9x06}”,

Right, and that declaration doesn’t work. We should be using `MACH=mdm9x28` for wp77.
