全志v3s学习笔记(5)——主线Linux编译

一、安装交叉编译环境

交叉编译环境跟uboot使用的一样。
参考:arm-linux-gnueabihf 交叉编译工具链安装


二、下载编译linux源码

(默认是zero-4.10.y分支):

git clone https://github.com/Lichee-Pi/linux.git
或者`zero-4.13.y`对网卡的支持更好
git clone -b zero-4.13.y https://github.com/Lichee-Pi/linux.git
cd linux
make ARCH=arm licheepi_zero_defconfig
make ARCH=arm menuconfig   #add bluethooth, etc.
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- -j16
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- -j16 INSTALL_MOD_PATH=out modules
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- -j16 INSTALL_MOD_PATH=out modules_install

三、修改顶层Makefile编译

在内核根目录下的Makefile257行修改默认编译器,可以直接用make编译:

# ARCH		?= $(SUBARCH)
# CROSS_COMPILE	?= $(CONFIG_CROSS_COMPILE:"%"=%)
ARCH		?= arm
CROSS_COMPILE	?= arm-linux-gnueabihf-

编译命令:

make licheepi_zero_defconfig
make menuconfig   #add bluethooth, etc.
make -j16
make -j16 INSTALL_MOD_PATH=out modules
make -j16 INSTALL_MOD_PATH=out modules_install

编译LOG:

pjw@pjw-virtual-machine:~/Allwinner/V3S/linux$ make -j16 INSTALL_MOD_PATH=out modules
  CHK     include/config/kernel.release
  CHK     include/generated/uapi/linux/version.h
  CHK     include/generated/utsrelease.h
  CHK     scripts/mod/devicetable-offsets.h
  CHK     include/generated/timeconst.h
  CHK     include/generated/bounds.h
  CHK     include/generated/asm-offsets.h
  CALL    scripts/checksyscalls.sh
  Building modules, stage 2.
  MODPOST 3 modules
  
pjw@pjw-virtual-machine:~/Allwinner/V3S/linux$ make -j16 INSTALL_MOD_PATH=out modules_install
  INSTALL crypto/echainiv.ko
  INSTALL drivers/staging/rtl8723bs/r8723bs.ko
  INSTALL drivers/video/backlight/lcd.ko
  DEPMOD  4.13.16-licheepi-zero+
pjw@pjw-virtual-machine:~/Allwinner/V3S/linux$ 

编译完成后,zImagearch/arm/boot/下,驱动模块在out/下,sun8i-v3s-licheepi-zero-dock.dtbarch/arm/boot/dts/

猜你喜欢

转载自blog.csdn.net/p1279030826/article/details/113483775