NVIDIA/Jetson
Preparing to Build External Kernel Modules
rorosi
2023. 5. 21. 18:38
728x90
Jetson 시스템에서 Jetson Linux 커널 헤더를 준비
Jetson 시스템에서는 이 디렉터리의 파일을 사용하여 추가 작업 없이 트리 외부 모듈을 빌드할 수 있다.
/usr/src/linux-headers-$(uname -r)-ubuntu20.04_aarch64
또는:
/lib/modules/$(uname -r)/build/
비 Jetson 시스템에서 Jetson Linux 커널 헤더를 준비
커널 헤더 압축 파일을 추출하고 다음 명령을 사용하여 로컬 디렉터리에 배치한다.
$ cd <모듈 소스 위치>
$ tar -xjf <top>/Linux_for_Tegra/kernel/kernel_headers.tbz2
이 디렉토리의 파일을 사용하여 트리 외부 모듈을 빌드할 수 있다.
트리 외부 모듈을 빌드하려면 커널 디렉토리를 다음과 같이 지정한다.
<모듈 소스 위치>/linux-headers-$(uname -r)-linux_x86_64/kernel-5.10
외부 커널 모듈을 구축
- 커널을 크로스 컴파일하는 경우 환경 변수가 설정되었는지 확인한다.
- 트리 외부 커널 모듈을 빌드하려면 다음 명령을 입력한다.
$ cd <path_to_module_source>
$ make ARCH=arm64 O=<kernel_directory> M=$(pwd)
위 과정을 통해 전체 커널을 빌드하지 않고 특정 모듈을 빌드 할 수 있다. ex) camera.ko
경로는 본인 환경에 맞춰서 수정해야 한다.
모듈 구축 용 Makefile
참고 :
Kernel Customization — Jetson Linux<br/>Developer Guide 34.1 documentation
Before you build the kernel you must install the Jetson Linux build utilities. Enter the command: To sign and encrypt kernel, kernel-dtb, and initrd binary files To support Secure Boot, the kernel, kernel-dtb, and initrd binary files must be signed and enc
docs.nvidia.com
728x90