I do a lot of experiments with my new RPi nowadays. It's like in the old days, in the early of '90s, when I've got my HC-91, the Romanian ZX-Spectrum clone.
There is one small difference, though: the HC-91 has been delivered with a case an ROM-stored BASIC interpretor. The RPi has no case nor a pre-installed OS, so you have to take care of both.
To compile the Linux kernel for Raspberry Pi (i.e. ARM architecture) one should accomplish at least 8 different steps:
- fetching the (last) Linux kernel source code (git://github.com/raspberrypi/linux.git)
- fetching the (last) RPi firmware (git://github.com/raspberrypi/firmware.git)
- configuring the kernel according with the target architecture
- compiling the kernel and its modules
- copying the kernel image to the boot partition
- copying the RPi firmware to the boot partition
- (optional) configuring the kernel boot command-line and its start-up configuration
- last but not least, copying the RPi firmware utilities to the target /opt/ directory
If you have to do often this task then it would be better to automate those steps. Because I did that many times and because I love to create my own scripts that makes my live easier (in the future), I wrote an automation script that accomplish all these steps in order to boost Linux kernel compilation for Raspberry Pi.
This script assumes that you have already a crossdev environment prepared so you can use your cross-arm-compiler right away:
Raspberry Pi kernel compilation automation script. Usage    : /usr/sbin/rpi-build [options] Options  :      -w : the working directory (mandatory)      -c : CC prefix for the TARGET architecture      -f : the path to your predefined Linux kernel .config file      -p : the name of the boot partition of your RPi      -t : the type of the partition specified by -p parameter      -h : print this help message Report bugs to eugenmihailescux at gmail dot com
The
The
The <.config> is the path to a predefined Linux kernel .config file. You can use a predefined .config Linux kernel configuration file so that you don't have to configure the kernel every time you run this script. For my RPi model B I have already created a cut-down RPi configuration and can be found here.
The
The
The script can be downloaded from here.
Now, if you think that this article was interesting don't forget to rate it. It shows me that you care and thus I will continue write about these things.
Eugen Mihailescu
Latest posts by Eugen Mihailescu (see all)
- Dual monitor setup in Xfce - January 9, 2019
- Gentoo AMD Ryzen stabilizator - April 29, 2018
- Symfony Compile Error Failed opening required Proxies - January 22, 2018