2

I am attempting to compile the kernel for the RPI using Raspbian. These are the steps I took...

(1) Imaged the SD card from http://www.raspberrypi.org/downloads

(2) Downloaded the kernel from and placed it in my /usr/src directory sudo wget https://github.com/raspberrypi/linux/archive/rpi-3.6.y.zip

Now I would like to run the following commands to create the new image file...

(1) sudo make menuconfig

(2) sudo make

(3) sudo make modules

(4) sudo make modules_install

The first problem I have is that I want to compile using the header files from my downloaded kernel and no the current system kernel. (I am compiling on the actual RPI) How do I change it so that happens.

My second question is are there any special configurations needed to be done during step 1 sudo make menuconfig so that I can write my own drivers?

1 Answer 1

1

The first problem I have is that I want to compile using the header files from my downloaded kernel and no the current system kernel. (I am compiling on the actual RPI) How do I change it so that happens.

If you call make to do anything in the src directory, it will use the src directory makefile which will include the correct src directory headers.

My second question is are there any special configurations needed to be done during step 1 sudo make menuconfig so that I can write my own drivers?

No. I believe (I haven't tried) you should even be able to integrate your module's build with make menuconfig if you include a Kconfig file and probably an appropriate makefile. However, that's not necessary to build a custom module. Beware they are built for specific kernels, so if you build it for the 3.6.x kernel you can't load it into the 3.2.27 kernel; you'd have to build two versions.

WRT to replacing the existing system headers, you can do this (see src/doc/Documentation/make/headers_install.txt), but the general wisdom is not to -- the distro headers are the ones glibc, etc, was built against, and those are the ones that should be used for compiling userspace applications (but not modules).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.