# Issue with Building Linux Kernel Single module

**URL:** <https://forum.sierrawireless.com/t/issue-with-building-linux-kernel-single-module/9800>\
**Category:** WP Series\
**Created:** [February 9, 2018, 7:13am UTC](https://forum.sierrawireless.com/t/issue-with-building-linux-kernel-single-module/9800 "2018-02-09T07:13:05Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![yogeshtyagi](https://avatars.discourse-cdn.com/v4/letter/y/5f9b8f/32.png) [@yogeshtyagi](https://forum.sierrawireless.com/u/yogeshtyagi)\
**Post date:** [February 9, 2018, 7:13am UTC](https://forum.sierrawireless.com/t/issue-with-building-linux-kernel-single-module/9800/1 "2018-02-09T07:13:05Z")

</div>

Hi,

I downloaded Legato Linux Distribution Legato-Dist-Source-mdm9x28-SWI9X07Y\_02.09.02.00.tar.bz2 . I extracted this distro. I also have toolchain installed in my machine. I am build for WP76 module.  
I am trying to build only serial module with following command in Kernel directory:

make ARCH=arm CROSS\_COMPILE=/opt/swi/y22-ext/sysroots/i686-pokysdk-linux/usr/bin/arm-poky-linux-gnueabi- M=drivers/usb/serial/

But I am stuck at following error:

ERROR: Kernel configuration is invalid.  
include/generated/autoconf.h or include/config/auto.conf are missing.  
Run ‘make oldconfig && make prepare’ on kernel src to fix it.

WARNING: Symbol version dump ./Module.symvers  
is missing; modules will have no dependencies and modversions.

LD drivers/usb/serial/built-in.o  
Building modules, stage 2.  
./scripts/Makefile.modpost:42: include/config/auto.conf: No such file or directory  
make[1]: \*\*\* No rule to make target `include/config/auto.conf’. Stop.  
make: \*\*\* [modules] Error 2

And if I run

make ARCH=arm CROSS\_COMPILE=/opt/swi/y22-ext/sysroots/i686-pokysdk-linux/usr/bin/arm-poky-linux-gnueabi/arm-poky-linux-gnueabi-

then I get following error:

arch/arm/kernel/hibernate.c: In function ‘swsusp\_arch\_suspend’:  
arch/arm/kernel/hibernate.c:82:9: error: too many arguments to function ‘cpu\_suspend’  
return cpu\_suspend(0, arch\_save\_image);  
^ ~~~~~~~~~~  
In file included from arch/arm/kernel/hibernate.c:22:0:  
./arch/arm/include/asm/suspend.h:10:12: note: declared here  
extern int cpu\_suspend(unsigned long);  
^ ~~~~~~~~~~  
make[1]: \*\*\* [arch/arm/kernel/hibernate.o] Error 1  
make: \*\*\* [arch/arm/kernel] Error 2

Can someone please help?

Thanks,  
Yogesh

---

<div class="post-metadata">

**Author:** ![yogeshtyagi](https://avatars.discourse-cdn.com/v4/letter/y/5f9b8f/32.png) [@yogeshtyagi](https://forum.sierrawireless.com/u/yogeshtyagi)\
**Post date:** [February 12, 2018, 7:20am UTC](https://forum.sierrawireless.com/t/issue-with-building-linux-kernel-single-module/9800/2 "2018-02-12T07:20:39Z")

</div>

Hi,

I am able to build to build the image with “make image” command in yocto folder. But now build is failing at the last step while creating the image. Below is the log:

make image  
Makefile:30: “Legato: build disabled since ‘/home/warlord/legato\_source/yocto/legato/’ does not exist”  
“meta-swi-extras/build.sh” -p poky/ -o meta-openembedded/ -l meta-swi -x “kernel/.git” -j 9 -t 9 -a “LK\_REPO=”/home/warlord/legato\_source/yocto/lk"" -m swi-mdm9x28 -b build\_bin -q  
Poky dir: /home/warlord/legato\_source/yocto/poky  
OE meta: /home/warlord/legato\_source/yocto/meta-openembedded  
SWI meta dir: /home/warlord/legato\_source/yocto/meta-swi  
Linux repo dir: /home/warlord/legato\_source/yocto/kernel/.git  
Number of make threads 9  
Number of bitbake tasks 9  
Extra options added - LK\_REPO=/home/warlord/legato\_source/yocto/lk  
SWI machine: swi-mdm9x28  
Build dir: /home/warlord/legato\_source/yocto/build\_bin  
Enable Qualcomm Proprietary bin

### Shell environment set up for builds.

You can now run 'bitbake ’

Common targets are:  
core-image-minimal  
core-image-sato  
meta-toolchain  
adt-installer  
meta-ide-support

You can also run generated qemu images with a command like ‘runqemu qemux86’

- layer: meta-swi-mdm9xxx
- layer: meta-swi-mdm9x28
- layer: meta-swi/common
- layer: meta-oe
- layer: meta-networking
- layer: meta-python
- layer: meta-swi-extras/meta-swi-mdm9x28-bin
- layer: meta-swi-extras/common
- layer: meta-swi-extras/meta-swi-mdm9x28  
Updating LEGATO\_BUILD to false  
Updating ROOTFS\_VERSION to  
Updating LK\_REPO to /home/warlord/legato\_source/yocto/lk  
Updating INITRAMFS\_IMAGE\_BUNDLE to 1  
Updating INITRAMFS\_IMAGE to mdm9x28-image-initramfs  
Updating FIRMWARE\_PATH to  
Build image of minimal rootfs (for swi-mdm9x28).  
Loading cache: 100% |###############################################################################################################################| ETA: 00:00:00  
Loaded 2102 entries from dependency cache.  
Parsing recipes: 100% |#############################################################################################################################| Time: 00:00:37  
Parsing of 1627 .bb files complete (1625 cached, 2 parsed). 2103 targets, 202 skipped, 0 masked, 0 errors.  
NOTE: Resolving any missing task queue dependencies  
NOTE: multiple providers are available for runtime gps-utils (gps-utils, gpsd)  
NOTE: consider defining a PREFERRED\_PROVIDER entry to match gps-utils  
NOTE: multiple providers are available for jpeg-native (jpeg-native, libjpeg-turbo-native)  
NOTE: consider defining a PREFERRED\_PROVIDER entry to match jpeg-native

Build Configuration:  
BB\_VERSION = “1.24.0”  
BUILD\_SYS = “x86\_64-linux”  
NATIVELSBSTRING = “Ubuntu-14.04”  
TARGET\_SYS = “arm-poky-linux-gnueabi”  
MACHINE = “swi-mdm9x28”  
DISTRO = “poky-swi-ext”  
DISTRO\_VERSION = “1.7.3”  
TUNE\_FEATURES = “arm armv7a vfp neon”  
TARGET\_FPU = “vfp-neon”  
meta  
meta-yocto  
meta-yocto-bsp = “(nobranch):c282df8993828bd7b1d50cfcf637a477eaf481a1”  
meta-python  
meta-networking  
meta-oe = “(nobranch):70beecb2716bca1b9dfbc7d6a264233e1f05e82b”  
common  
meta-swi-mdm9xxx  
meta-swi-mdm9x28 = “master:95d759c58243a20e19c92039a13acb6de29bf6b9”  
meta-swi-mdm9x28  
common  
meta-swi-mdm9x28-bin  
meta-swi-mdm9x28  
common = “master:341909ed82cbcf113693825e1d42fbaf1e0ce315”

NOTE: Preparing runqueue  
NOTE: Executing SetScene Tasks  
NOTE: Executing RunQueue Tasks  
ERROR: Error: The image creation script ‘/home/warlord/legato\_source/yocto/build\_bin/tmp/work/swi\_mdm9x28-poky-linux-gnueabi/mdm9x28-image-minimal/1.0-r0.0/temp/create\_image.2k.yaffs2’ returned 127:  
/home/warlord/legato\_source/yocto/build\_bin/tmp/work/swi\_mdm9x28-poky-linux-gnueabi/mdm9x28-image-minimal/1.0-r0.0/temp/create\_image.2k.yaffs2: line 106: mkyaffs2image: command not found  
WARNING: /home/warlord/legato\_source/yocto/build\_bin/tmp/work/swi\_mdm9x28-poky-linux-gnueabi/mdm9x28-image-minimal/1.0-r0.0/temp/create\_image.2k.yaffs2:1 exit 127 from  
mkyaffs2image /home/warlord/legato\_source/yocto/build\_bin/tmp/work/swi\_mdm9x28-poky-linux-gnueabi/mdm9x28-image-minimal/1.0-r0.0/rootfs /home/warlord/legato\_source/yocto/build\_bin/tmp/deploy/images/swi-mdm9x28/mdm9x28-image-minimal-swi-mdm9x28-20180212063538.rootfs.2k.yaffs2

ERROR: Function failed: do\_rootfs  
ERROR: Logfile of failure stored in: /home/warlord/legato\_source/yocto/build\_bin/tmp/work/swi\_mdm9x28-poky-linux-gnueabi/mdm9x28-image-minimal/1.0-r0.0/temp/log.do\_rootfs.584  
ERROR: Task 9 (/home/warlord/legato\_source/yocto/meta-swi/meta-swi-mdm9x28/recipes-core/images/mdm9x28-image-minimal.bb, do\_rootfs) failed with exit code ‘1’  
NOTE: Tasks Summary: Attempted 2101 tasks of which 2098 didn’t need to be rerun and 1 failed.  
No currently running tasks (2100 of 2886)

Summary: 1 task failed:  
/home/warlord/legato\_source/yocto/meta-swi/meta-swi-mdm9x28/recipes-core/images/mdm9x28-image-minimal.bb, do\_rootfs  
Summary: There were 2 ERROR messages shown, returning a non-zero exit code.  
make: \*\*\* [image\_bin] Error 1

Can someone provide some insight?

Thanks,  
Yogesh

---

<div class="post-metadata">

**Author:** ![mmcmillan](https://avatars.discourse-cdn.com/v4/letter/m/22d042/32.png) [@mmcmillan](https://forum.sierrawireless.com/u/mmcmillan)\
**Post date:** [August 30, 2018, 2:09pm UTC](https://forum.sierrawireless.com/t/issue-with-building-linux-kernel-single-module/9800/3 "2018-08-30T14:09:35Z")

</div>

I’ve been fighting with the same problem. I’m still trying to track down why the mkyaffs2image command isn’t found. I did discover if I run make image\_bin a second time the build finishes. Seems like the build scripts don’t know where to find mkyaffs2image until the second run.

---

<div class="post-metadata">

**Author:** ![mmcmillan](https://avatars.discourse-cdn.com/v4/letter/m/22d042/32.png) [@mmcmillan](https://forum.sierrawireless.com/u/mmcmillan)\
**Post date:** [August 31, 2018, 1:44pm UTC](https://forum.sierrawireless.com/t/issue-with-building-linux-kernel-single-module/9800/4 "2018-08-31T13:44:25Z")

</div>

Updating to the newest toolchain and yocto source fixed the issue for me. I think the older toolchain script wasn’t building something correctly.
