Hardware Reference
In-Depth Information
that both the root and boot partitions are mounted, because you will need to copy
files to both partitions.
Go ahead and copy the new core Linux kernel image into the mounted boot partition
on the SD card:
$ su -c 'cp -a arch/arm/boot/Image /mnt/raspi-boot/new-kernel.img'
By default, the Raspberry Pi GPU firmware attempts to boot kernel.img from the boot
partition. Since you are installing a new kernel, you probably want to override this
behavior.
If you want it to boot a different filename, you can specify that by adding a line to
config.txt (also found on the boot partition). If for some reason config.txt is not
present on the boot partition (it is not necessary for the Raspberry Pi to boot Linux),
simply create a new file with that filename.
To boot a specific file, edit /mnt/raspi-boot/config.txt and add a line like this:
kernel=new-kernel.img
In this example, the Raspberry Pi GPU will now look for new-kernel.img on the boot
partition of the SD card and try to execute it at boot time. Conveniently, this is the
name we used when we copied over the new kernel image. We used a new name here
to avoid conflicts with the stock Linux kernel image file kernel.img that came with your
Raspberry Pi Linux distribution. From here on, we will assume that the Raspberry Pi
Linux distribution is configured to boot your new kernel image file (as specified by
kernel= ).
The second set of files that you need to copy over are the prebuilt Linux kernel modules
that match the new kernel image file. If you built a new Linux kernel from source, you'll
need to install your new modules into a temporary directory. To do this, simply run
these commands from the top level of your kernel source code tree:
$ mkdir ~/modules
$ make ARCH=arm CROSS_COMPILE=arm-rpi-linux-gnueabi- \
INSTALL_MOD_PATH=~/modules modules_install
Unlike the core Linux kernel image (which has to be on the boot partition), the kernel
modules live in the root partition—specifically, in the /lib/modules directory. All you
need to do to install them is to copy the whole versioned directory (or directories)
into /lib/modules on the mounted root SD card partition. For your custom-built kernel,
these commands will copy over the proper modules:
$ cd ~/modules
$ su -c 'cp -a lib/modules/* /mnt/raspi-root/lib/modules/'
Search WWH ::




Custom Search