Kernel source code issue

当我解压kernel_src.tbz2这个压缩包后:
tuning@iking-System-Product-Name:~/nvidia2/toolchain/sources/Linux_for_Tegra/source/public/kernel$ tree -L 1
.
├── kernel-5.10
├── nvethernetrm
├── nvgpu
└── nvidia

我编译没有做任何修改。仅仅使用如下指令:
./nvbuild.sh -o $PWD/kernel_out

我看这几个目录下都有很多一样的目录,这几个目录作用是什么? 需要怎么去使用?

我现在遇到的问题是在外面编译相机的i2c驱动 ko。

KERNEL_DIR = /home/tuning/nvidia2/toolchain/sources/Linux_for_Tegra/source/public/kernel_out

PWD := $(shell pwd)
CROSS_COMPILE = /home/tuning/nvidia2/toolchain/bin/aarch64-buildroot-linux-gnu-
CC    = $(CROSS_COMPILE)gcc
LD    = $(CROSS_COMPILE)ld

obj-m := sc432ai.o

modules:
        make ARCH=arm64  -C $(KERNEL_DIR) M=$(PWD) modules

clean:
        rm -rf *.o *~ core .depend .*.cmd *.ko *.mod.c *.symvers modul*

.PHONY: modules clean

sc432ai.c文件中#include <media/tegra-v4l2-camera.h>
这个文件是在

tuning@iking-System-Product-Name:~/nvidia2/toolchain/sources/Linux_for_Tegra/source/public/kernel_out$ ls ../kernel/nvidia/include/media/tegra-v4l2-camera.h 
../kernel/nvidia/include/media/tegra-v4l2-camera.h

我怎么修改编译这个驱动模块。能访问到这个头文件路径下?

Hi,
Please follow the steps in

Kernel Customization — NVIDIA Jetson Linux Developer Guide 1 documentation

To manually build kernel image. Would suggest build default kernel first and apply it to developer kit, to ensure it works first. And then do kernel customization.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.