Developer Hub / Learning Paths / Learning-Paths / Embedded and Microcontrollers / Get started with the Raspberry Pi 4 /
Linux Kernel Compile
Linux Kernel Compile
Software development examples to investigate the performance differences between the Raspberry Pi 4 and
the Arm cloud server are presented below. Every recent cloud server is faster than a Raspberry Pi 4, but
getting an understanding of the relative differences helps software developers understand what to do on a
cloud server and what to do on a Raspberry Pi 4.
The first example is the Linux kernel compile.
Linux Kernel Compile
One of the benefits of the Raspberry Pi compared to other Linux boards used in embedded projects is the ease
of building the Linux kernel. The good news is the Linux kernel is very easy to build natively on the Raspberry
Pi. The bad news is that it takes a very long time. The instructions even have a warning (with long in bold).
“this step can take a long time depending on the Raspberry Pi model in use”
Follow the Linux kernel information to build a kernel on the Raspberry Pi and then on the cloud server to see
how long it takes.
Follow the instructions for the 64-bit configuration.
The cloud server data shown is for an always free A1 instance on Oracle Cloud with 4 vCPUs and 24 Gb RAM.
System Kernel compile time
Raspberry Pi 4 (8 Gb RAM) 81 min 17 sec
Oracle A1 instance (24 Gb RAM) 20 min 6 sec
The kernel build command sequence is shown below for reference.
For the Raspberry Pi 4:
sudo apt install git bc bison flex libssl-dev make
git clone --depth=1 https://github.com/raspberrypi/linux
cd linux
Get started with the Raspberry Pi 4
KERNEL=kernel8
make bcm2711_defconfig
make -j4 Image.gz modules dtbs
sudo make modules_install
sudo cp arch/arm64/boot/dts/broadcom/*.dtb /boot/
sudo cp arch/arm64/boot/dts/overlays/*.dtb* /boot/overlays/
sudo cp arch/arm64/boot/dts/overlays/README /boot/overlays/
sudo cp arch/arm64/boot/Image.gz /boot/$KERNEL.img
For an Arm cloud server running Ubuntu 22.04 :
sudo apt install git bc bison flex libssl-dev make libc6-dev libncurses5-dev
sudo apt install crossbuild-essential-arm64
git clone --depth=1 https://github.com/raspberrypi/linux
cd linux
KERNEL=kernel8
make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- bcm2711_defconfig
make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- Image modules dtbs -j6
Kernel building is significantly faster on the Arm cloud server and the instructions work perfectly, even though
they were intended for cross compiling from another architecture. The drawback is the results must be copied
to the Raspberry Pi 4 to use them, extra steps which take time.
Back Next
I Develop For Learn Community and Blogs
AI Documentation Communities
Automotive Learning Paths Blogs
Embedded and Microcontrollers On-Demand Videos Developer Events
Internet of Things Discord
Laptops and Desktops Forums
Mobile, Graphics, and Gaming Groups
Servers and Cloud Computing
Support CPU and Hardware About Arm
Open a Support Case Architectures Leadership
My Support Cases Compare IP Arm Offices
Contact Support Compute Subsystems Careers
Product Support Forums Corstone Contact Us
Documentation Memory Model Tool Newsroom
Downloads Performance Analysis Trust Center
Licensing Processors
Support and Training Options Reference Designs
Cookie Policy | Glossary | Terms of Use | Privacy Policy | Accessibility | Subscription Center | Trademarks
Copyright © 1995-2025 Arm Limited (or its affiliates). All rights reserved.