-
Notifications
You must be signed in to change notification settings - Fork 5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
git-revision for released Kernel 3.10.25+ #486
Comments
What does "uname -a" report? |
pi@raspberrypi ~ $ uname -a In case it is of any concern: pi@raspberrypi ~ $ cat /etc/issue |
zcat /proc/config.gz > ~/config.rpi-622 and work from that? |
That is what I have tried so far - see my steps to reproduce. That will give me Kernel 3.10.25 instead of 3.10.25+, so I'm thinking that I am using the wrong source tree. |
linux-source-3.10 is not the pi specific kernel source, but a generic debian kernel. (http://elinux.org/RPi_Kernel_Compilation may be useful). I believe the "+" is appended when you build from a git tree that is not tagged. You can find the firmware repo hash that matches your uname string from here: and then pick the corresponding githash: which contains:
which is here in linux source repo: |
That appears to be the correct kernel version for my Pi, thank you very much! I have since figured out that I got this kernel not via dist-upgrade (which is why there is no point in looking for a source package) but via rpi-upgrade. So perhaps telling everyone in every tutorial to first run an rpi-upgrade is not the wisest idea, but oh well... To help anyone else with the same problem who does not have the very excellent "popcornmix search engine" handy, this is (roughly) how to find the correct git revision - hopefully phrased in a way that helps both experts and newcomers:
Et voila, Kernel Sources. If anyone knows a better way of searching through all commits of a git repository, let me (and especially stackoverflow) know. Edit: Now with proper markup. |
Following the above to the letter, and doing the #486 gives me that same long 16...770 hash. Giving me: $ git checkout 16eb921 It worked when I changed it to --depth=200. If someone else reads this, they may have to increase the depth further. I don't think the provision of the GPL that insists sources corresponding to binaries meant that they should be buried, hidden, and hard to find among obscure files, hashes, and git commands. Yet it is nearly impossible to rebuild a released kernel image and binaries from sources - because it is nearly impossible to find the right sources in the massive archive. There are git features which could make finding the corresponding source easier. Please consider doing something along those lines. |
@tz1 please explain how you would like it to be done. |
@popcornmix Why don't you use tags? Or would it be possible to provide a linux headers package available via apt-get like other linux distros? That would make my life so much easier. I was trying to compile a kernel module for one week now ... without luck. I immediately succeeded with arch arm (provides linux headers), but I prefer debian for embedded/server stuff. |
@popcornmix: I would like a linux-source-3.10.25+ package which corresponds exactly to the binary that is running. This is the Debian way. It also would be a lot more GPL-ish. Indeed, requiring hours of detective work in order to obtain the source certainly goes against the spirit, possibly even the letter of the GPL. If you want help generating such a package I'd be happy to. |
Though, it seems I was able to cheat by doing as advised here, thusly: sudo ln -s /lib/modules/3.10-3-rpi/build /lib/modules/3.10.25+/build So my particular itch looks like it is now scratched. Still think a proper source package or at least headers package would be more Debian-ish though, and would be willing to help if needed. |
@kenrestivo |
I have various things to speed up finding such in my pikernomatic project. The project does more as it also fetches the tools for a pc build and does some patching for CAN, PiTFT, and a few other things, enabled or disabled in a setup script. They might provide some base for what you want to do, or simply be helpful. |
That project is at https://github.com/tz1/pikernomatic |
That's useful, thanks. Seems like you did a lot of the heavy lifting already. |
@popcornmix: a simple git tag (i.e. v3.10.25+) would be awesome, straightforward, easy to do, and probably the clearest, thanks. |
There is a 'tag' function. It would help if there were a tag for each binary release, with either the date or version or anything - there are only a handful of binary releases, when hexxeh or the raspi foundation or someone else produces a binary, having a tag - the version number is probably sufficient, but something like '3.10.33+ cam support" would work. Or even just "binary release" since the date or other metadata is avilable. I don't know how or if the binary releases are coordinated with this tree. They seem to show up, but I found where they try to put the hash in their tree which links to this one. |
@kenrestivo the machinery to generate a the Debian packages is at github.com/asb/firmware. I would happily accept any patches to improve the situation. |
How about tagging linux tree with:
With uname_string from https://github.com/raspberrypi/firmware/blob/master/extra/uname_string |
I see that git_hash and Module.symvers is now present in https://github.com/Hexxeh/rpi-firmware With that in place, make a kernel source install script like this: https://github.com/notro/rpi-firmware/blob/master/extra/install_kernel_source Now it's very easy to build kernel modules: https://github.com/notro/fbtft-spindle/wiki/Building-kernel-modules |
Do you need config? Is this not sufficient: This will avoid deleting git_hash and Module.symver |
Yes, I know of those. |
The long-form tag would work fine. I might otherwise want something shorter, but it is better to have too much rather than too little. The /proc/config.gz works, but has to be obtained on the pi itself. I cross compile since I don't want to wait hours. It would be useful to have the .config to avoid the step, but it hasn't been a problem. Some things (like the PiTFT and other fbtft) need the kernel build since the backlight setting changes and that affects the tree. Also increasing the number of interrupts. |
We always build the kernel using this config: |
Great. For a "script" I'd like to use make-kpkg which is already in Debian (or a thin wrapper around it to fetch the right tag), and with which I'm already familiar, if everyone's OK with that. I hope to have some time tonight to try some builds and see how it goes. |
OK, it seems like based on the suggestions above, people are more interested in hand-rolling scripts instead of using the Debian tools. So, in general, before I spend too much time on this, does anyone but me care about making this follow Debian conventions and such as much as possible? |
I would be interested in a solution "the debian way". It definitely removes the overhead of learning how to use yet another set of tools. Plus, having dpkg packets should ease the pain of juggling multiple kernel versions. |
I think either a script or a debian package will be more useful than doing it manually. If you can explain how to run make-kpkg to produce the deb files, we can update that with firmware builds, and get it into @asb's repo so it's available to raspbian users. |
@deltaphi: Great. I built a kernel last night using make-kpkg. I'll have to do some more work tweezing the --revision and --append-to-version parameters to get the version naming right, but so far so good. Also I'll need to get it to include the ungzipped kernel in the package, and add some kind of post-install script that'll put it in /boot/kernel.img. Also, I built it using the Raspberry toolchain at https://github.com/raspberrypi/tools . Not sure if that's the most Debian-ish one to use, or if crosstools-ng would be better, etc. |
@popcornmix: Will do. As a first pass, I did this, but CAUTION it is not right yet, still have work to do: git clone https://github.com/raspberrypi/linux/
cd linux/
git checkout 16eb921a96db3dc3555a65b53b99c15753e6b770
git checkout -b v3.10.25+
export ARCH=arm
export DEB_HOST_ARCH=armhf
export CONCURRENCY_LEVEL=6
export EXTRAVERSION=-raspbian-20140107
export CCPREFIX=/mnt/externalsata/raspberry/tools/arm-bcm2708/arm-bcm2708-linux-gnueabi/bin/arm-bcm2708-linux-gnueabi-
cd /mnt/externalsata/raspberry/kernel/
wget -O .config http://where-can-i-get-the-3.10.25-release-config-not-the-3.XXX-config
export PATH=$PATH:/mnt/externalsata/raspberry/tools/arm-bcm2708/arm-bcm2708-linux-gnueabi/bin
fakeroot make-kpkg --arch arm --cross-compile arm-bcm2708-linux-gnueabi- --append-to-version=-release --revision 1 kernel_image kernel_headers kernel_source Is there a place I can reliably grab the release config (i.e. the 3.10.25+, not an old version, in the case of the 2014-01-07 release) off of the internet without having to scp it from a running Pi? As noted above, I also need to add in the uncompressed kernel to the package, and a post-install script (part of the Debian package) to install it in /boot. I also want to try fakeroot-ng as an alternative to eliminate some spurious error messages. |
I have made a Linux kernel source installer: http://www.raspberrypi.org/forums/viewtopic.php?f=29&t=76261 |
@kenrestivo i created a gist https://gist.github.com/bullshit/8001ce5eb8f03f056199/ |
Using a sequence of dist-upgrade and rpi-update, my Pi running an Raspberry-Foundation Raspian image has arrived at booting Kernel 3.10.25+. I need to build additional kernel modules (namely spi-config and a bunch of CAN-Networking modules). However, I cannot find sources that will let me compile a matching kernel.
I have successfully built a Kernel 3.10.24+ that I believe would match the kernel part of the latest raspbian image by extracting the git hash from the firmware. However this is not the Kernel my Pi is running after the dist-upgrade.
Therefore I would like to know, what is the git hash/revision, the current linux-image-3.10.25+ package for raspbian was built from?
Steps To reproduce:
Expected Output:
Modules for Kernel version 3.10.25+.
Actual Output:
Modules for Kernel version 3.10.25 (note the lacking "+").
The text was updated successfully, but these errors were encountered: