juranga
Posts: 183
Joined: Fri Nov 06, 2015 11:39 am
Location: Basque Country

Download kernel source

Sun Dec 04, 2016 1:50 pm

Hi,

I have downloaded the last kernel version from https://github.com/raspberrypi/linux , I have compiled and I try to run my raspberry pi 2 with this kernel, but it doesn´t boot. I suposse that my raspberry needs another kernel version (a previous one)...

I would like to download another version, (4.1.7-v7+) is this possible? And where can I download it?


Many thanks in advance.

User avatar
DougieLawson
Posts: 38882
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: Download kernel source

Sun Dec 04, 2016 2:05 pm

Get a copy of rpi-source, it can download any version as long as you know the git commit id for it.

You really do not want to revert to a 4.1.xx kernel, that won't boot with the current bootcode.bin GPU blob.
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

juranga
Posts: 183
Joined: Fri Nov 06, 2015 11:39 am
Location: Basque Country

Re: Download kernel source

Sun Dec 04, 2016 2:52 pm

Many thanks for your answer DougieLawson.

I have found your post explaining how install kernel source so I will try using it.
DougieLawson wrote:All the kernel commit IDs come from here: https://github.com/Hexxeh/rpi-firmware/commits/master

Current is: b8f4cb56a12ddeb047172ca9f99c7ea401dd5f50 for 4.1.15+ & 4.1.15-v7+

Looks like 7ee23ac1452ad57dcc0ef2c1f074060b4bd9338d should match the version in stock Raspbian Jessie as shipped with apt-get.

If you want an easy way to download the source install rpi-source with: sudo wget https://raw.githubusercontent.com/notro ... rpi-source -O /usr/bin/rpi-source && sudo chmod +x /usr/bin/rpi-source && /usr/bin/rpi-source -q --tag-update

I do not have much experience with kernel stuff and I haven´t understood the last sentence. :oops: :oops:
DougieLawson wrote:Get a copy of rpi-source, it can download any version as long as you know the git commit id for it.

You really do not want to revert to a 4.1.xx kernel, that won't boot with the current bootcode.bin GPU blob.

User avatar
DougieLawson
Posts: 38882
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: Download kernel source

Sun Dec 04, 2016 3:22 pm

The boot sequence is chip ROM boots bootcode.bin on the GPU, bootcode.bin reads config.txt, gets the GPU running then boots kernel.img (or kernel7.img) on the ARM processor.

Bootcode.bin is closed source (proprietary stuff belonging to Broadcom), so for all practical purposes that's just a binary large object (blob) of code that we can't inspect.
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

juranga
Posts: 183
Joined: Fri Nov 06, 2015 11:39 am
Location: Basque Country

Re: Download kernel source

Sun Dec 04, 2016 3:32 pm

DougieLawson wrote:The boot sequence is chip ROM boots bootcode.bin on the GPU, bootcode.bin reads config.txt, gets the GPU running then boots kernel.img (or kernel7.img) on the ARM processor.

Bootcode.bin is closed source (proprietary stuff belonging to Broadcom), so for all practical purposes that's just a binary large object (blob) of code that we can't inspect.
Many thanks for the explanation :)


I have tried downloading the kernel source and I have had some problems.

I did:
git clone --depth=1 https://github.com/raspberrypi/linux
git show-ref
//there are only the last three versions

I checked at git the ID of kernel 4.1.7-v7+ (https://github.com/Hexxeh/rpi-firmware/ ... 3e99fbf9a7)
ID:6ade0bac40feeaaaf8ef20eb6b90843e99fbf9a7

sudo git checkout 6ade0bac40feeaaaf8ef20eb6b90843e99fbf9a7
fatal: reference is not a tree: 6ade0bac40feeaaaf8ef20eb6b90843e99fbf9a7



Moreover, I have tried with:
sudo wget https://raw.githubusercontent.com/notro ... rpi-source -O /usr/bin/rpi-source && sudo chmod +x /usr/bin/rpi-source && /usr/bin/rpi-source -q --tag-update
But it gives me some gcc version error. I have 4.9.2-10

User avatar
DougieLawson
Posts: 38882
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: Download kernel source

Sun Dec 04, 2016 6:43 pm

Use a flag --skip-gcc to avoid that silly GCC version warning.
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

juranga
Posts: 183
Joined: Fri Nov 06, 2015 11:39 am
Location: Basque Country

Re: Download kernel source

Sun Dec 04, 2016 10:23 pm

Many many thanks for your help DougieLawson!

I have achieve downloading the kernel source .tar.gz file but there is some problem unpacking it... :(

pi@raspberrypi ~/try-kernel $ sudo /usr/bin/rpi-source --skip-gcc
*** Using: /usr/share/doc/raspberrypi-bootloader/changelog.Debian.gz

*** Latest firmware revision: 960832a6c2590635216c296b6ee0bebf67b21d50

*** Linux source commit: 59e76bb7e2936acd74938bb385f0884e34b91d72

*** Download kernel source: Already downloaded /root/linux-59e76bb7e2936acd74938bb385f0884e34b91d72.tar.gz

*** Unpack kernel source
..........................................................................................................................................................................................................................................................................................................................................................................................
gzip: stdin: unexpected end of file
tar: Fin de fichero inesperado en el archivo
tar: Fin de fichero inesperado en el archivo
tar: Error is not recoverable: exiting now
Traceback (most recent call last):
File "/usr/bin/rpi-source", line 345, in <module>
sh("cd %s && tar --checkpoint=100 --checkpoint-action=dot -xzf %s" % (args.dest, linux_tar))
File "/usr/bin/rpi-source", line 85, in sh
subprocess.check_call(cmd, shell=True)
File "/usr/lib/python2.7/subprocess.py", line 540, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command 'cd /root && tar --checkpoint=100 --checkpoint-action=dot -xzf /root/linux-59e76bb7e2936acd74938bb385f0884e34b91d72.tar.gz' returned non-zero exit status 2

User avatar
DougieLawson
Posts: 38882
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: Download kernel source

Sun Dec 04, 2016 10:39 pm

Looks like you've had a network failure during the download and got half a file.
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

juranga
Posts: 183
Joined: Fri Nov 06, 2015 11:39 am
Location: Basque Country

Re: Download kernel source

Sun Dec 04, 2016 10:56 pm

You were right! :oops: :oops: :oops:

sarusukh
Posts: 9
Joined: Wed Jul 03, 2019 1:48 am

Re: Download kernel source

Wed Jul 03, 2019 1:51 am

Can you please tell me step by step procedure of how to download kernel source?

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 8739
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

Re: Download kernel source

Wed Jul 03, 2019 9:37 am

sarusukh wrote:
Wed Jul 03, 2019 1:51 am
Can you please tell me step by step procedure of how to download kernel source?
https://www.raspberrypi.org/documentati ... uilding.md
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

sarusukh
Posts: 9
Joined: Wed Jul 03, 2019 1:48 am

Re: Download kernel source

Thu Nov 14, 2019 1:27 pm

I am really struggling with installing linux tool "perf"; (I'm using raspberry pi zero)
My issue is as follows:

When i try to install perf using the following command, it says that its already installed.

sudo apt-get install linux-perf
linux-perf is already the newest version (4.9+80+deb9u4+rpi2).
linux-perf-4.9 set to manually installed.
0 upgraded, 0 newly installed, 0 to remove and 2 not upgraded.


but when i try to run that command, it gives the error as mentioned below:
perf
/usr/bin/perf: line 13: exec: perf_4.19: not found
E: linux-perf-4.19 is not installed.

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 26442
Joined: Sat Jul 30, 2011 7:41 pm

Re: Download kernel source

Thu Nov 14, 2019 2:50 pm

sarusukh wrote:
Thu Nov 14, 2019 1:27 pm
I am really struggling with installing linux tool "perf"; (I'm using raspberry pi zero)
My issue is as follows:

When i try to install perf using the following command, it says that its already installed.

sudo apt-get install linux-perf
linux-perf is already the newest version (4.9+80+deb9u4+rpi2).
linux-perf-4.9 set to manually installed.
0 upgraded, 0 newly installed, 0 to remove and 2 not upgraded.


but when i try to run that command, it gives the error as mentioned below:
perf
/usr/bin/perf: line 13: exec: perf_4.19: not found
E: linux-perf-4.19 is not installed.
Please start a new thread with more details on what you are trying to do.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed.
I've been saying "Mucho" to my Spanish friend a lot more lately. It means a lot to him.

Return to “General discussion”