rjgraham
Posts: 3
Joined: Wed Jul 18, 2012 5:28 pm

Kernel and distro source download.

Wed Jul 18, 2012 5:31 pm

Where can I download the source for the Raspbian kernel and linux distro ?

I have looked, but I only see links to binary images.

Thanks,

-Randy

plugwash
Forum Moderator
Forum Moderator
Posts: 3431
Joined: Wed Dec 28, 2011 11:45 pm

Re: Kernel and distro source download.

Wed Jul 18, 2012 5:36 pm

Source for all packages in the raspbian repository is available from the repository in the normal way.

As for kernel source I belive most raspbian images are using the foundation's kernel build the source for which is available from thier git repository (it's linked somewhere on this site, I don't remember the URL offhand).

rjgraham
Posts: 3
Joined: Wed Jul 18, 2012 5:28 pm

Re: Kernel and distro source download.

Wed Jul 18, 2012 6:00 pm

Thanks for your quick reply !

I should have been more specific, I would like to get the source so that I can build the latest image described here : http://www.muktware.com/3949/raspbery-p ... card-image .

We are designing some custom peripherals for this board and need full source to integrate, build, debug, etc.

We also need hard floating point support which this distro provides.

-Randy

dom
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5282
Joined: Wed Aug 17, 2011 7:41 pm
Location: Cambridge

Re: Kernel and distro source download.

Wed Jul 18, 2012 6:19 pm

The official image was put together with spindle:
https://github.com/asb/spindle

rjgraham
Posts: 3
Joined: Wed Jul 18, 2012 5:28 pm

Re: Kernel and distro source download.

Wed Jul 18, 2012 7:39 pm

Great, I'll check it out.

Thanks !

-Randy

User avatar
mpthompson
Posts: 620
Joined: Fri Feb 03, 2012 7:18 pm
Location: San Carlos, CA
Contact: Website

Re: Kernel and distro source download.

Wed Jul 18, 2012 10:35 pm

rjgraham wrote:Where can I download the source for the Raspbian kernel and linux distro ?
Randy, if you want a direct link to the distro source, you can use the URL below:

http://archive.raspbian.org/raspbian/pool/main/

From there, navigate to the package name you want and you'll find the source code that built that package in the form of a .tar.gz file. Or, as plugwash indicated, you can use the standard Debian method of obtaining source code such as 'apt-get source package_name'.

gunflame
Posts: 35
Joined: Mon May 14, 2012 2:15 am

Re: Kernel and distro source download.

Thu Jul 19, 2012 5:51 am

I feel very very dumb because I can't find the source for the distro even after the instructions above were given.

Can someone help me out? Please be very precise because I have no clue... for example
Randy, if you want a direct link to the distro source, you can use the URL below:

http://archive.raspbian.org/raspbian/pool/main/

From there, navigate to the package name you want
I have NO clue what's the name of the distro.

For example for squeeze I would just go to https://github.com/raspberrypi/linux and done... I had what I needed. What's the equivalent for Raspbian?

jui-feng
Posts: 57
Joined: Sun Mar 04, 2012 11:02 am

Re: Kernel and distro source download.

Thu Jul 19, 2012 9:52 am

gunflame wrote:For example for squeeze I would just go to https://github.com/raspberrypi/linux and done... I had what I needed. What's the equivalent for Raspbian?
That link only has the linux kernel sources for the foundation's squeeze image, not the source code for the full distribution.

I don't use the foundation raspbian image, so I can't tell you exactly how they call their kernel package. You need to figure that out, possibly with something like
dpkg --get-selections | grep linux
It's probably called something like linux-image-3.2.0-3-rpi ..

Once you have the package name, simply type
apt-get source package-name
like this:
apt-get source linux-image-3.2.0-3-rpi

I'd imagine that the source code is actually still the same as in squeeze (kernel 3.1.9+), because I'm not sure the 3.2 raspberry kernel is ready for general use.

gunflame
Posts: 35
Joined: Mon May 14, 2012 2:15 am

Re: Kernel and distro source download.

Thu Jul 19, 2012 11:45 am

Thank you for the feedback. Yea I needed the kernel not the distro (I'm still a noobie to linux).

Anyways, do you know if the raspbian has special modifications to the kernel? If I modified and recompiled the kernel for the Debian Squeeze image. Should I work for the Raspbian?

asb
Forum Moderator
Forum Moderator
Posts: 853
Joined: Fri Sep 16, 2011 7:16 pm
Contact: Website

Re: Kernel and distro source download.

Thu Jul 19, 2012 11:51 am

gunflame wrote:Thank you for the feedback. Yea I needed the kernel not the distro (I'm still a noobie to linux).

Anyways, do you know if the raspbian has special modifications to the kernel? If I modified and recompiled the kernel for the Debian Squeeze image. Should I work for the Raspbian?
We use the kernel at github.com/raspberrypi/linux - the build on the released image on the Raspberry Pi download page is made from that repo as of https://github.com/raspberrypi/linux/co ... e26efcee15 using the bcmrpi_defconfig.

Avoncliff
Posts: 35
Joined: Fri Dec 09, 2011 5:24 pm

Re: Kernel and distro source download.

Mon Jul 23, 2012 10:43 pm

I would like to use Frank Buss's kernel patch for Dallas 1-wire interface with Raspbian.
http://www.raspberrypi.org/phpBB3/viewt ... =44&t=6649

Am I understanding from the above, to apply his patch I need to use the https://github.com/raspberrypi/linux.git, as the source packages do not include the current kernel used by raspbian.

As I have never built a kernel from git, can someone point me at suitable documentation.
Thanks.

marsman2020
Posts: 72
Joined: Sun May 20, 2012 11:26 pm

Re: Kernel and distro source download.

Tue Jul 24, 2012 1:29 am

There is documentation for building the kernel from git at http://elinux.org/RPi_Kernel_Compilation. I was able to successfully set up a cross compiler on an x86 machine, clone the kernel branch, apply an experimental USB patch, compile the kernel+modules, and move them to the Pi using mostly what was on that wiki.

User avatar
mrpi64
Posts: 931
Joined: Sat Feb 16, 2013 5:13 pm

Re: Kernel and distro source download.

Mon Mar 03, 2014 2:04 pm

marsman2020 wrote:There is documentation for building the kernel from git at http://elinux.org/RPi_Kernel_Compilation. I was able to successfully set up a cross compiler on an x86 machine, clone the kernel branch, apply an experimental USB patch, compile the kernel+modules, and move them to the Pi using mostly what was on that wiki.
Thanks for this link!
I'm happy to help.
https://www.raspberrypi.org/forums/viewtopic.php?f=78&t=51794 - List of games that work on the Pi.

himanshu
Posts: 2
Joined: Wed Mar 12, 2014 10:07 am

Re: Kernel and distro source download.

Wed Mar 12, 2014 10:18 am

Hi
I am looking for the kernel source code for Raspbian distribution [2014-01-07-wheezy-raspbian.zip]
which have [ 3.10.25+] as kernel version and downloaded from link below
http://www.raspberrypi.org/downloads

So from where can i get kernel source for the given [2014-01-07-wheezy-raspbian.zip] distribution
or any other older distribution.

ghans
Posts: 7867
Joined: Mon Dec 12, 2011 8:30 pm
Location: Germany

Re: Kernel and distro source download.

Wed Mar 12, 2014 3:01 pm

The avdice of the previous posters is still correct.

ghans
• Don't like the board ? Missing features ? Change to the prosilver theme ! You can find it in your settings.
• Don't like to search the forum BEFORE posting 'cos it's useless ? Try googling : yoursearchtermshere site:raspberrypi.org

himanshu
Posts: 2
Joined: Wed Mar 12, 2014 10:07 am

Re: Kernel and distro source download.

Thu Mar 13, 2014 6:51 am

Hi

Is there anyone who can provide insight on
Raspbian kernel
I was able to get 3.10.11 kernel from the mirrors provided
in Raspbian website,but didn't found kernel 3.10.25+ version
As kernel 3.10.25+ version is there in latest Raspbian prebuilt (.img)
We are configuring few peripherals for which exact kernel source code
is required.
We got is useful information regarding Kernel Building and compilation
provided by " marsman2020 ",But getting the proper source code is where we have stuck.

plugwash
Forum Moderator
Forum Moderator
Posts: 3431
Joined: Wed Dec 28, 2011 11:45 pm

Re: Kernel and distro source download.

Thu Mar 13, 2014 4:13 pm

Look in /usr/share/doc/raspberrypi-bootloader/ you should find a file called changelog.debian.gz in the first entry of that changelog you will find something like "firmware as of <random looking hex number>"

The random looking hex number is a git commit ID for the raspberrypi/firmware repository on github, find the relavent commit in that repository and look for a file called "extra/git_hash".

In that file is a git commit ID for the raspberrypi/linux repository on github which should give you the matching source for the kernel you have installed.

IvanX
Posts: 50
Joined: Sun Jan 27, 2013 7:08 pm

Re: Kernel and distro source download.

Wed Mar 19, 2014 11:42 am

plugwash wrote:Look in /usr/share/doc/raspberrypi-bootloader/ you should find a file called changelog.debian.gz in the first entry of that changelog you will find something like "firmware as of <random looking hex number>"

The random looking hex number is a git commit ID for the raspberrypi/firmware repository on github, find the relavent commit in that repository and look for a file called "extra/git_hash".

In that file is a git commit ID for the raspberrypi/linux repository on github which should give you the matching source for the kernel you have installed.
Exactly. I check it out thusly:

Code: Select all

fwhash=$(zcat /usr/share/doc/changelog.Debian.gz | grep -m 1 'as of' | awk '{print $NF}')
linuxhash=$(wget -qO- https://raw.github.com/raspberrypi/firmware/$fwhash/extra/git_hash)
git checkout $linuxhash
If it's helpful, I've also put up a page with step by step on compiling the kernel or modules.

Return to “Raspbian”