Compile Kernel on RPI2 from RBP2-sources-osmc

You are probably better off using the build scripts that we use to build OSMC packages. So on your Pi 2 install git and build tools:

sudo apt-get install git build-essential

Then clone the OSMC repository:

git clone https://github.com/osmc/osmc.git

Then cd osmc/packages/kernel-osmc

and make rbp2

That’s it. You will end up with deb packages including an rbp2-image-xxxx-osmc.deb which is the binary version of the kernel ready to install with dpkg. If you want to change the kernel revision, (suffix) edit REV near the start of build.sh.

The way the kernel image packages are set up, which ever one is installed last becomes the active kernel. So you can revert to an earlier kernel by running sudo dpkg-reconfigure <kernel package name>

If you are experimenting with your own kernel builds you probably want to disable the removal of old kernels by editing /etc/osmc/prefs.d/update_preferences, otherwise next time you run a My OSMC update all kernels except for the currently running and most recent version will be uninstalled.