studlyed
Posts: 2
Joined: Sun Feb 22, 2015 9:29 pm

Compile Pi 2 Kernel

Sun Feb 22, 2015 9:56 pm

Hi all, I just got my Raspberry Pi 2 boards and am needing to compile and boot a different kernel, I need some modules included in the kernel itself. I've followed the instructions at http://www.raspberrypi.org/documentatio ... uilding.md
But the Pi wouldn't boot. After hunting for a bit I found someone suggesting to use the config from the working install, /proc/config.gz. That compiles, and boots, mostly. It stops while trying to run /etc/init. I've tried with both the rpi-3.19.y and rpi-3.18.y branches from the git repository, but it still panics complaining about /etc/init.

The error it gives is:
Starting init: /etc/init exists but couldn't execute it (error -13)
Kernel panic - not syncing: No working init found. Try passing init= option to kernel. See Linux Documentation/init.txt for guidance.

Overview of what I've tried
Compile kernel using rpi-3.18.y
Compile kernel using rpi-3.19.y
Compile kernel using previous checkins
Adding init=/sbin/init to the cmdline.txt file, the kernel did not see this parameter being added
Using default config file from the kernel
Using default config file from the NOOBS install. I don't remember the version, but it was released 2015-02-16
Using default config: make bcmrpi_defconfig
Using default config: make bcm2709_defconfig
Verify the .config file still matches after the make commands.

Does anybody have any ideas as to what I can try to get a new kernel to work? It seems like people just follow the standard custom kernel steps, just using either the config file from a working Pi 2 or the default kernel (bcm2709_defconfig)

Thanks in advance
-Ed-

DirkS
Posts: 9219
Joined: Tue Jun 19, 2012 9:46 pm
Location: Essex, UK

Re: Compile Pi 2 Kernel

Sun Feb 22, 2015 10:26 pm

AFAIK for the Pi2 kernel you only need to make two changes to the tutorial at http://www.raspberrypi.org/documentatio ... uilding.md
- replace bcmrpi_defconfig by bcm2709_defconfig
- name for the kernel itself should be kernel7.img

studlyed
Posts: 2
Joined: Sun Feb 22, 2015 9:29 pm

Re: Compile Pi 2 Kernel

Sun Feb 22, 2015 11:42 pm

I kept playing with this, the method you just mentioned works if using the raspbarian os, but not with the noobs. I just found this out about 10 minutes ago...

DirkS
Posts: 9219
Joined: Tue Jun 19, 2012 9:46 pm
Location: Essex, UK

Re: Compile Pi 2 Kernel

Mon Feb 23, 2015 10:04 am

studlyed wrote:I kept playing with this, the method you just mentioned works if using the raspbarian os, but not with the noobs. I just found this out about 10 minutes ago...
It should still work with Noobs. Noobs is not the OS, it's just the installer and you still have Raspbian as the OS.
For local building it should work with and without Noobs.
If you're cross compiling you have to mount different partitions if you have a Noobs card; this is also described in the tutorial.

Seabug
Posts: 7
Joined: Sat Feb 21, 2015 3:55 pm

Re: Compile Pi 2 Kernel

Mon Feb 23, 2015 12:18 pm

I had that problems with the uncompressed kernel booting too.
Then I copied the zipped image to /boot/kernel7.img and everything worked fine.
Strange

Regards, Steffen

Return to “Raspbian”