본문 바로가기

라즈베리파이

라즈베리파이 커널 빌드

커널 소스 다운로드
git clone https://github.com/raspberrypi/linux.git
(--depth=1을 주면 마지막 commit의 snapshot을 받으므로 용량이나 시간을 줄일수는 있다)

 

 

커널 버전 선택
git branch -a를 하면 여러 가지 버전중에 선택할수 있는데, 4.19버전을 선택했음
(yocto thud 버전에서 사용한 버전임)

# git branch -a
...
remotes/origin/rpi-4.19.y
remotes/origin/rpi-4.19.y-rt
...

# git chekcout remotes/origin/rpi-4.19.y

 

Makefile에 cross 컴파일러 path 지정
환경변수로 따로 지정하기 보다면 편의를 위해 Makefile에 직접 풀 경로를 입력함

ARCH ?= arm64
CROSS_COMPILE ?= /opt/toolchain/gcc-arm-9.2-2019.12-x86_64-aarch64-none-linux-gnu/bin/aarch64-none-linux-gnu-

 

 

커널 설정
arch/arm64/confis/bcmrpi3_defconfig 를 사용함

make bcmrpi3_defconfig

또는

cp arch/arm64/confis/bcmrpi3_defconfig .config
make menuconfig



커널 빌드
make -j 7
빌드 이후 최종 이미지는 arch/arm64/boot/Image를 사용함