sethuchidambaram
Posts: 3
Joined: Fri May 03, 2019 5:34 am

source tree for 4.9.35-v7+

Fri May 03, 2019 6:27 am

I need the exact source tree for the above kernel 4.9.35, to write device drivers for rasberry pi, anything that is generic such as 4.9.x is not working.

User avatar
DougieLawson
Posts: 35119
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: source tree for 4.9.35-v7+

Fri May 03, 2019 7:47 am

Why are you using something that ancient? (30 Jun 2017)

Current stable kernel is 4.14.98
Current development kernel is 4.19.37
Note: Having anything remotely humorous in your signature is completely banned on this forum.

Any DMs sent on Twitter will be answered next month.

This is a hippy & doctor free zone.

fanoush
Posts: 440
Joined: Mon Feb 27, 2012 2:37 pm

Re: source tree for 4.9.35-v7+

Fri May 03, 2019 1:33 pm

if you need just to compile matching kernel modules and not recompile whole kernel you don't need whole source tree, in general there is package kernel-headers or linux-headers for this in most linux distributions. In raspbian I think the names are:
raspberrypi-kernel
raspberrypi-kernel-headers
so you need to install same version of -headers as your curently installed rapberrypi-kernel.
Then the Makefile of your external kernel drivers/modules source should find it and build fine.

sethuchidambaram
Posts: 3
Joined: Fri May 03, 2019 5:34 am

Re: source tree for 4.9.35-v7+

Sun May 12, 2019 10:45 am

Hi This is the Model of my rasberry pi " Raspberry Pi 3 Model B Rev 1.2" and my current kernel version is 4.9.35-v7+ , i build my own kernel image from the source tree, I tried the methods found in the forum the Image gets created but I am unable to boot from it. If I need use this kernel 4.14.98 for my above said rasberry pi model, How do I download this new kernel or how do download ths source tree for the above said kernel version and create the Image?

sethuchidambaram
Posts: 3
Joined: Fri May 03, 2019 5:34 am

Re: source tree for 4.9.35-v7+

Sun May 12, 2019 11:15 am

Hi Fanoush,
Thks for the reply you have said "so you need to install same version of -headers as your curently installed rapberrypi-kernel",
once you write the driver code you need to run this make command "make -C /usr/src/linux-headers-4.15.0-1035-aws M=`pwd` modules" to generate the .ko file to laod the module, the given make command is for the kernel version 4.15.0 which is a ubuntu OS for which the source tree was given and I was able to get the header file and was able to load the firmware.

But for my RAsberry Pi I am unbale to get the header file for my exact version "4.9.35-v7+" why the rasberry pi is distrubuted with out the source tree. only if the header file version matches to that of my kerner version, I can do Insmod, otherwise it throws out an error.

fanoush
Posts: 440
Joined: Mon Feb 27, 2012 2:37 pm

Re: source tree for 4.9.35-v7+

Fri May 17, 2019 6:17 am

all kernels and matching headers since 2016 can be seen here https://archive.raspberrypi.org/debian/ ... -firmware/ they are named by date and not by linux version so you need to figure out what raspberrypi-kernel version you have installed and then install matching headers package.

Return to “Raspbian”