编译Linux kernel时,报这个错误:
ERROR: linux-xlnx-5.10+git999-r0 do_compile_kernelmodules: oe_runmake failed
ERROR: linux-xlnx-5.10+git999-r0 do_compile_kernelmodules: Execution of '/home/silita/silita/petalinux/apps/zu5ev_evk/build/tmp/work/zynqmp_generic-xilinx-linux/linux-xlnx/5.10+git999-r0/temp/run.do_compile_kernelmodules.253004' failed with exit code 1:
make: Entering directory '/home/workspace/silita/petalinux/apps/zu5ev_evk/build/tmp/work/zynqmp_generic-xilinx-linux/linux-xlnx/5.10+git999-r0/linux-xlnx-5.10+git999'
GEN Makefile
CALL /home/workspace/silita/petalinux/kernel/xilinx-kernel-source-5.10-v2021.2/scripts/atomic/check-atomics.sh
CALL /home/workspace/silita/petalinux/kernel/xilinx-kernel-source-5.10-v2021.2/scripts/checksyscalls.sh
CC [M] drivers/gpu/drm/bridge/solomon-ssd2828qn4.o
MODPOST Module.symvers
drivers/gpu/drm/bridge/solomon-ssd2828qn4: struct of_device_id is 200 bytes. The last of 1 is:
0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x73 0x6f 0x6c 0x6f 0x6d 0x6f 0x6e 0x2c 0x73 0x73 0x64 0x32 0x38 0x32 0x38 0x71 0x6e 0x34 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
FATAL: modpost: drivers/gpu/drm/bridge/solomon-ssd2828qn4: struct of_device_id is not terminated with a NULL entry!
make[2]: *** [/home/workspace/silita/petalinux/kernel/xilinx-kernel-source-5.10-v2021.2/scripts/Makefile.modpost:111: Module.symvers] Error 1
make[1]: *** [/home/workspace/silita/petalinux/kernel/xilinx-kernel-source-5.10-v2021.2/Makefile:1396: modules] Error 2
make: *** [/home/workspace/silita/petalinux/kernel/xilinx-kernel-source-5.10-v2021.2/Makefile:185: __sub-make] Error 2
make: Leaving directory '/home/workspace/silita/petalinux/apps/zu5ev_evk/build/tmp/work/zynqmp_generic-xilinx-linux/linux-xlnx/5.10+git999-r0/linux-xlnx-5.10+git999'
WARNING: /home/silita/silita/petalinux/apps/zu5ev_evk/build/tmp/work/zynqmp_generic-xilinx-linux/linux-xlnx/5.10+git999-r0/temp/run.do_compile_kernelmodules.253004:230 exit 1 from 'exit 1'
WARNING: Backtrace (BB generated script):
#1: bbfatal_log, /home/silita/silita/petalinux/apps/zu5ev_evk/build/tmp/work/zynqmp_generic-xilinx-linux/linux-xlnx/5.10+git999-r0/temp/run.do_compile_kernelmodules.253004, line 230
#2: die, /home/silita/silita/petalinux/apps/zu5ev_evk/build/tmp/work/zynqmp_generic-xilinx-linux/linux-xlnx/5.10+git999-r0/temp/run.do_compile_kernelmodules.253004, line 214
#3: oe_runmake, /home/silita/silita/petalinux/apps/zu5ev_evk/build/tmp/work/zynqmp_generic-xilinx-linux/linux-xlnx/5.10+git999-r0/temp/run.do_compile_kernelmodules.253004, line 209
#4: do_compile_kernelmodules, /home/silita/silita/petalinux/apps/zu5ev_evk/build/tmp/work/zynqmp_generic-xilinx-linux/linux-xlnx/5.10+git999-r0/temp/run.do_compile_kernelmodules.253004, line 170
#5: main, /home/silita/silita/petalinux/apps/zu5ev_evk/build/tmp/work/zynqmp_generic-xilinx-linux/linux-xlnx/5.10+git999-r0/temp/run.do_compile_kernelmodules.253004, line 233
Backtrace (metadata-relative locations):
#1: bbfatal_log, /home/silita/silita/petalinux/apps/zu5ev_evk/components/yocto/layers/core/meta/classes/logging.bbclass, line 72
#2: die, /home/silita/silita/petalinux/apps/zu5ev_evk/components/yocto/layers/core/meta/classes/base.bbclass, line 56
#3: oe_runmake, /home/silita/silita/petalinux/apps/zu5ev_evk/components/yocto/layers/core/meta/classes/base.bbclass, line 65
#4: do_compile_kernelmodules, /home/silita/silita/petalinux/apps/zu5ev_evk/components/yocto/layers/meta-petalinux/oe-core/meta/classes/kernel.bbclass, line 377
ERROR: Logfile of failure stored in: /home/silita/silita/petalinux/apps/zu5ev_evk/build/tmp/work/zynqmp_generic-xilinx-linux/linux-xlnx/5.10+git999-r0/temp/log.do_compile_kernelmodules.253004
这个错误的关键信息是:FATAL: modpost: drivers/gpu/drm/bridge/solomon-ssd2828qn4: struct of_device_id is not terminated with a NULL entry!
根据错误提示,查询代码,原来是ssd2828 linux驱动代码ssd2828qn4_of_match结构导致的问题。
错误代码是:
static const struct of_device_id ssd2828qn4_of_match[] = {
{
.compatible = "solomon,ssd2828qn4",
.data = NULL,
},
};
正确代码应该是:
static const struct of_device_id ssd2828qn4_of_match[] = {
{
.compatible = "solomon,ssd2828qn4",
.data = NULL,
},
{}
};
需要多加一个{}。否则就会报:struct of_device_id is not terminated with a NULL entry!的错误。