Kernel sources avaliability


26 posts   Page 1 of 2   1, 2
by richardp » Sat Dec 29, 2012 9:07 am
Hi All,

Just flashed the last raspbian release from the RaspberryPi downloads page and I am trying to find where the kernel sources are?

in the apt repository is the meta package kernel-sources, but installing that it is a 3.2 kernel, and not the 3.6 kernel which is on the platform.

Where are the 3.6.x kernel sources? The only thing I have run is rpi-update from Hexxeh to update the firmware (and it looks like it does more)

Richard

sudo apt-cache search linux-headers
linux-headers-3.2.0-3-all - All header files for Linux 3.2 (meta-package)
linux-headers-3.2.0-3-all-armhf - All header files for Linux 3.2 (meta-package)
linux-headers-3.2.0-3-common - Common header files for Linux 3.2.0-3
linux-headers-3.2.0-3-rpi - Header files for Linux 3.2.0-3-rpi

Linux raspberrypi 3.6.11+ #346 PREEMPT Fri Dec 28 00:50:33 GMT 2012 armv6l GNU/Linux
RaspberryPi's galore
Solid run CuBox
ODroid U2
Posts: 117
Joined: Thu Jan 12, 2012 11:46 am
by joan » Sat Dec 29, 2012 9:29 am
I use git clone https://github.com/raspberrypi/linux.git

I haven't checked if it is the latest. Sort of assumed it was.
User avatar
Posts: 5185
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK
by richardp » Sat Dec 29, 2012 9:54 am
I done a fresh install and its no better... Hexxeh's script changes the kernel and that is not what I wanted.

The running kernel is
Linux raspberrypi 3.2.27+ #250 PREEMPT Thu Oct 18 19:03:02 BST 2012 armv6l GNU/Linux

and the apt-repository has the meta-package set to
Get:1 http://mirrordirector.raspbian.org/raspbian/ wheezy/main linux-source-3.2 all 3.2.21-1+rpi1 [77.2 MB]
Get:2 http://mirrordirector.raspbian.org/raspbian/ wheezy/main linux-source all 3.2+46 [4,402 B]

All I would like to do is rebuild the some kernel modules so that it can run with the existing kernel.. I don't want to build everything. Is there a place where I can get the running kernel sources?

Richard
RaspberryPi's galore
Solid run CuBox
ODroid U2
Posts: 117
Joined: Thu Jan 12, 2012 11:46 am
by richardp » Sat Dec 29, 2012 10:19 am
joan wrote:I use git clone https://github.com/raspberrypi/linux.git

I haven't checked if it is the latest. Sort of assumed it was.


Thanks... the 3.2.27 tag is in the Git repo... (downloading now) - but that does not explain why the apt-repo is so out of whack with what is actually on the platform

Richard
RaspberryPi's galore
Solid run CuBox
ODroid U2
Posts: 117
Joined: Thu Jan 12, 2012 11:46 am
by richardp » Sat Dec 29, 2012 5:22 pm
richardp wrote:
joan wrote:I use git clone https://github.com/raspberrypi/linux.git

I haven't checked if it is the latest. Sort of assumed it was.


Thanks... the 3.2.27 tag is in the Git repo... (downloading now) - but that does not explain why the apt-repo is so out of whack with what is actually on the platform

Richard


The 3.2.27 in the GIT repo does not match the one running on Raspbian. Config.gz is missing options and the default build does not append the + on Extraversion.... resulting in modules that will never load.
RaspberryPi's galore
Solid run CuBox
ODroid U2
Posts: 117
Joined: Thu Jan 12, 2012 11:46 am
by jancona » Sun Dec 30, 2012 12:50 am
Plugwash explains the current state of kernel packaging in this post.

I've been experimenting with building a kernel headers package from the Github kernel source. If you want to build modules, you can try installing the headers I built, as described later in that thread, or you can follow the instructions in this thread.
Posts: 10
Joined: Tue Oct 23, 2012 4:43 pm
by fher98 » Mon Dec 31, 2012 5:30 am
Thanks.. just got into Raspbian needed to build my WIFI drivers and got quite a surprised when could find the headers.

Checking the posts thanks.
Posts: 2
Joined: Mon Dec 31, 2012 5:13 am
by plugwash » Mon Dec 31, 2012 11:25 am
Afaict the procedure to find the right foundation kernel sources is.

Read the changelog of the installed "raspberrypi-firmware" package.
Dig through the history of https://github.com/asb/firmware/commits/debian to find the corresponding commit
Read the file "extra/git_hash"
Check the code out of the raspberrypi/linux repo using the git hash you got from the file mentioned above.
Forum Moderator
Forum Moderator
Posts: 2174
Joined: Wed Dec 28, 2011 11:45 pm
by joan » Mon Dec 31, 2012 11:30 am
That seems rather a palaver. Isn't it meant to be a bit easier than that?
User avatar
Posts: 5185
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK
by plugwash » Mon Dec 31, 2012 1:06 pm
Sorry my previous post was a little incorrect

Firstly the package is called raspberrypi-bootloader not raspberrypi-kernel
Secondly it's not actually necessary to go manually digging through the repository history.

The complete procedure
read /usr/share/doc/raspberrypi-bootloader/changelog.debian.gz the most recent changelog entry will contain a 10 digit hexadecimal number (17c8799375 for the latest package at the time of writing) the 10 digit hexadecimal number is a (short) git commit ID for the raspberrypi/firmware repository
Now go to https://github.com/raspberrypi/firmware/commit/<commit id> (https://github.com/raspberrypi/firmware ... 17c8799375 for the latest package at the time of writing)
Now click on browse code and find the file extra/git_hash in this you will find a (complete) git commit ID for the raspberrypi/linux repository which you can use to check out the corresponding source code for your kernel from the raspberrypi/linux repository.
Forum Moderator
Forum Moderator
Posts: 2174
Joined: Wed Dec 28, 2011 11:45 pm
by joan » Mon Dec 31, 2012 1:29 pm
I tend to use Debian. The last entry in that gzip was the 28th October 2012. I use the Debian reposotries but update the kernel/firmware via rpi-update.

The kernel I run says

Linux soft 3.6.11+ #346 PREEMPT Fri Dec 28 00:50:33 GMT 2012 armv6l GNU/Linux
User avatar
Posts: 5185
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK
by efflandt » Fri Jan 04, 2013 1:12 am
http://elinux.org/Rpi_kernel_compilation explains where to get kernel sources, but is somewhat out of date in that the default current version was recently changed to 3.6 (3.6.11 last I checked) instead of 3.2.
Posts: 359
Joined: Mon Dec 03, 2012 2:47 am
Location: Elgin, IL USA
by richardp » Fri Jan 04, 2013 6:33 am
So the GPL legal obligations are not being adhered to with a 'Clear Notice' of where the sources for all the packages are available with the current running configuration.
RaspberryPi's galore
Solid run CuBox
ODroid U2
Posts: 117
Joined: Thu Jan 12, 2012 11:46 am
by bgirardot » Fri Jan 04, 2013 6:58 am
richardp wrote:So the GPL legal obligations are not being adhered to with a 'Clear Notice' of where the sources for all the packages are available with the current running configuration.


I hate to see this get derailed so I am only in for a few comments, but where in regard to the Linux kernel is this "clear notice of where the sources are" a requirement?
Posts: 517
Joined: Wed Oct 10, 2012 6:20 am
Location: Switzerland
by richardp » Fri Jan 04, 2013 7:23 am
bgirardot wrote:
richardp wrote:So the GPL legal obligations are not being adhered to with a 'Clear Notice' of where the sources for all the packages are available with the current running configuration.


I hate to see this get derailed so I am only in for a few comments, but where in regard to the Linux kernel is this "clear notice of where the sources are" a requirement?


I dont want to get in to a legal argument as there are many layman interpretations... but here it is (based on Legal counsel advice at a form specialising in GPL things) - Since the Raspbian distro is amateur built (no offense), its a case of 'who cares'


http://www.gnu.org/licenses/gpl-2.0.html

Section 1
1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program.


Section 2.c
c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.)


Section 3
3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following:

a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or,

b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or,

c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.)

The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable.

If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code.
Last edited by richardp on Fri Jan 04, 2013 7:38 am, edited 1 time in total.
RaspberryPi's galore
Solid run CuBox
ODroid U2
Posts: 117
Joined: Thu Jan 12, 2012 11:46 am
by bgirardot » Fri Jan 04, 2013 7:36 am
richardp wrote:I dont want to get in to a legal argument.. but here it is


If you didn't want to get into it, why did you bring it up here? Just to be a pain in the behind?

And I see, so none of it is your "clear notice where to find" stuff which is actually in v3.

Re: 1 - see COPYING.linux in /boot

Re: 2 - "(Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) "

and 3 - "If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code." = github

I would also point out, putting in the license and saying you abide by it fulfills 3(b)

Should you still feel there is a GPLv2 violation, I suggest you follow the guidelines set forth by the FSF:

What to do if you see a possible GPL violation

EDIT: Oh not to mention, this prints every time I log into Raspbian:
The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Posts: 517
Joined: Wed Oct 10, 2012 6:20 am
Location: Switzerland
by richardp » Fri Jan 04, 2013 7:52 am
CONSPICUOUS Notice, a file on an SD card does not cut the mustard.

I am not bringing it up to be a pain.... I am bringing it up as a point that the modified sources are a complete DOG to find. The sources are on Github which is valid... but what TagID ? so far in the the thread no-one knows.

If there was a note saying current sources are at http://www.github.com/sources?Tag=123456789 (an example) would be awesome, or even better, the apt-repo is updated so that when I use apt-get install kernel-sources-3.2.27 it works. (that would be first prize)

The V3 license was added to include Internet downloads, which v2 does not cover - but it still v2 states a CONSPICUOUS Notice, the Raspi is not an embedded device, its a Computer with an interactive display.

Again... If you are going to do something, do it properly. You seem to have taken my posting negatively, I am not interested in reporting to the FSF, but I am interested in making life easier for everyone else using the Pi that want to dabble in kernel modules(count how many threads there are asking why home-made kernel modules don't work)


bgirardot wrote:
EDIT: Oh not to mention, this prints every time I log into Raspbian:
The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.


Its not the copyrights, is a proffer of where to get the currently running sources/configurations from. Is this too difficult?
RaspberryPi's galore
Solid run CuBox
ODroid U2
Posts: 117
Joined: Thu Jan 12, 2012 11:46 am
by rurwin » Fri Jan 04, 2013 9:41 am
The conspicuous requirement is regarding when source-code is published and only requires copyright and warranty notices. Almost certainly every GPL package in the world implements that as a brief note in the source-files and a COPYING file in the directory.

The requirement to provide source-code is not qualified by any such requirement. I imagine that a court of law would be interested in whether the provided mechanism was reasonable, but it is not an explicit requirement of the GPL.

A man with one watch always knows what time it is; a man with two is never sure. Publishing the correct way to find the correct kernel sources is, in my view, better than publishing a second way to find them that people may forget to update or which may otherwise fail. The correct way is, after all, only three steps.

So far as I can see, publishing that procedure more widely would answer the problem.
User avatar
Forum Moderator
Forum Moderator
Posts: 2903
Joined: Mon Jan 09, 2012 3:16 pm
by richardp » Fri Jan 04, 2013 9:43 am
rurwin wrote:
So far as I can see, publishing that procedure more widely would answer the problem.


It would be a start :D
RaspberryPi's galore
Solid run CuBox
ODroid U2
Posts: 117
Joined: Thu Jan 12, 2012 11:46 am
by chrisw2 » Fri Jan 04, 2013 9:00 pm
@richardp

Have you seen this thread about kernel packaging: http://www.raspberrypi.org/phpBB3/viewtopic.php?f=66&t=25964

It would seem raspbian (in the form of mpthomson & plugwash) is committed to doing things "the debian way" but lacks the resource and possibly co-operation from the RPI Foundation (presumably again because of resource and maybe priorities or lack of experience of debian).

I tend to agree with you and would love to see raspbian with debian style kernel packaging and the foundation packaging the firmware & their other stuff in "debian style" (for instance: instead of rpi-update or hexxy's script move this functionality into dpkg scripts within the package).

I think in the long term this would make it easier to support users as there would be far fewer cases of having to do things a specific "RPI way" and instead users could be pointed at generic debian documentation.
eg: when they needed to build a kernel module.

I'm not sure if there is anything we can do to help this come about.
Posts: 106
Joined: Sat Apr 07, 2012 11:22 am
Location: Manchester, UK
by bgirardot » Sun Jan 06, 2013 4:04 pm
plugwash wrote:Now click on browse code and find the file extra/git_hash in this you will find a (complete) git commit ID for the raspberrypi/linux repository which you can use to check out the corresponding source code for your kernel from the raspberrypi/linux repository.


I have no trouble with the steps previous to this, but I am not having any luck with git and just checking out the sources for the commit ID I want.

Anyone know what command(s) to use for git to accomplish this?
Posts: 517
Joined: Wed Oct 10, 2012 6:20 am
Location: Switzerland
by HiteshDholakia » Mon Jan 28, 2013 4:32 am
bgirardot wrote:
plugwash wrote:Now click on browse code and find the file extra/git_hash in this you will find a (complete) git commit ID for the raspberrypi/linux repository which you can use to check out the corresponding source code for your kernel from the raspberrypi/linux repository.


I have no trouble with the steps previous to this, but I am not having any luck with git and just checking out the sources for the commit ID I want.

Anyone know what command(s) to use for git to accomplish this?



I have the ditto question. Various forums state that this cannot be done (i.e. cannot get code from a specific commit id). Can someone post how to do that? Thanks,
Hitesh.
Posts: 1
Joined: Sat Jan 26, 2013 11:25 pm
by bgirardot » Mon Jan 28, 2013 5:45 am
HiteshDholakia wrote:
bgirardot wrote:
plugwash wrote:Now click on browse code and find the file extra/git_hash in this you will find a (complete) git commit ID for the raspberrypi/linux repository which you can use to check out the corresponding source code for your kernel from the raspberrypi/linux repository.


I have no trouble with the steps previous to this, but I am not having any luck with git and just checking out the sources for the commit ID I want.

Anyone know what command(s) to use for git to accomplish this?



I have the ditto question. Various forums state that this cannot be done (i.e. cannot get code from a specific commit id). Can someone post how to do that? Thanks,
Hitesh.


I ended up accomplishing this by browsing the commits on the web and then using the download the zip option. Then I copied that over to my RPi. That seemed to work.
Posts: 517
Joined: Wed Oct 10, 2012 6:20 am
Location: Switzerland
by brox » Sat Mar 30, 2013 9:07 pm
bgirardot wrote:
plugwash wrote:Now click on browse code and find the file extra/git_hash in this you will find a (complete) git commit ID for the raspberrypi/linux repository which you can use to check out the corresponding source code for your kernel from the raspberrypi/linux repository.


I have no trouble with the steps previous to this, but I am not having any luck with git and just checking out the sources for the commit ID I want.

Anyone know what command(s) to use for git to accomplish this?

git clone https://github.com/raspberrypi/linux.git
cd linux
git checkout <SHA1 you found in previous steps>
git reset --hard
So long, and thanks for all the fish!
User avatar
Posts: 19
Joined: Sat Mar 02, 2013 11:24 pm
Location: Betelgeuse
by MrEngman » Mon Apr 22, 2013 10:19 pm
brox wrote:
bgirardot wrote:
plugwash wrote:Now click on browse code and find the file extra/git_hash in this you will find a (complete) git commit ID for the raspberrypi/linux repository which you can use to check out the corresponding source code for your kernel from the raspberrypi/linux repository.


I have no trouble with the steps previous to this, but I am not having any luck with git and just checking out the sources for the commit ID I want.

Anyone know what command(s) to use for git to accomplish this?

git clone https://github.com/raspberrypi/linux.git
cd linux
git checkout <SHA1 you found in previous steps>
git reset --hard

Just what I've been looking for but can you explain what git reset does and why you use it, thanks.

MrEngman
Simplicity is a prerequisite for reliability. Edsger W. Dijkstra
Posts: 1775
Joined: Fri Feb 03, 2012 2:17 pm
Location: Southampton, UK