# Rebuild legato images inside yocto

**URL:** <https://forum.legato.io/t/rebuild-legato-images-inside-yocto/3271>\
**Category:** Uncategorized\
**Created:** [May 13, 2018, 12:44am UTC](https://forum.legato.io/t/rebuild-legato-images-inside-yocto/3271 "2018-05-13T00:44:45Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![zx81](https://avatars.discourse-cdn.com/v4/letter/z/9e8a1a/32.png) [@zx81](https://forum.legato.io/u/zx81)\
**Post date:** [May 13, 2018, 12:44am UTC](https://forum.legato.io/t/rebuild-legato-images-inside-yocto/3271/1 "2018-05-13T00:44:45Z")

</div>

hi all!

I have yocto extracted from Legato-Dist-Source-mdm9x28-SWI9X07Y\_02.16.02.00.tar.bz2  
there is legato dir inside from legato-18.03.0.tar.bz2

This combination produces yocto\_wp76xx.4k.cwe and legato-image.wp76xx.cwe.  
Which one is for flashing into my wp7607-1 device?

After some changes in legato subdir (i.e. enabling example.ko module) I need to regenerate cwe images.  
How to it wthout recompilig the whole world?

The similar question is the almost same: how to regenerate image after recompiling kernel?

---

<div class="post-metadata">

**Author:** ![jyijyi](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.legato.io/jyijyi/32/822_2.png) [@jyijyi](https://forum.legato.io/u/jyijyi)\
**Post date:** [May 13, 2018, 6:22am UTC](https://forum.legato.io/t/rebuild-legato-images-inside-yocto/3271/2 "2018-05-13T06:22:57Z")

</div>

Is it ok to go to legato folder and tye the following?  
./bin/legs  
make wp76xx

---

<div class="post-metadata">

**Author:** ![zx81](https://avatars.discourse-cdn.com/v4/letter/z/9e8a1a/32.png) [@zx81](https://forum.legato.io/u/zx81)\
**Post date:** [May 13, 2018, 8:04am UTC](https://forum.legato.io/t/rebuild-legato-images-inside-yocto/3271/3 "2018-05-13T08:04:05Z")

</div>

answer is : no

legato is not build in “yocto/legato”, there is no “bin” directory inside it,  
there should be some bitbake command for doing this, but I can’t find it…

as an option I can put legato standalone somwhere else,  
but legato uses outdated kernel

so the question is:  
where from legato gets the kernel and modules ??? how to change it

---

<div class="post-metadata">

**Author:** ![jyijyi](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.legato.io/jyijyi/32/822_2.png) [@jyijyi](https://forum.legato.io/u/jyijyi)\
**Post date:** [May 13, 2018, 11:30am UTC](https://forum.legato.io/t/rebuild-legato-images-inside-yocto/3271/4 "2018-05-13T11:30:39Z")

</div>

Here it says it is inside the toolchain if you build the legato standalone.

> **[Install the Toolchain - Legato Docs](http://docs.legato.io/latest/basicBuildToolchain.html)**
>
> legato™ is an open source Linux-based embedded platform designed to simplify connected IoT application development

---

<div class="post-metadata">

**Author:** ![zx81](https://avatars.discourse-cdn.com/v4/letter/z/9e8a1a/32.png) [@zx81](https://forum.legato.io/u/zx81)\
**Post date:** [May 13, 2018, 11:58am UTC](https://forum.legato.io/t/rebuild-legato-images-inside-yocto/3271/5 "2018-05-13T11:58:02Z")

</div>

/opt/swi/y22-ext/sysroots/armv7a-neon-poky-linux-gnueabi/usr/src/kernel contains only scripts and headers for making external modules …

where are binaries used by legato to make image??

---

<div class="post-metadata">

**Author:** ![jyijyi](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.legato.io/jyijyi/32/822_2.png) [@jyijyi](https://forum.legato.io/u/jyijyi)\
**Post date:** [May 14, 2018, 1:25am UTC](https://forum.legato.io/t/rebuild-legato-images-inside-yocto/3271/6 "2018-05-14T01:25:47Z")

</div>

Didn’t “/opt/swi/y17-ext/sysroots/armv7a-vfp-neon-poky-linux-gnueabi/usr/src/kernel/drivers” contain the kernel drivers source code?  
which driver .ko are you referring to in legato image?

---

<div class="post-metadata">

**Author:** ![zx81](https://avatars.discourse-cdn.com/v4/letter/z/9e8a1a/32.png) [@zx81](https://forum.legato.io/u/zx81)\
**Post date:** [May 14, 2018, 3:45am UTC](https://forum.legato.io/t/rebuild-legato-images-inside-yocto/3271/7 "2018-05-14T03:45:50Z")

</div>

/opt/swi…/kernel does not contain full source code

I’m not trying to compile a new kernel module now,  
I know how to do it

I just want to change kernel (and modules) binary in legato distribution,

---

<div class="post-metadata">

**Author:** ![jyijyi](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.legato.io/jyijyi/32/822_2.png) [@jyijyi](https://forum.legato.io/u/jyijyi)\
**Post date:** [May 14, 2018, 4:38am UTC](https://forum.legato.io/t/rebuild-legato-images-inside-yocto/3271/8 "2018-05-14T04:38:06Z")

</div>

Can you tell which kernel module are you referring to?  
I look into default.sdef, I don’t see it is including any kernel driver.  
Also in case I search inside the legato framework folder, I don’t see any .ko file.

---

<div class="post-metadata">

**Author:** ![zx81](https://avatars.discourse-cdn.com/v4/letter/z/9e8a1a/32.png) [@zx81](https://forum.legato.io/u/zx81)\
**Post date:** [May 14, 2018, 4:48am UTC](https://forum.legato.io/t/rebuild-legato-images-inside-yocto/3271/9 "2018-05-14T04:48:35Z")

</div>

please see my post here: [Correct way to configure and rebuild kernel - mangOH Green - mangOH forum](https://forum.mangoh.io/t/correct-way-to-configure-and-rebuild-kernel/1406)

I’ve already rebuild whole system: kernel,modules,filesystem  
Then created my.spk file like with something like this:  
swicwe -o my.spk -c modemFW.spk mcuFW.cwe appsboot\_wp76xx.cwe legato.cwe

Then flashed it with swiflash.

- where is kernel binary in this image?
- how to update it (in image) without recompilong everything?

---

<div class="post-metadata">

**Author:** ![jyijyi](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.legato.io/jyijyi/32/822_2.png) [@jyijyi](https://forum.legato.io/u/jyijyi)\
**Post date:** [May 14, 2018, 4:53am UTC](https://forum.legato.io/t/rebuild-legato-images-inside-yocto/3271/10 "2018-05-14T04:53:35Z")

</div>

Does " my.spk " contain the kernel module you want?  
Or you still need to download the yocto.cwe image?

---

<div class="post-metadata">

**Author:** ![zx81](https://avatars.discourse-cdn.com/v4/letter/z/9e8a1a/32.png) [@zx81](https://forum.legato.io/u/zx81)\
**Post date:** [May 14, 2018, 4:58am UTC](https://forum.legato.io/t/rebuild-legato-images-inside-yocto/3271/11 "2018-05-14T04:58:39Z")

</div>

in yocto/build\_bin/tmp/deploy/images/swi-mdm9x28 there are such cwe files:  
appsboot\_wp76xx.cwe appsboot\_wp77xx.cwe legato-image.wp76xx.cwe legato-image.wp77xx.cwe yocto\_wp76xx.4k.cwe yocto\_wp77xx.4k.cwe

Is there any documentation explaining what is inside them?

Do I need to flash both legato.cwe and yocto\_wp76xx.4k.cwe ???

---

<div class="post-metadata">

**Author:** ![jyijyi](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.legato.io/jyijyi/32/822_2.png) [@jyijyi](https://forum.legato.io/u/jyijyi)\
**Post date:** [May 14, 2018, 5:04am UTC](https://forum.legato.io/t/rebuild-legato-images-inside-yocto/3271/12 "2018-05-14T05:04:44Z")

</div>

you can use swicwe -P option to see what is inside the cwe file.  
You need to flash both legato.cwe and yocto.cwe in case you need to update the legato framework partition and yocto linux partition.

---

<div class="post-metadata">

**Author:** ![zx81](https://avatars.discourse-cdn.com/v4/letter/z/9e8a1a/32.png) [@zx81](https://forum.legato.io/u/zx81)\
**Post date:** [May 14, 2018, 5:14am UTC](https://forum.legato.io/t/rebuild-legato-images-inside-yocto/3271/13 "2018-05-14T05:14:59Z")

</div>

Thanks a lot. It explains my misunderstanding
