vamsikm15
Posts: 7
Joined: Mon Nov 11, 2013 3:26 pm

Boot the raspberry pi with a different kernel

Mon Nov 11, 2013 3:33 pm

In our project we are using a specific kernel. I managed to install that kernel version in the pre-built debian image. Now I would like to switch to that kernel. Usually I do with grub.But I came to know that grub is not available in RPI. I appreciate any little help.

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

Re: Boot the raspberry pi with a different kernel

Mon Nov 11, 2013 11:31 pm

The RPi boots from the primary fat (type 0x0c) partition on the SDCard.

That's mounted at /boot once Linux is running.

In that directory you have the following files:

Code: Select all

-rwxr-xr-x  1 root root   17824 Nov 10 17:44 bootcode.bin
-rwxr-xr-x  1 root root      97 Jul 31 00:33 cmdline.txt
-rwxr-xr-x  1 root root    1256 Nov  9 14:28 config.txt
-rwxr-xr-x  1 root root      41 Nov 10 17:46 .firmware_revision
-rwxr-xr-x  1 root root    2064 Nov 10 17:44 fixup_cd.dat
-rwxr-xr-x  1 root root    5771 Nov 10 17:44 fixup.dat
-rwxr-xr-x  1 root root    8804 Nov 10 17:44 fixup_x.dat
-rwxr-xr-x  1 root root     137 Jul 15  2012 issue.txt
-rwxr-xr-x  1 root root 9788144 Nov 10 17:44 kernel_emergency.img
-rwxr-xr-x  1 root root 3141808 Nov 10 17:44 kernel.img
-rwxr-xr-x  1 root root  479128 Nov 10 17:44 start_cd.elf
-rwxr-xr-x  1 root root 2505332 Nov 10 17:44 start.elf
-rwxr-xr-x  1 root root 3483844 Nov 10 17:44 start_x.elf
There's two kernel*.img's there (one for normal running, one for recovery).

Rename kernel.img to kernel.img~ (for backup)
Copy your new kernel.img into that directory and reboot.
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.

vamsikm15
Posts: 7
Joined: Mon Nov 11, 2013 3:26 pm

Re: Boot the raspberry pi with a different kernel

Wed Nov 13, 2013 10:07 am

Thanks @ DougieLawson

Sorry for not explaining my problem fully.

The problem is: I am installing 2.6.32 kernel in raspeberry pi B revision 2. Replacing kernel.img is not working for this kernel version. Any ideas?

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

Re: Boot the raspberry pi with a different kernel

Wed Nov 13, 2013 10:45 am

vamsikm15 wrote:Thanks @ DougieLawson

Sorry for not explaining my problem fully.

The problem is: I am installing 2.6.32 kernel in raspeberry pi B revision 2. Replacing kernel.img is not working for this kernel version. Any ideas?
So your kernel build is broken. What output, if any, do you get?
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed. Here's an example...
"My grief counseller just died, luckily, he was so good, I didn't care."

vamsikm15
Posts: 7
Joined: Mon Nov 11, 2013 3:26 pm

Re: Boot the raspberry pi with a different kernel

Wed Nov 13, 2013 10:55 am

@ DougieLawson

I am getting no output. I getting a coloured screen.

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

Re: Boot the raspberry pi with a different kernel

Wed Nov 13, 2013 11:00 am

How did you build the kernel?
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed. Here's an example...
"My grief counseller just died, luckily, he was so good, I didn't care."

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

Re: Boot the raspberry pi with a different kernel

Wed Nov 13, 2013 11:08 am

vamsikm15 wrote:The problem is: I am installing 2.6.32 kernel in raspeberry pi B revision 2. Replacing kernel.img is not working for this kernel version. Any ideas?
Where did you kernel come from? Is it designed to run on the Raspberry Pi? If no, then it's not going to work.
The kernel contains all the processor and board specific code a system needs. It needs to be built for exactly the right processor/board.

vamsikm15
Posts: 7
Joined: Mon Nov 11, 2013 3:26 pm

Re: Boot the raspberry pi with a different kernel

Wed Nov 13, 2013 11:21 am

I have installed the kernel from debian repository. The name is linux-image-2.6.32-5-iop32x. I also saw some other kernel images in the debian repository. I don't know which one is the right one for the chip board. So I installed the above kernel and changed the vmlinuz-2.6.32-5-iop32x into kernel.img. It didn't work for me. I don't know whether this the right way or not.

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

Re: Boot the raspberry pi with a different kernel

Wed Nov 13, 2013 11:27 am

vamsikm15 wrote:I have installed the kernel from debian repository. The name is linux-image-2.6.32-5-iop32x. I also saw some other kernel images in the debian repository. I don't know which one is the right one for the chip board. So I installed the above kernel and changed the vmlinuz-2.6.32-5-iop32x into kernel.img. It didn't work for me. I don't know whether this the right way or not.
No, I don't think that will work. You need a kernel image specifically built for the Raspberry. I don'think the images in the debian repository have anything like that.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed. Here's an example...
"My grief counseller just died, luckily, he was so good, I didn't care."

vamsikm15
Posts: 7
Joined: Mon Nov 11, 2013 3:26 pm

Re: Boot the raspberry pi with a different kernel

Wed Nov 13, 2013 12:25 pm

May I know how to solve this problem? I recently started working with kernel. I don't have much knowledge with kernel. Could you please guide me to a link to build the kernel myself.

Thank you very much for your support.

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

Re: Boot the raspberry pi with a different kernel

Wed Nov 13, 2013 12:31 pm

If you need a very specific kernel version rather than the one supplied with the Raspi, I do not know how to go about that. It might be a painful task if you are not experienced with the kernel.

Why do you need a specific kernel number?
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed. Here's an example...
"My grief counseller just died, luckily, he was so good, I didn't care."

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

Re: Boot the raspberry pi with a different kernel

Wed Nov 13, 2013 12:49 pm

vamsikm15 wrote:May I know how to solve this problem? I recently started working with kernel. I don't have much knowledge with kernel. Could you please guide me to a link to build the kernel myself.

Thank you very much for your support.
You should start by installing Raspbian from the normal download at http://downloads.raspberrypi.org/raspbian_latest
Once you have that kernel and system running then you can work with that to get your application running.

I've built kernels on x86 machines in the past (when I used to run SuSE) but for the RPi I'm always going to use one created by the very clever folks at the Raspberry Pi Foundation. It's too much of a PITA to build kernels unless you have a very specific need to do something out of the ordinary. The Raspbian kernel is built with everything as loaded modules and it has ALL of the sane settings in the kernel config.

If I was going to build a kernel on a Pi I'd, probably, buy a second one, one (with a big (32GB) SDCard) running as build machine, one (with a small (4GB) SDCard) running as a test machine. It's going to take a long time (overnight) to build a kernel. Or I'd go with building a cross-compiler environment on Windows.

Raspbian is a good distro, it's enough like the Ubuntu distro that runs on my x86 hardware. It's well supported and relatively stable. And it has this very busy forum to solve the tricky problems.

If I used RedHat/Fedora on my x86 system I'd install Pidora. Same argument for ArchLinux. Stick with what you're used to.

There's a good tutorial at http://www.linuxfromscratch.org/lfs/vie ... ernel.html but that is based on having a running system to build on.
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.

MoosePi
Posts: 112
Joined: Wed Nov 06, 2013 4:42 pm

Re: Boot the raspberry pi with a different kernel

Wed Nov 13, 2013 12:59 pm

It must be noted that ARM Kernel Support was added from version 3.7.x, prior to that, like Raspbian a specific Kernel had to be built, the Official Debian Kernels only support ARMv7 not the Pi's ARMv6 afaia.

It may be an easier task to undertake making the specific software you want to run, run with the Pi's Hardware/Kernel/Firmware !
Pi Forum Search and Google yields answers to many questions

vamsikm15
Posts: 7
Joined: Mon Nov 11, 2013 3:26 pm

Re: Boot the raspberry pi with a different kernel

Thu Nov 14, 2013 9:13 am

Now we started to upgrade our software to make it compatible with newer kernel. We didn't start previously because of time constraint and also the fact that the software is very complex. Thank you very much for your support.

Return to “Debian”