In L4T 35.1.0, how do I compile the kernel?

"In L4T 35.1.0, how do I compile the kernel? My previous method of compiling the kernel was as follows:

  1. make ARCH=arm64 O=$TEGRA_KERNEL_OUT tegra_defconfig
  2. make ARCH=arm64 O=$TEGRA_KERNEL_OUT -j4
    Compiling the kernel separately:
    • make ARCH=arm64 O=$TEGRA_KERNEL_OUT zImage
    • make ARCH=arm64 O=$TEGRA_KERNEL_OUT dtbs

In the R35.1 tutorial, the kernel compilation method is: ./nvbuild.sh -o $PWD/kernel_out.
Could you guide me on how to modify the default configuration and compile the kernel and device tree separately?"

你直接打開nvbuild.sh,把你不想build的部份註解掉就好…

使用nvbuild.sh,提示下面的錯誤信息:

nvidia@ubuntu:~/l4t/l4t_35_1_0/public$ ./nvbuild.sh -o ../kernel_out/001/
Building kernel-5.10 sources
make: Entering directory '/home/nvidia/l4t/l4t_35_1_0/public/kernel/kernel-5.10'
make[1]: Entering directory '/home/nvidia/l4t/l4t_35_1_0/public/kernel/kernel_out/001'
  GEN     Makefile
  HOSTCC  scripts/basic/fixdep
  HOSTCC  scripts/kconfig/conf.o
  HOSTCC  scripts/kconfig/confdata.o
  HOSTCC  scripts/kconfig/expr.o
  LEX     scripts/kconfig/lexer.lex.c
/bin/sh: 1: flex: not found
make[2]: *** [scripts/Makefile.host:9: scripts/kconfig/lexer.lex.c] Error 127
make[1]: *** [/home/nvidia/l4t/l4t_35_1_0/public/kernel/kernel-5.10/Makefile:633: tegra_defconfig] Error 2
make[1]: Leaving directory '/home/nvidia/l4t/l4t_35_1_0/public/kernel/kernel_out/001'
make: *** [Makefile:213: __sub-make] Error 2
make: Leaving directory '/home/nvidia/l4t/l4t_35_1_0/public/kernel/kernel-5.10'

那就是你沒有裝flex而已…

sudo apt install flex bison

好的,下面的錯誤是該裝什麽?

WRAP    arch/arm64/include/generated/asm/mm-arch-hooks.h
  WRAP    arch/arm64/include/generated/asm/mmiowb.h
  WRAP    arch/arm64/include/generated/asm/msi.h
  WRAP    arch/arm64/include/generated/asm/rwonce.h
  WRAP    arch/arm64/include/generated/asm/serial.h
  WRAP    arch/arm64/include/generated/asm/switch_to.h
  WRAP    arch/arm64/include/generated/asm/unaligned.h
  WRAP    arch/arm64/include/generated/asm/vga.h
make[1]: Entering directory '/home/nvidia/l4t/l4t_35_1_0/public/kernel/kernel_out/001'
  UPD     include/generated/uapi/linux/version.h
make[1]: Leaving directory '/home/nvidia/l4t/l4t_35_1_0/public/kernel/kernel_out/001'
  HOSTCC  scripts/dtc/dtc-parser.tab.o
make[1]: Entering directory '/home/nvidia/l4t/l4t_35_1_0/public/kernel/kernel_out/001'
  UPD     include/generated/utsrelease.h
make[1]: Leaving directory '/home/nvidia/l4t/l4t_35_1_0/public/kernel/kernel_out/001'
  HOSTLD  scripts/dtc/dtc
  HOSTCC  scripts/selinux/genheaders/genheaders
  HOSTCC  scripts/genksyms/genksyms.o
  HOSTCC  scripts/selinux/mdp/mdp
  LEX     scripts/genksyms/lex.lex.c
  YACC    scripts/genksyms/parse.tab.[ch]
  HOSTCC  scripts/genksyms/parse.tab.o
  HOSTCC  scripts/kallsyms
  HOSTCC  scripts/sorttable
  HOSTCC  scripts/genksyms/lex.lex.o
  HOSTLD  scripts/genksyms/genksyms
  HOSTCC  scripts/sign-file
/home/nvidia/l4t/l4t_35_1_0/public/kernel/kernel-5.10/scripts/sign-file.c:25:10: fatal error: openssl/opensslv.h: No such file or directory
   25 | #include <openssl/opensslv.h>
      |          ^~~~~~~~~~~~~~~~~~~~
compilation terminated.
make[2]: *** [scripts/Makefile.host:95: scripts/sign-file] Error 1
make[2]: *** Waiting for unfinished jobs....
  HOSTCC  scripts/asn1_compiler
make[1]: *** [/home/nvidia/l4t/l4t_35_1_0/public/kernel/kernel-5.10/Makefile:1231: scripts] Error 2
make: *** [Makefile:213: __sub-make] Error 2

Google一下就有了

1 Like

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