树莓派内核及驱动编译环境搭建
一、获取代码和交叉工具链
代码路径:https://github.com/raspberrypi
确认版本
pi@raspberrypi:~ $ uname -a
Linux raspberrypi 5.4.51-v7l+ #1333 SMP Mon Aug 10 16:51:40 BST 2020 armv7l GNU/Linux
pi@raspberrypi:~ $ cat /proc/version
Linux version 5.4.51-v7l+ (dom@buildbot) (gcc version 4.9.3 (crosstool-NG crosstool-ng-1.22.0-88-g8460611)) #1333 SMP Mon Aug 10 16:51:40 BST 2020
内核版本5.4;armv7l 32bit系统;gcc version 4.9.3
download code
# git clone git@github.com:raspberrypi/linux.git -b rpi-5.4.y --depth 10
# git clone git@github.com:raspberrypi/tools.git --depth 10
二、获取树莓派上的config
pi@raspberrypi:~/test $ sudo modprobe configs
pi@raspberrypi:~/test $ zcat /proc/config.gz > config