Update kernel and modules of a Raspberry Pi

Last week, i received my new Raspberry Pi with 512MB RAM, which should replace my current 256MB RPi.

Unfortunately, i was not able to boot the system with the SD card from the old Pi. The old one was running on kernel 3.2.16-rpi1+, which is a bit older. Because of that, i decided to update the kernel and boot stuff to the most current version without touching the rest of the system. This should definitely work with the newer hardware.

Backup current system

It’s always a good idea to have a current backup of the system before playing around. Skip this step at your own risk…

Download current kernel package

Download the current firmware from Github:
https://github.com/raspberrypi/firmware/archive/master.zip

Unpack the file in a temporary folder.

Copy data to SD card

Insert the SD card into your card reader. You should get two new volumes (one on Windows):

  • Boot partition (FAT, Read and Writable, contains “kernel.img” and “bootcode.bin” f.ex. )
  • Data partition (ext2, Read-Only on Mac, Read-Write on Linux, Not visible in Windows)

Remove all data from the boot partition, except the config.txt if you have one.

The unpacked Zip-archive contains a folder named “boot”. Copy the content of this folder to the root of the boot partition.

Copy precompiled kernel modules

If you’re using Linux, you should be able to copy the kernel modules on your PC. If  not, skip the next step.

Linux

The kernel modules are located at the “modules” directory of the Zip-archive. Copy the folder within the modules folder (f.ex. 3.6.11+) to /lib/modules on the data partition of the SD card.

You now should be able to boot the system with all updated kernel modules

Other systems

Eject the SD card, insert it into your Raspberry Pi and boot it.

Connect to the Raspberry Pi.
Execute “uname -r” to veryfy the new kernel version (3.6.11+ in my case).

Now you can either copy the “modules” folder of the Zip-archive on your PC/Mac to your RPi, or download the file again. I did the latter:

wget https://github.com/raspberrypi/firmware/tarball/master
tar xfz master

Move files to mudules directory:

cd raspberrypi-firmware-*
mv modules/* /lib/modules/
cd ..
rm -rf raspberrypi-firmware-*

Reboot the Pi:

reboot

You’re done. The Pi should now boot with all current kernel modules.

This entry was posted in Linux, Raspberry Pi. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *