# Correct way to configure and rebuild kernel

**URL:** <https://mangoh.discourse.group/t/correct-way-to-configure-and-rebuild-kernel/1406>\
**Category:** mangOH Green\
**Created:** [May 11, 2018, 9:36am UTC](https://mangoh.discourse.group/t/correct-way-to-configure-and-rebuild-kernel/1406 "2018-05-11T09:36:50Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![zx81](https://avatars.discourse-cdn.com/v4/letter/z/9e8a1a/32.png) [@zx81](https://mangoh.discourse.group/u/zx81)\
**Post date:** [May 11, 2018, 9:36am UTC](https://mangoh.discourse.group/t/correct-way-to-configure-and-rebuild-kernel/1406/1 "2018-05-11T09:36:50Z")

</div>

Hello there.  
I need to make some configuration and probably dtb changes in legato kernel  
for my mangoh + wp7607-1.

Is there any tutorial how to do it?

It takes a lot of time to rebuild everything.

An always there ares some issues.

1. poky-swi-ext-glibc-x86\_64-meta-~neon-toolchain-swi-ext-2.2.3.sh│  
downloaded version and the one generated by me complains about some modules

scripts/kconfig/conf --silentoldconfig Kconfig  
drivers/soc/qcom/Kconfig:368:warning: choice value used outside its choice group  
drivers/soc/qcom/Kconfig:373:warning: choice value used outside its choice group  
warning: (SND\_SOC\_QDSP6V2) selects SND\_SOC\_MSM\_QDSP6V2\_INTF which has unmet direct dependencies (SOUND && !M68K && !UML && SND && SND\_SOC && MSM\_QDSP6\_APRV2)  
warning: (SND\_SOC\_QDSP6V2) selects SND\_SOC\_MSM\_QDSP6V2\_INTF which has unmet direct dependencies (SOUND && !M68K && !UML && SND && SND\_SOC && MSM\_QDSP6\_APRV2)  
make -f ./scripts/Makefile.build obj=scripts/basic  
…

1. [Error while Kernel configuration using menuconfig](https://mangoh.discourse.group/t/error-while-kernel-configuration-using-menuconfig/960)  
menuconfig window opens with"Linux/x86 4.8.26 Kernel Configuration"

2. is mdm9607\_defconfig used for build it ???

3. building example kernel module with legato-18.03.0 fails like this:  
Modelling module defined in: ‘/home/user/sierra/legato-18.03.0/drivers/mangoh/mangoh.mdef’  
\*\* ERROR:  
/home/user/sierra/legato-18.03.0/drivers/mangoh/mangoh.mdef: error: ‘usr/src/kernel’ is not a valid kernel source directory.

where to define KDIR ???

1. [Build Linux for wp76](https://mangoh.discourse.group/t/build-linux-for-wp76/1084)  
method with bitbake linux-quic seem sto outdated,  
and Legato-Dist-Source-mdm9x28-SWI9X07Y\_02.16.02.00.tar.bz2 does not contain build\_src

2. by the way Legato-Dist… and “make image\_bin” produces old version of legato

---

<div class="post-metadata">

**Author:** ![zx81](https://avatars.discourse-cdn.com/v4/letter/z/9e8a1a/32.png) [@zx81](https://mangoh.discourse.group/u/zx81)\
**Post date:** [May 12, 2018, 8:06am UTC](https://mangoh.discourse.group/t/correct-way-to-configure-and-rebuild-kernel/1406/2 "2018-05-12T08:06:17Z")

</div>

well after a long compilation night, finally it works:

here are correct steps in correct order:

```
tar jxf net/Legato-Dist-Source-mdm9x28-SWI9X07Y_02.16.02.00.tar.bz2
cd yocto
make image_bin

. /poky/oe-init-build-env
cd ../build_bin #this is important!

bitbake -c listtasks linux-quic
bitbake -c menuconfig linux-quic
# I also need to modify also some Kconfig to select items not shown in menu
cp tmp/work/swi_mdm9x28-poky-linux-gnueabi/linux-quic/3.18.44-r1/build/.config \ 
       ../kernel/arch/arm/configs/mdm9607_defconfig

cd ..
make image_bin
make toolchain

```

and finaly

- generated poky-swi-ext-glibc-x86\_64-meta-~neon-toolchain-swi-ext-2.2.3.sh installs correct
- I can generate example.ko with  
./bin/legs  
make wp76xx

---

<div class="post-metadata">

**Author:** ![CoRfr](https://avatars.discourse-cdn.com/v4/letter/c/b19c9b/32.png) [@CoRfr](https://mangoh.discourse.group/u/CoRfr)\
**Post date:** [May 15, 2018, 8:39pm UTC](https://mangoh.discourse.group/t/correct-way-to-configure-and-rebuild-kernel/1406/3 "2018-05-15T20:39:38Z")

</div>

Another way to get into a ‘bitbake-ready’ environment is to run `make dev_bin` (or `make dev`).
