art6050
Posts: 1
Joined: Wed Feb 10, 2016 6:45 pm

Building Kernel

Wed Feb 10, 2016 6:49 pm

Hi,

I am trying to build kernel for raspberry according to https://www.raspberrypi.org/documentati ... uilding.md.

This command:

Code: Select all

make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- zImage modules dtbs
gives this error:

Code: Select all

make[1]: `include/generated/mach-types.h' is up to date.  CHK     include/generated/bounds.h
  CC      arch/arm/kernel/asm-offsets.s
In file included from include/linux/spinlock.h:87:0,
                 from include/linux/seqlock.h:35,
                 from include/linux/time.h:5,
                 from include/uapi/linux/timex.h:56,
                 from include/linux/timex.h:56,
                 from include/linux/sched.h:19,
                 from arch/arm/kernel/asm-offsets.c:14:
./arch/arm/include/asm/spinlock.h:8:28: fatal error: linux/prefetch.h: No such file or directory
 #include <linux/prefetch.h>
                            ^
compilation terminated.
make[1]: *** [arch/arm/kernel/asm-offsets.s] Error 1
make: *** [prepare0] Error 2
How can I fix it?

User avatar
bodge99
Posts: 20
Joined: Tue Mar 08, 2016 7:09 pm

Re: Building Kernel

Fri Apr 01, 2016 2:54 pm

Hi,

I'm unsure if this is the problem... as I've not compiled a kernel for the Pi yet, but I remember something similar when I was looking at modding a bespoke (buggy) driver written for kernel 2.x to 4.2 .

The code was looking for a prefetch.h in /linux/prefetch.h whereas it should have been written as /include/linux/prefetch.h .

I seem to remember finding out that the driver's author had symlinked the relevant file as a "quick fix" aka bodge.

Hope this helps...

Bodge99.

neilo24
Posts: 1
Joined: Thu Apr 21, 2016 9:41 am

Re: Building Kernel

Thu Apr 21, 2016 9:57 am

Hello,
I want to recompile the kernel with specific module related to camera application only and rest of the module which is un necessary want to exclude from the system. is it possible....??? if it is possible how it could be?? whats works i need to do??
what research required?? I have connect the RPi with modem and remotely access by means of xming and putty software. so basically my question is regarding optimisation and security.

User avatar
dettus
Posts: 5
Joined: Mon Jul 25, 2016 7:53 pm
Location: Nuremberg
Contact: Website

Re: Building Kernel

Tue Jul 26, 2016 5:12 am

well, you could always try using a system builder.

for example, mine:

http://www.dettus.net/detLFS/


it is a selection of shell scripts. The first one is downloading the packages, the second one is building a cross compiler, and the third is compiling the kernel. You could try it out, maybe it helps?
Computer science is not about using a computer. It is about unleashing its powers.

User avatar
dettus
Posts: 5
Joined: Mon Jul 25, 2016 7:53 pm
Location: Nuremberg
Contact: Website

Re: Building Kernel

Tue Jul 26, 2016 5:14 am

neilo24 wrote:Hello,
I want to recompile the kernel with specific module related to camera application only and rest of the module which is un necessary want to exclude from the system. is it possible....??? if it is possible how it could be?? whats works i need to do??
yes, it is not only very possible, but HIGHLY encouraged.
just look at the .config. there you see all the modules that are going to be compiled once you run make zImage. just set them to =n instead of =m, and you are going to save A LOT of compilation time. worst case scenario would be that your device XYZ does not work any more. don't worry, just recompile again.
Computer science is not about using a computer. It is about unleashing its powers.

Return to “Linux Kernel”