Can I use Linux kernel image even after this build failure - linux

I am new to Linux Kernel and trying to build my first Kernel image, I am building from 3.4.28 Linux Kernel on i686 Architecture for 32 bit.
After one and half hours of build process, I got the following errors
BUILD arcarch/x86/boot/compressedh/x86/boot/bzImage
Setup is 16540 bytes (padded to 16896 bytes).
System is 4667 kB
CRC c2376a1f
Kernel: arch/x86/boot/bzImage is ready (#1)
Building modules, stage 2.
MODPOST 3508 modules
ERROR: "__sync_fetch_and_and_4" [drivers/staging/line6/line6usb.ko] undefined!
ERROR: "__sync_fetch_and_or_4" [drivers/staging/line6/line6usb.ko] undefined!
WARNING: modpost: Found 28 section mismatch(es).
To see full details build your kernel with:
'make CONFIG_DEBUG_SECTION_MISMATCH=y'
make[1]: *** [__modpost] Error 1
make: *** [modules] Error 2
But if I go and look in the "arch/x86/boot/compressed" directory, I find vmlinux.bin image with ELF header.
I wanted to know can I use this vmlinux binary for my purpose or is a complete successful build required to make this binary fully functional.

As long as nothing relies on the kernel module line6usb.ko or any modules built after it you are likely ok.

My answer is also same as JimR; the kernel module line6usb.ko is not so much important module. Firstly disable this module by first running mrproper then after make menuconfig.
In the menuconfig find the driver in drivers staging and disable it. Later again cross compile the kernel.

disable the module in kernel configuration.
by choosing like this
device drivers ----
staging drivers

Related

Arch Linux: make - no such file or directory

I have a problem by compiling a driver (WLAN-dongle Edimax ac600).
I´m using an Archlinux on my raspberry-pi and want to install my dongle for 5Ghz. During comiling the driver I get this message. I tried to install the linux-headers without success. (in other threads it will be a solution)
Here is my output of make:
[root#raspberry_pi_1 rtl8812AU]# make make ARCH=arm CROSS_COMPILE= -C
/lib/modules/4.9.43-1-ARCH/build M=/root/rtl8812AU modules make[1]:
*** /lib/modules/4.9.43-1-ARCH/build: No such file or directory. Stop. make: *** [Makefile:1576: modules] Error 2
I found out that my pi has a two-arch...-directories:
4.9.43-1-ARCH/
4.9.51-1-ARCH/
Only the second one has the build directory...
How can I fix the problem?!
thanks a lot,
a Linux noob...
[Reputation is too low to post comment]
Use uname -r to make sure which version of the kernel you use.
If it's 4.9.43 : you have newer version of the kernel and this confuse your installer. You should reboot on the 51 one
If it's 4.9.51 : You messed up your installation step and are trying to compile for an old target. You should review the compilation process and change every mention of the 4.9.43 to 4.9.51 since it's the version you use.
If you upgrade your kernel, you may have to rebuild the thing again (You may like to have script in the future ;) ) with the new kernel version.

Can't figure out how to compile Linux kernel module

I have been trying to figure out how to compile a kernel module. I started with http://www.tldp.org/LDP/lkmpg/2.6/lkmpg.pdf to learn. I then found Compiling a kernel module, header problems, makefile problems to get my makefile going. After running make. I get the following output:
Building target module 2.6 kernel.
PLEASE IGNORE THE "Overriding SUBDIRS" WARNING
make -C /lib/modules/2.6.32-431.el6.i686/build SUBDIRS=/root/kerntest/hello modules
make[1]: Entering directory `/usr/src/kernels/2.6.32-431.20.3.el6.i686'
Building modules, stage 2.
MODPOST 1 modules
make[1]: Leaving directory `/usr/src/kernels/2.6.32-431.20.3.el6.i686'
I see the .ko file, but don't see any kernel messages showing the module was activated. I also checked in /lib/modules/2.6.32-431.20.3.el6.i686/extra but there is nothing there. I also tried 'dmesg' and 'lsmod' but didn't see it.
Can anyone point me in the right direction?
I am trying this on CentOS 6.5
You need to actually load the module into the kernel after compiling by using insmod or modprobe :)

Cross compiled ARM Kernel instead of ARMHF

However I Cross Compiled ARM Kernel instead of ARMHF(for my Cubietruck). I followed this tutorial:
https://romanrm.net/a10/cross-compile-kernel
How can I determine for which architecture I´m cross-compiling?
i got a new error that /linux/utsrealease.h is not found
from above comment as you mentioned.. from that its clear that kernel module which your building must match with running kernel version . As kernel modules loading mechanism doesn't allow loading modules that were not compiled against the running kernel, due to mismatch error is coming.
The macro UTS_RELEASE is required by your driver in order to rebuild
kernel modules from source.
retrieving the version string constant,
older versions require you to include<linux/version.h>,
others <linux/utsrelease.h>,
and newer ones <generated/utsrelease.h>
So my suggestion you do workaround by doing
you can find utsrelease.h in kernel source code make sure your running kernel must match with your source-code
copy linux-x.x.x/include/generated/utsrelease.h to installed header i.e ../include/linux/utsrelease.h
Im not sure give a try .
If above doesnot work pls update your question with
1)which kernel sourcode version you have
2)Whats the kernel version running on target
When you compile your kernel, mention the architecture you are compiling for in:
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- EXTRAVERSION=-custom1 uImage
For eg, here ARCH=arm, so you are compiling for ARM, if it's x86, then you'll replace it with x86. Check what architecture your target board is on.
EDIT: gnueabihf is for armhf.

compiling kernel -- 3.9.4 -- issues

I have a desktop on which fedora linux is installed. Kernel i am using is 3.9.4 .
I need to recompile my 3.9.4 kernel for CAN bus support.
My kernel source is here :---
[root#localhost 3.9.4-200.fc18.x86_64]# pwd
/usr/src/kernels/3.9.4-200.fc18.x86_64
Then i did -- make menuconfig, -- changed the configuration.
Error i get after -- make.
[root#localhost 3.9.4-200.fc18.x86_64]# make
make[1]: *** No rule to make target `/usr/src/kernels/3.9.4-200.fc18.x86_64/arch/x86/syscalls/syscall_32.tbl', needed by `arch/x86/syscalls/../include/generated/uapi/asm/unistd_32.h'. Stop.
make: *** [archheaders] Error 2
How to get rid of this error to compile my kernel ?
You need to get the entire source tree for the kernel. /usr/src/kernels/3.9.4-200.fc18.x86_64/ does not contain the entire source for the Fedora kernel, it only contains headers and makefiles for building additional modules.
You can either get the source rpm for that kernel and rebuild it. Or get a mainline kernel directly from kernel.org and build it.

error when building 32-bit linux kernel on 64-bit linux host

I am trying to build 32-bit linux kernel 2.6.9 on a 64-bit linux host with 2.6.9 (same version). Did some google search and tried the following:
step 1) make ARCH=i386 CFLAGS=-m32 menuconfig
step 2) make ARCH=i386 CFLAGS=-m32
Step 1 was okay. But step 2 got the following errors. What did I do wrong?
make ARCH=i386 CFLAGS=-m32
< snip >
In file included from include/asm/smp.h:18,
from include/linux/smp.h:17,
from include/linux/sched.h:23,
from arch/i386/kernel/asm-offsets.c:7:
include/asm/mpspec.h:6:25: mach_mpspec.h: No such file or directory
In file included from include/asm/smp.h:18,
from include/linux/smp.h:17,
from include/linux/sched.h:23,
from arch/i386/kernel/asm-offsets.c:7:
include/asm/mpspec.h:8: error: `MAX_MP_BUSSES' undeclared here (not in a function)
include/asm/mpspec.h:22: error: `MAX_IRQ_SOURCES' undeclared here (not in a function)
In file included from include/linux/smp.h:17,
from include/linux/sched.h:23,
from arch/i386/kernel/asm-offsets.c:7:
include/asm/smp.h:72:26: mach_apicdef.h: No such file or directory
make[1]: *** [arch/i386/kernel/asm-offsets.s] Error 1
make: *** [arch/i386/kernel/asm-offsets.s] Error 2
The make ARCH=i386 should be sufficient assuming you have everything required by the build installed on the machine. I use this almost daily to build i386 on a "ubuntu 12.04".
If you have built a 64-bit kernel previously, you should have everything, and it's possible that you need to "make clean" or even "make mrproper" [save your .config somewhere safe for the latter], because I know for example asm_offsets.s will be different between 32 and 64-bit.

Resources