Raspberry Pi 2 kernel self-compile
[
Front page
] [
New
|
List of pages
|
Search
|
Recent changes
]
Start:
[[labs.beatcraft.com]]~
[[Raspberry Pi]]~
[[Raspbian]]~
#contents
*Raspberry Pi 2 kernel self-compile [#y849a1c8]
>
This is a process to compile the kernel on Raspberry 2, w...
~
To create Linux environment for ARM architecture, a x86/x...
As you need a pre-built kernel source, such as USB Wifi d...
~
The self-compiling process is the same to both Raspbian W...
**Required packages [#w3b76267]
>
Please install required packages for building kernel.
$ sudo apt-get install bc ncurses-dev
gcc, make, and git are already included. For Wheezy, the ...
~
The differences between versions do not affect on the bui...
** Obtaining kernel source [#t054625e]
>
Moving to the directory of /usr/src, obtain the kernel so...
beat@raspberrypi ~ $ cd /usr/src/
beat@raspberrypi /usr/src $ sudo -s
~
The main part of kernel~
root@raspberrypi:/usr/src# git clone --depth 1 https://g...
Cloning into 'linux'...
remote: Counting objects: 52876, done.
remote: Compressing objects: 100% (50356/50356), done.
remote: Total 52876 (delta 4012), reused 17583 (delta 18...
Receiving objects: 100% (52876/52876), 142.62 MiB | 1.96...
Resolving deltas: 100% (4012/4012), done.
Checking connectivity... done.
Checking out files: 100% (49946/49946), done.
~
Firmware~
root@raspberrypi:/usr/src# git clone --depth 1 https://g...
rmware.git
Cloning into 'firmware'...
remote: Counting objects: 4077, done.
remote: Compressing objects: 100% (2200/2200), done.
remote: Total 4077 (delta 1702), reused 2305 (delta 1576...
Receiving objects: 100% (4077/4077), 75.59 MiB | 1.21 Mi...
Resolving deltas: 100% (1702/1702), done.
Checking connectivity... done.
Checking out files: 100% (3777/3777), done.
~
As of October 15 2015, the kernel version at rpi-4.1.y br...
**Preparation for the build precess [#i434872b]
>
Please move to the directory where the kernel source is c...
root@raspberrypi:/usr/src/linux# cd linux
root@raspberrypi:/usr/src/linux# modprobe configs
root@raspberrypi:/usr/src/linux# zcat /proc/config.gz > ...
root@raspberrypi:/usr/src/linux# cp ../firmware/extra/Mo...
~
Resulting on config~
root@raspberrypi:/usr/src/linux# make oldconfig
scripts/kconfig/conf --oldconfig Kconfig
#
# configuration written to .config
#
Since the version of new config is identical to the versi...
** Build process [#v8036c0c]
>
Let's start the build process.~
Because CPU of Raspberry Pi 2 has 4 cores, zImage, module...
~
zImge~
root@raspberrypi:/usr/src/linux# time make zImage 2>&1 |...
~~ Skipping ~~
LD arch/arm/boot/compressed/vmlinux
OBJCOPY arch/arm/boot/zImage
Kernel: arch/arm/boot/zImage is ready
real 76m45.564s
user 76m33.100s
sys 3m42.070s
~
modules~
root@raspberrypi:/usr/src/linux# time make modules 2>&1 ...
~~ Skipping ~~
IHEX firmware/yam/1200.bin
IHEX firmware/yam/9600.bin
real 214m43.233s
user 204m52.790s
sys 10m32.480s
~
dtbs~
root@raspberrypi:/usr/src/linux# time make dtbs 2>&1 | t...
~~ 中略 ~~
DTC arch/arm/boot/dts/overlays/w1-gpio-pullup-over...
DTC arch/arm/boot/dts/bcm2709-rpi-2-b.dtb
real 0m10.528s
user 0m3.110s
sys 0m1.650s
**Installation [#q3b810e7]
>
Because these are self-compiled, they can be installed wi...
~
Modules~
root@raspberrypi:/usr/src/linux# make modules_install
~~ Skipping ~~
INSTALL /lib/firmware/yam/9600.bin
DEPMOD 4.1.10-v7+
~
dtb~
root@raspberrypi:/usr/src/linux# ls arch/arm/boot/dts/*....
arch/arm/boot/dts/bcm2709-rpi-2-b.dtb
root@raspberrypi:/usr/src/linux# cp arch/arm/boot/dts/*....
>
root@raspberrypi:/usr/src/linux# cp arch/arm/boot/dts/ov...
root@raspberrypi:/usr/src/linux# cp arch/arm/boot/dts/ov...
~
zImage~
Raspbian stores two zImages at /boot/ directory. The one...
root@raspberrypi:/usr/src/linux# cp /boot/kernel7.img /b...
root@raspberrypi:/usr/src/linux# scripts/mkknlimg arch/a...
root@raspberrypi:/usr/src/linux# ./scripts/mkknlimg arch...
Version: Linux version 4.1.10-v7+ (root@raspberrypi) (gc...
DT: y
283x: n
** Rebooting [#s4b961ee]
>
To boot from the newly built kernel, please reboot the sy...
# reboot
~
To check whether the newly build kernel is working or not...
pi@raspberrypi:~$ uname -a
Linux raspberrypi 4.1.10-v7+ #1 SMP PREEMPT Fri Oct 16 2...
~
To look at the status, if the new kernel is working, unam...
pi@raspberrypi:~$ uname -a
Linux raspberrypi 4.1.10-v7+ #821 SMP PREEMPT Sat Oct 10...
*Revision History [#ue3c0e62]
>
-2016-02-15 This document is initially released
End:
[[labs.beatcraft.com]]~
[[Raspberry Pi]]~
[[Raspbian]]~
#contents
*Raspberry Pi 2 kernel self-compile [#y849a1c8]
>
This is a process to compile the kernel on Raspberry 2, w...
~
To create Linux environment for ARM architecture, a x86/x...
As you need a pre-built kernel source, such as USB Wifi d...
~
The self-compiling process is the same to both Raspbian W...
**Required packages [#w3b76267]
>
Please install required packages for building kernel.
$ sudo apt-get install bc ncurses-dev
gcc, make, and git are already included. For Wheezy, the ...
~
The differences between versions do not affect on the bui...
** Obtaining kernel source [#t054625e]
>
Moving to the directory of /usr/src, obtain the kernel so...
beat@raspberrypi ~ $ cd /usr/src/
beat@raspberrypi /usr/src $ sudo -s
~
The main part of kernel~
root@raspberrypi:/usr/src# git clone --depth 1 https://g...
Cloning into 'linux'...
remote: Counting objects: 52876, done.
remote: Compressing objects: 100% (50356/50356), done.
remote: Total 52876 (delta 4012), reused 17583 (delta 18...
Receiving objects: 100% (52876/52876), 142.62 MiB | 1.96...
Resolving deltas: 100% (4012/4012), done.
Checking connectivity... done.
Checking out files: 100% (49946/49946), done.
~
Firmware~
root@raspberrypi:/usr/src# git clone --depth 1 https://g...
rmware.git
Cloning into 'firmware'...
remote: Counting objects: 4077, done.
remote: Compressing objects: 100% (2200/2200), done.
remote: Total 4077 (delta 1702), reused 2305 (delta 1576...
Receiving objects: 100% (4077/4077), 75.59 MiB | 1.21 Mi...
Resolving deltas: 100% (1702/1702), done.
Checking connectivity... done.
Checking out files: 100% (3777/3777), done.
~
As of October 15 2015, the kernel version at rpi-4.1.y br...
**Preparation for the build precess [#i434872b]
>
Please move to the directory where the kernel source is c...
root@raspberrypi:/usr/src/linux# cd linux
root@raspberrypi:/usr/src/linux# modprobe configs
root@raspberrypi:/usr/src/linux# zcat /proc/config.gz > ...
root@raspberrypi:/usr/src/linux# cp ../firmware/extra/Mo...
~
Resulting on config~
root@raspberrypi:/usr/src/linux# make oldconfig
scripts/kconfig/conf --oldconfig Kconfig
#
# configuration written to .config
#
Since the version of new config is identical to the versi...
** Build process [#v8036c0c]
>
Let's start the build process.~
Because CPU of Raspberry Pi 2 has 4 cores, zImage, module...
~
zImge~
root@raspberrypi:/usr/src/linux# time make zImage 2>&1 |...
~~ Skipping ~~
LD arch/arm/boot/compressed/vmlinux
OBJCOPY arch/arm/boot/zImage
Kernel: arch/arm/boot/zImage is ready
real 76m45.564s
user 76m33.100s
sys 3m42.070s
~
modules~
root@raspberrypi:/usr/src/linux# time make modules 2>&1 ...
~~ Skipping ~~
IHEX firmware/yam/1200.bin
IHEX firmware/yam/9600.bin
real 214m43.233s
user 204m52.790s
sys 10m32.480s
~
dtbs~
root@raspberrypi:/usr/src/linux# time make dtbs 2>&1 | t...
~~ 中略 ~~
DTC arch/arm/boot/dts/overlays/w1-gpio-pullup-over...
DTC arch/arm/boot/dts/bcm2709-rpi-2-b.dtb
real 0m10.528s
user 0m3.110s
sys 0m1.650s
**Installation [#q3b810e7]
>
Because these are self-compiled, they can be installed wi...
~
Modules~
root@raspberrypi:/usr/src/linux# make modules_install
~~ Skipping ~~
INSTALL /lib/firmware/yam/9600.bin
DEPMOD 4.1.10-v7+
~
dtb~
root@raspberrypi:/usr/src/linux# ls arch/arm/boot/dts/*....
arch/arm/boot/dts/bcm2709-rpi-2-b.dtb
root@raspberrypi:/usr/src/linux# cp arch/arm/boot/dts/*....
>
root@raspberrypi:/usr/src/linux# cp arch/arm/boot/dts/ov...
root@raspberrypi:/usr/src/linux# cp arch/arm/boot/dts/ov...
~
zImage~
Raspbian stores two zImages at /boot/ directory. The one...
root@raspberrypi:/usr/src/linux# cp /boot/kernel7.img /b...
root@raspberrypi:/usr/src/linux# scripts/mkknlimg arch/a...
root@raspberrypi:/usr/src/linux# ./scripts/mkknlimg arch...
Version: Linux version 4.1.10-v7+ (root@raspberrypi) (gc...
DT: y
283x: n
** Rebooting [#s4b961ee]
>
To boot from the newly built kernel, please reboot the sy...
# reboot
~
To check whether the newly build kernel is working or not...
pi@raspberrypi:~$ uname -a
Linux raspberrypi 4.1.10-v7+ #1 SMP PREEMPT Fri Oct 16 2...
~
To look at the status, if the new kernel is working, unam...
pi@raspberrypi:~$ uname -a
Linux raspberrypi 4.1.10-v7+ #821 SMP PREEMPT Sat Oct 10...
*Revision History [#ue3c0e62]
>
-2016-02-15 This document is initially released
Page: