Support #687
Compile a New Kernel for Arch On Raspberry Pi
Description
While playing around trying to get ZFS to work properly on my Raspberry Pi 2 running Arch Linux, I decided to recompile the Linux kernel with ZFS support built in. This is a guide on my attempts, may eat your cat.
Prepare the Environment¶
- Make sure the system is up to dat:
pacman -Syu
- Install a few dependencies:
pacman -S base-devel git make gcc bc wget rsync screen ncurses
Download the Kernel¶
- Switch to a source directory and download the Raspberry Pi toolchain:
cd /usr/src git clone https://github.com/raspberrypi/tools
- Export the toolchain path:
export CCPREFIX=/usr/src/tools/arm-bcm2708/arm-bcm2708-linux-gnueabi/bin/arm-bcm2708-linux-gnueabi-
- Download the latest kernel from GitHub:
git clone -b rpi-4.1.y http://github.com/raspberrypi/linux
- Then export the kernel source path:
export KERNEL_SRC=/usr/src/linux
Build the Kernel¶
- Prepare the kernel build environment:
cd /usr/src/linux make mrproper
- Load the current config into the kernel source directory:
zcat /proc/config.gz > /usr/src/linux/.config
- Use the previous kernel config with the new kernel build environment:
make oldconfig
- (Optional) Modify the current kernel source configuration:
make menuconfig
- (Optional) Modify the current kernel source configuration:
- Build the kernel:
make -j4
- Install the kernel modules:
make modules_install
- Then backup the old kernel and copy over the new kernel:
cp /boot/kernel7.img /boot/kernel7.old.img cp /usr/src/linux/arch/arm/boot/Image /boot/kernel7.img
- Reboot into the new kernel:
reboot
Resources¶
- http://lostindetails.com/blog/post/Compiling-a-kernel-module-for-the-raspberry-pi-2
- http://openstack.prov12n.com/openstack-on-raspberry-pi-part-2-getting-started/
- https://raspberrypicloud.wordpress.com/2013/03/12/building-an-lxc-friendly-kernel-for-the-raspberry-pi/
- http://elinux.org/Raspberry_Pi_Kernel_Compilation
Updated by Daniel Curtis about 9 years ago
- Status changed from New to Resolved
- % Done changed from 0 to 100