更新 yocto 上的自定义设备树

问题描述 投票:0回答:4

我正在使用 sama5d27-wlsom1-ek 板进行演示,并且我正在尝试对设备树进行更改。

到目前为止,我已经编译了 core-image-minimal 并发现我的 dtb 文件生成在

/tmp/work/sama5d27_wlsom1_ek_sd-poky-linux-gnueabi/linux-at91/5.4+gitAUTOINC+3dba8c9991-r0/build/arch/arm/boot/dts

文件夹。

我还发现了许多不同的 dts 文件

build/tmp/work-shared/sama5d27-wlsom1-ek-sd/kernel-source/arch/arm/boot/dts

但是,如果设备树文件是在构建文件夹内生成的,我的机器从哪里获取设备树文件?如果我使用自定义 dts 文件,如何更新它们?

我想使用我的 custom.dts 文件构建映像,在其中启用某些外围设备并禁用不需要的外围设备。 (将来定制 dtb 的测试)。

我尝试了这里找到的不同方法 如何在 Yocto 中使用自己的设备树和修改后的内核配置?仅使用 Yocto/bitbake 快速重建设备树?

我创建了一个新的

meta-local
图层并将其添加到
bblayer
接下来是
recipetool
命令将我的 dts 文件添加到新图层。将
KERNEL_DEVICETREE += "custom.dtb"
添加到在元本地生成的
.bbappend
文件中,然后运行
bitbake
构建镜像命令到目前为止 但是,当我尝试构建图像时,我似乎遇到了以下错误。

    Loading cache: 100% |############################################| Time: 0:00:00
Loaded 3474 entries from dependency cache.
Parsing recipes: 100% |##########################################| Time: 0:00:00
Parsing of 2309 .bb files complete (2307 cached, 2 parsed). 3476 targets, 358 skipped, 0 masked, 0 errors.
NOTE: Resolving any missing task queue dependencies

Build Configuration:
BB_VERSION           = "1.46.0"
BUILD_SYS            = "x86_64-linux"
NATIVELSBSTRING      = "universal"
TARGET_SYS           = "arm-poky-linux-gnueabi"
MACHINE              = "sama5d27-wlsom1-ek-sd"
DISTRO               = "poky-atmel"
DISTRO_VERSION       = "3.1.7"
TUNE_FEATURES        = "arm vfp cortexa5 neon vfpv4 thumb callconvention-hard"
TARGET_FPU           = "hard"
meta                 
meta-poky            
meta-yocto-bsp       = "dunfell:97a9f30f1c457c55bf0c791d0466ff8620110a49"
meta-oe              
meta-networking      
meta-webserver       
meta-python          
meta-initramfs       = "dunfell:2915810edbb6599051e30efb3b7f805665ddcc23"
meta-atmel           = "dunfell:d6e30f2c0e3592ed11f3a4c8380a14d0a9066ba6"
meta-multimedia      = "dunfell:2915810edbb6599051e30efb3b7f805665ddcc23"
meta-aws             = "dunfell:2e2a1c65603dc5d11349e25dc9470a65cbeb8e65"
meta-freshair        
meta-local           
workspace            = "dunfell:97a9f30f1c457c55bf0c791d0466ff8620110a49"

Initialising tasks: 100% |#######################################| Time: 0:00:04
Sstate summary: Wanted 294 Found 262 Missed 32 Current 2095 (89% match, 98% complete)
NOTE: Executing Tasks
ERROR: linux-at91-5.4+gitAUTOINC+3dba8c9991-r0 do_compile: oe_runmake failed
ERROR: linux-at91-5.4+gitAUTOINC+3dba8c9991-r0 do_compile: Execution of '/home/fakhruddin/workspace/Freshair/my_dir/poky/build/tmp/work/sama5d27_wlsom1_ek_sd-poky-linux-gnueabi/linux-at91/5.4+gitAUTOINC+3dba8c9991-r0/temp/run.do_compile.57871' failed with exit code 1:
  GEN     Makefile
  CALL    /home/fakhruddin/workspace/Freshair/my_dir/poky/build/tmp/work-shared/sama5d27-wlsom1-ek-sd/kernel-source/scripts/atomic/check-atomics.sh
  CALL    /home/fakhruddin/workspace/Freshair/my_dir/poky/build/tmp/work-shared/sama5d27-wlsom1-ek-sd/kernel-source/scripts/checksyscalls.sh
  CHK     include/generated/compile.h
  Kernel: arch/arm/boot/Image is ready
  Kernel: arch/arm/boot/zImage is ready
make[2]: *** No rule to make target 'arch/arm/boot/dts/new_name.dtb'.  Stop.
make[1]: *** [/home/fakhruddin/workspace/Freshair/my_dir/poky/build/tmp/work-shared/sama5d27-wlsom1-ek-sd/kernel-source/Makefile:1265: new_name.dtb] Error 2
make: *** [/home/fakhruddin/workspace/Freshair/my_dir/poky/build/tmp/work-shared/sama5d27-wlsom1-ek-sd/kernel-source/Makefile:179: sub-make] Error 2
WARNING: exit code 1 from a shell command.

ERROR: Logfile of failure stored in: /home/fakhruddin/workspace/Freshair/my_dir/poky/build/tmp/work/sama5d27_wlsom1_ek_sd-poky-linux-gnueabi/linux-at91/5.4+gitAUTOINC+3dba8c9991-r0/temp/log.do_compile.57871
Log data follows:
| DEBUG: Executing shell function do_compile
| NOTE: KBUILD_BUILD_TIMESTAMP: Thu Jan 14 12:54:56 UTC 2021
| NOTE: make -j 12 HOSTCC=gcc  -isystem/home/fakhruddin/workspace/Freshair/my_dir/poky/build/tmp/work/sama5d27_wlsom1_ek_sd-poky-linux-gnueabi/linux-at91/5.4+gitAUTOINC+3dba8c9991-r0/recipe-sysroot-native/usr/include -O2 -pipe -L/home/fakhruddin/workspace/Freshair/my_dir/poky/build/tmp/work/sama5d27_wlsom1_ek_sd-poky-linux-gnueabi/linux-at91/5.4+gitAUTOINC+3dba8c9991-r0/recipe-sysroot-native/usr/lib                         -L/home/fakhruddin/workspace/Freshair/my_dir/poky/build/tmp/work/sama5d27_wlsom1_ek_sd-poky-linux-gnueabi/linux-at91/5.4+gitAUTOINC+3dba8c9991-r0/recipe-sysroot-native/lib                         -Wl,--enable-new-dtags                         -Wl,-rpath-link,/home/fakhruddin/workspace/Freshair/my_dir/poky/build/tmp/work/sama5d27_wlsom1_ek_sd-poky-linux-gnueabi/linux-at91/5.4+gitAUTOINC+3dba8c9991-r0/recipe-sysroot-native/usr/lib                         -Wl,-rpath-link,/home/fakhruddin/workspace/Freshair/my_dir/poky/build/tmp/work/sama5d27_wlsom1_ek_sd-poky-linux-gnueabi/linux-at91/5.4+gitAUTOINC+3dba8c9991-r0/recipe-sysroot-native/lib                         -Wl,-rpath,/home/fakhruddin/workspace/Freshair/my_dir/poky/build/tmp/work/sama5d27_wlsom1_ek_sd-poky-linux-gnueabi/linux-at91/5.4+gitAUTOINC+3dba8c9991-r0/recipe-sysroot-native/usr/lib                         -Wl,-rpath,/home/fakhruddin/workspace/Freshair/my_dir/poky/build/tmp/work/sama5d27_wlsom1_ek_sd-poky-linux-gnueabi/linux-at91/5.4+gitAUTOINC+3dba8c9991-r0/recipe-sysroot-native/lib                         -Wl,-O1 -Wl,--allow-shlib-undefined -Wl,--dynamic-linker=/home/fakhruddin/workspace/Freshair/my_dir/poky/build/tmp/sysroots-uninative/x86_64-linux/lib/ld-linux-x86-64.so.2 HOSTCPP=gcc  -E HOSTCXX=g++  -isystem/home/fakhruddin/workspace/Freshair/my_dir/poky/build/tmp/work/sama5d27_wlsom1_ek_sd-poky-linux-gnueabi/linux-at91/5.4+gitAUTOINC+3dba8c9991-r0/recipe-sysroot-native/usr/include -O2 -pipe -L/home/fakhruddin/workspace/Freshair/my_dir/poky/build/tmp/work/sama5d27_wlsom1_ek_sd-poky-linux-gnueabi/linux-at91/5.4+gitAUTOINC+3dba8c9991-r0/recipe-sysroot-native/usr/lib                         -L/home/fakhruddin/workspace/Freshair/my_dir/poky/build/tmp/work/sama5d27_wlsom1_ek_sd-poky-linux-gnueabi/linux-at91/5.4+gitAUTOINC+3dba8c9991-r0/recipe-sysroot-native/lib                         -Wl,--enable-new-dtags                         -Wl,-rpath-link,/home/fakhruddin/workspace/Freshair/my_dir/poky/build/tmp/work/sama5d27_wlsom1_ek_sd-poky-linux-gnueabi/linux-at91/5.4+gitAUTOINC+3dba8c9991-r0/recipe-sysroot-native/usr/lib                         -Wl,-rpath-link,/home/fakhruddin/workspace/Freshair/my_dir/poky/build/tmp/work/sama5d27_wlsom1_ek_sd-poky-linux-gnueabi/linux-at91/5.4+gitAUTOINC+3dba8c9991-r0/recipe-sysroot-native/lib                         -Wl,-rpath,/home/fakhruddin/workspace/Freshair/my_dir/poky/build/tmp/work/sama5d27_wlsom1_ek_sd-poky-linux-gnueabi/linux-at91/5.4+gitAUTOINC+3dba8c9991-r0/recipe-sysroot-native/usr/lib                         -Wl,-rpath,/home/fakhruddin/workspace/Freshair/my_dir/poky/build/tmp/work/sama5d27_wlsom1_ek_sd-poky-linux-gnueabi/linux-at91/5.4+gitAUTOINC+3dba8c9991-r0/recipe-sysroot-native/lib                         -Wl,-O1 -Wl,--allow-shlib-undefined -Wl,--dynamic-linker=/home/fakhruddin/workspace/Freshair/my_dir/poky/build/tmp/sysroots-uninative/x86_64-linux/lib/ld-linux-x86-64.so.2 zImage CC=arm-poky-linux-gnueabi-gcc  -mno-thumb-interwork -marm -fuse-ld=bfd -fmacro-prefix-map=/home/fakhruddin/workspace/Freshair/my_dir/poky/build/tmp/work/sama5d27_wlsom1_ek_sd-poky-linux-gnueabi/linux-at91/5.4+gitAUTOINC+3dba8c9991-r0=/usr/src/debug/linux-at91/5.4+gitAUTOINC+3dba8c9991-r0                      -fdebug-prefix-map=/home/fakhruddin/workspace/Freshair/my_dir/poky/build/tmp/work/sama5d27_wlsom1_ek_sd-poky-linux-gnueabi/linux-at91/5.4+gitAUTOINC+3dba8c9991-r0=/usr/src/debug/linux-at91/5.4+gitAUTOINC+3dba8c9991-r0                      -fdebug-prefix-map=/home/fakhruddin/workspace/Freshair/my_dir/poky/build/tmp/work/sama5d27_wlsom1_ek_sd-poky-linux-gnueabi/linux-at91/5.4+gitAUTOINC+3dba8c9991-r0/recipe-sysroot=                      -fdebug-prefix-map=/home/fakhruddin/workspace/Freshair/my_dir/poky/build/tmp/work/sama5d27_wlsom1_ek_sd-poky-linux-gnueabi/linux-at91/5.4+gitAUTOINC+3dba8c9991-r0/recipe-sysroot-native=  -fdebug-prefix-map=/home/fakhruddin/workspace/Freshair/my_dir/poky/build/tmp/work-shared/sama5d27-wlsom1-ek-sd/kernel-source=/usr/src/kernel   LD=arm-poky-linux-gnueabi-ld.bfd
|   GEN     Makefile
|   CALL    /home/fakhruddin/workspace/Freshair/my_dir/poky/build/tmp/work-shared/sama5d27-wlsom1-ek-sd/kernel-source/scripts/atomic/check-atomics.sh
|   CALL    /home/fakhruddin/workspace/Freshair/my_dir/poky/build/tmp/work-shared/sama5d27-wlsom1-ek-sd/kernel-source/scripts/checksyscalls.sh
|   CHK     include/generated/compile.h
|   Kernel: arch/arm/boot/Image is ready
|   Kernel: arch/arm/boot/zImage is ready
| NOTE: make -j 12 HOSTCC=gcc  -isystem/home/fakhruddin/workspace/Freshair/my_dir/poky/build/tmp/work/sama5d27_wlsom1_ek_sd-poky-linux-gnueabi/linux-at91/5.4+gitAUTOINC+3dba8c9991-r0/recipe-sysroot-native/usr/include -O2 -pipe -L/home/fakhruddin/workspace/Freshair/my_dir/poky/build/tmp/work/sama5d27_wlsom1_ek_sd-poky-linux-gnueabi/linux-at91/5.4+gitAUTOINC+3dba8c9991-r0/recipe-sysroot-native/usr/lib                         -L/home/fakhruddin/workspace/Freshair/my_dir/poky/build/tmp/work/sama5d27_wlsom1_ek_sd-poky-linux-gnueabi/linux-at91/5.4+gitAUTOINC+3dba8c9991-r0/recipe-sysroot-native/lib                         -Wl,--enable-new-dtags                         -Wl,-rpath-link,/home/fakhruddin/workspace/Freshair/my_dir/poky/build/tmp/work/sama5d27_wlsom1_ek_sd-poky-linux-gnueabi/linux-at91/5.4+gitAUTOINC+3dba8c9991-r0/recipe-sysroot-native/usr/lib                         -Wl,-rpath-link,/home/fakhruddin/workspace/Freshair/my_dir/poky/build/tmp/work/sama5d27_wlsom1_ek_sd-poky-linux-gnueabi/linux-at91/5.4+gitAUTOINC+3dba8c9991-r0/recipe-sysroot-native/lib                         -Wl,-rpath,/home/fakhruddin/workspace/Freshair/my_dir/poky/build/tmp/work/sama5d27_wlsom1_ek_sd-poky-linux-gnueabi/linux-at91/5.4+gitAUTOINC+3dba8c9991-r0/recipe-sysroot-native/usr/lib                         -Wl,-rpath,/home/fakhruddin/workspace/Freshair/my_dir/poky/build/tmp/work/sama5d27_wlsom1_ek_sd-poky-linux-gnueabi/linux-at91/5.4+gitAUTOINC+3dba8c9991-r0/recipe-sysroot-native/lib                         -Wl,-O1 -Wl,--allow-shlib-undefined -Wl,--dynamic-linker=/home/fakhruddin/workspace/Freshair/my_dir/poky/build/tmp/sysroots-uninative/x86_64-linux/lib/ld-linux-x86-64.so.2 HOSTCPP=gcc  -E HOSTCXX=g++  -isystem/home/fakhruddin/workspace/Freshair/my_dir/poky/build/tmp/work/sama5d27_wlsom1_ek_sd-poky-linux-gnueabi/linux-at91/5.4+gitAUTOINC+3dba8c9991-r0/recipe-sysroot-native/usr/include -O2 -pipe -L/home/fakhruddin/workspace/Freshair/my_dir/poky/build/tmp/work/sama5d27_wlsom1_ek_sd-poky-linux-gnueabi/linux-at91/5.4+gitAUTOINC+3dba8c9991-r0/recipe-sysroot-native/usr/lib                         -L/home/fakhruddin/workspace/Freshair/my_dir/poky/build/tmp/work/sama5d27_wlsom1_ek_sd-poky-linux-gnueabi/linux-at91/5.4+gitAUTOINC+3dba8c9991-r0/recipe-sysroot-native/lib                         -Wl,--enable-new-dtags                         -Wl,-rpath-link,/home/fakhruddin/workspace/Freshair/my_dir/poky/build/tmp/work/sama5d27_wlsom1_ek_sd-poky-linux-gnueabi/linux-at91/5.4+gitAUTOINC+3dba8c9991-r0/recipe-sysroot-native/usr/lib                         -Wl,-rpath-link,/home/fakhruddin/workspace/Freshair/my_dir/poky/build/tmp/work/sama5d27_wlsom1_ek_sd-poky-linux-gnueabi/linux-at91/5.4+gitAUTOINC+3dba8c9991-r0/recipe-sysroot-native/lib                         -Wl,-rpath,/home/fakhruddin/workspace/Freshair/my_dir/poky/build/tmp/work/sama5d27_wlsom1_ek_sd-poky-linux-gnueabi/linux-at91/5.4+gitAUTOINC+3dba8c9991-r0/recipe-sysroot-native/usr/lib                         -Wl,-rpath,/home/fakhruddin/workspace/Freshair/my_dir/poky/build/tmp/work/sama5d27_wlsom1_ek_sd-poky-linux-gnueabi/linux-at91/5.4+gitAUTOINC+3dba8c9991-r0/recipe-sysroot-native/lib                         -Wl,-O1 -Wl,--allow-shlib-undefined -Wl,--dynamic-linker=/home/fakhruddin/workspace/Freshair/my_dir/poky/build/tmp/sysroots-uninative/x86_64-linux/lib/ld-linux-x86-64.so.2 at91-sama5d27_wlsom1_ek.dtb CC=arm-poky-linux-gnueabi-gcc  -mno-thumb-interwork -marm -fuse-ld=bfd -fmacro-prefix-map=/home/fakhruddin/workspace/Freshair/my_dir/poky/build/tmp/work/sama5d27_wlsom1_ek_sd-poky-linux-gnueabi/linux-at91/5.4+gitAUTOINC+3dba8c9991-r0=/usr/src/debug/linux-at91/5.4+gitAUTOINC+3dba8c9991-r0                      -fdebug-prefix-map=/home/fakhruddin/workspace/Freshair/my_dir/poky/build/tmp/work/sama5d27_wlsom1_ek_sd-poky-linux-gnueabi/linux-at91/5.4+gitAUTOINC+3dba8c9991-r0=/usr/src/debug/linux-at91/5.4+gitAUTOINC+3dba8c9991-r0                      -fdebug-prefix-map=/home/fakhruddin/workspace/Freshair/my_dir/poky/build/tmp/work/sama5d27_wlsom1_ek_sd-poky-linux-gnueabi/linux-at91/5.4+gitAUTOINC+3dba8c9991-r0/recipe-sysroot=                      -fdebug-prefix-map=/home/fakhruddin/workspace/Freshair/my_dir/poky/build/tmp/work/sama5d27_wlsom1_ek_sd-poky-linux-gnueabi/linux-at91/5.4+gitAUTOINC+3dba8c9991-r0/recipe-sysroot-native=  -fdebug-prefix-map=/home/fakhruddin/workspace/Freshair/my_dir/poky/build/tmp/work-shared/sama5d27-wlsom1-ek-sd/kernel-source=/usr/src/kernel   LD=arm-poky-linux-gnueabi-ld.bfd
| NOTE: make -j 12 HOSTCC=gcc  -isystem/home/fakhruddin/workspace/Freshair/my_dir/poky/build/tmp/work/sama5d27_wlsom1_ek_sd-poky-linux-gnueabi/linux-at91/5.4+gitAUTOINC+3dba8c9991-r0/recipe-sysroot-native/usr/include -O2 -pipe -L/home/fakhruddin/workspace/Freshair/my_dir/poky/build/tmp/work/sama5d27_wlsom1_ek_sd-poky-linux-gnueabi/linux-at91/5.4+gitAUTOINC+3dba8c9991-r0/recipe-sysroot-native/usr/lib                         -L/home/fakhruddin/workspace/Freshair/my_dir/poky/build/tmp/work/sama5d27_wlsom1_ek_sd-poky-linux-gnueabi/linux-at91/5.4+gitAUTOINC+3dba8c9991-r0/recipe-sysroot-native/lib                         -Wl,--enable-new-dtags                         -Wl,-rpath-link,/home/fakhruddin/workspace/Freshair/my_dir/poky/build/tmp/work/sama5d27_wlsom1_ek_sd-poky-linux-gnueabi/linux-at91/5.4+gitAUTOINC+3dba8c9991-r0/recipe-sysroot-native/usr/lib                         -Wl,-rpath-link,/home/fakhruddin/workspace/Freshair/my_dir/poky/build/tmp/work/sama5d27_wlsom1_ek_sd-poky-linux-gnueabi/linux-at91/5.4+gitAUTOINC+3dba8c9991-r0/recipe-sysroot-native/lib                         -Wl,-rpath,/home/fakhruddin/workspace/Freshair/my_dir/poky/build/tmp/work/sama5d27_wlsom1_ek_sd-poky-linux-gnueabi/linux-at91/5.4+gitAUTOINC+3dba8c9991-r0/recipe-sysroot-native/usr/lib                         -Wl,-rpath,/home/fakhruddin/workspace/Freshair/my_dir/poky/build/tmp/work/sama5d27_wlsom1_ek_sd-poky-linux-gnueabi/linux-at91/5.4+gitAUTOINC+3dba8c9991-r0/recipe-sysroot-native/lib                         -Wl,-O1 -Wl,--allow-shlib-undefined -Wl,--dynamic-linker=/home/fakhruddin/workspace/Freshair/my_dir/poky/build/tmp/sysroots-uninative/x86_64-linux/lib/ld-linux-x86-64.so.2 HOSTCPP=gcc  -E HOSTCXX=g++  -isystem/home/fakhruddin/workspace/Freshair/my_dir/poky/build/tmp/work/sama5d27_wlsom1_ek_sd-poky-linux-gnueabi/linux-at91/5.4+gitAUTOINC+3dba8c9991-r0/recipe-sysroot-native/usr/include -O2 -pipe -L/home/fakhruddin/workspace/Freshair/my_dir/poky/build/tmp/work/sama5d27_wlsom1_ek_sd-poky-linux-gnueabi/linux-at91/5.4+gitAUTOINC+3dba8c9991-r0/recipe-sysroot-native/usr/lib                         -L/home/fakhruddin/workspace/Freshair/my_dir/poky/build/tmp/work/sama5d27_wlsom1_ek_sd-poky-linux-gnueabi/linux-at91/5.4+gitAUTOINC+3dba8c9991-r0/recipe-sysroot-native/lib                         -Wl,--enable-new-dtags                         -Wl,-rpath-link,/home/fakhruddin/workspace/Freshair/my_dir/poky/build/tmp/work/sama5d27_wlsom1_ek_sd-poky-linux-gnueabi/linux-at91/5.4+gitAUTOINC+3dba8c9991-r0/recipe-sysroot-native/usr/lib                         -Wl,-rpath-link,/home/fakhruddin/workspace/Freshair/my_dir/poky/build/tmp/work/sama5d27_wlsom1_ek_sd-poky-linux-gnueabi/linux-at91/5.4+gitAUTOINC+3dba8c9991-r0/recipe-sysroot-native/lib                         -Wl,-rpath,/home/fakhruddin/workspace/Freshair/my_dir/poky/build/tmp/work/sama5d27_wlsom1_ek_sd-poky-linux-gnueabi/linux-at91/5.4+gitAUTOINC+3dba8c9991-r0/recipe-sysroot-native/usr/lib                         -Wl,-rpath,/home/fakhruddin/workspace/Freshair/my_dir/poky/build/tmp/work/sama5d27_wlsom1_ek_sd-poky-linux-gnueabi/linux-at91/5.4+gitAUTOINC+3dba8c9991-r0/recipe-sysroot-native/lib                         -Wl,-O1 -Wl,--allow-shlib-undefined -Wl,--dynamic-linker=/home/fakhruddin/workspace/Freshair/my_dir/poky/build/tmp/sysroots-uninative/x86_64-linux/lib/ld-linux-x86-64.so.2 new_name.dtb CC=arm-poky-linux-gnueabi-gcc  -mno-thumb-interwork -marm -fuse-ld=bfd -fmacro-prefix-map=/home/fakhruddin/workspace/Freshair/my_dir/poky/build/tmp/work/sama5d27_wlsom1_ek_sd-poky-linux-gnueabi/linux-at91/5.4+gitAUTOINC+3dba8c9991-r0=/usr/src/debug/linux-at91/5.4+gitAUTOINC+3dba8c9991-r0                      -fdebug-prefix-map=/home/fakhruddin/workspace/Freshair/my_dir/poky/build/tmp/work/sama5d27_wlsom1_ek_sd-poky-linux-gnueabi/linux-at91/5.4+gitAUTOINC+3dba8c9991-r0=/usr/src/debug/linux-at91/5.4+gitAUTOINC+3dba8c9991-r0                      -fdebug-prefix-map=/home/fakhruddin/workspace/Freshair/my_dir/poky/build/tmp/work/sama5d27_wlsom1_ek_sd-poky-linux-gnueabi/linux-at91/5.4+gitAUTOINC+3dba8c9991-r0/recipe-sysroot=                      -fdebug-prefix-map=/home/fakhruddin/workspace/Freshair/my_dir/poky/build/tmp/work/sama5d27_wlsom1_ek_sd-poky-linux-gnueabi/linux-at91/5.4+gitAUTOINC+3dba8c9991-r0/recipe-sysroot-native=  -fdebug-prefix-map=/home/fakhruddin/workspace/Freshair/my_dir/poky/build/tmp/work-shared/sama5d27-wlsom1-ek-sd/kernel-source=/usr/src/kernel   LD=arm-poky-linux-gnueabi-ld.bfd
| make[2]: *** No rule to make target 'arch/arm/boot/dts/new_name.dtb'.  Stop.
| make[1]: *** [/home/fakhruddin/workspace/Freshair/my_dir/poky/build/tmp/work-shared/sama5d27-wlsom1-ek-sd/kernel-source/Makefile:1265: new_name.dtb] Error 2
| make: *** [/home/fakhruddin/workspace/Freshair/my_dir/poky/build/tmp/work-shared/sama5d27-wlsom1-ek-sd/kernel-source/Makefile:179: sub-make] Error 2
| ERROR: oe_runmake failed
| WARNING: exit code 1 from a shell command.
| ERROR: Execution of '/home/fakhruddin/workspace/Freshair/my_dir/poky/build/tmp/work/sama5d27_wlsom1_ek_sd-poky-linux-gnueabi/linux-at91/5.4+gitAUTOINC+3dba8c9991-r0/temp/run.do_compile.57871' failed with exit code 1:
|   GEN     Makefile
|   CALL    /home/fakhruddin/workspace/Freshair/my_dir/poky/build/tmp/work-shared/sama5d27-wlsom1-ek-sd/kernel-source/scripts/atomic/check-atomics.sh
|   CALL    /home/fakhruddin/workspace/Freshair/my_dir/poky/build/tmp/work-shared/sama5d27-wlsom1-ek-sd/kernel-source/scripts/checksyscalls.sh
|   CHK     include/generated/compile.h
|   Kernel: arch/arm/boot/Image is ready
|   Kernel: arch/arm/boot/zImage is ready
| make[2]: *** No rule to make target 'arch/arm/boot/dts/new_name.dtb'.  Stop.
| make[1]: *** [/home/fakhruddin/workspace/Freshair/my_dir/poky/build/tmp/work-shared/sama5d27-wlsom1-ek-sd/kernel-source/Makefile:1265: new_name.dtb] Error 2
| make: *** [/home/fakhruddin/workspace/Freshair/my_dir/poky/build/tmp/work-shared/sama5d27-wlsom1-ek-sd/kernel-source/Makefile:179: sub-make] Error 2
| WARNING: exit code 1 from a shell command.
| 
ERROR: Task (/home/fakhruddin/workspace/Freshair/my_dir/poky/../meta-atmel/recipes-kernel/linux/linux-at91_5.4.81.bb:do_compile) failed with exit code '1'
NOTE: Tasks Summary: Attempted 6463 tasks of which 6457 didn't need to be rerun and 1 failed.

Summary: 1 task failed:
  /home/fakhruddin/workspace/Freshair/my_dir/poky/../meta-atmel/recipes-kernel/linux/linux-at91_5.4.81.bb:do_compile
Summary: There were 2 ERROR messages shown, returning a non-zero exit code.

如果我遗漏了任何所需信息,请帮助并告知我。

谢谢您和问候,

索希尔

yocto openembedded device-tree
4个回答
7
投票

Linux 内核设备树位于:

/tmp/work/sama5d27_wlsom1_ek_sd-poky-linux-gnueabi/linux-at91/5.4+gitAUTOINC+3dba8c9991-r0/git/arch/arm/boot/dts

请注意,源代码位于

git
中,最终版本位于
build
中。

您必须确保

new_name.dtb
存在于主 Makefile 中:

/tmp/work/sama5d27_wlsom1_ek_sd-poky-linux-gnueabi/linux-at91/5.4+gitAUTOINC+3dba8c9991-r0/git/arch/arm/boot/dts/Makfile

+dtb-$(CONFIG_SOC_AT91SAM9) += new_name.dtb

现在必须将新的设备树添加到

KERNEL_DEVICETREE
变量中,并告诉 Yocto 要构建哪些内核设备树并将其发送到启动分区,以便 u-boot 在启动主板时将其中之一加载到 RAM 中:

KERNEL_DEVICETREE += "new_name.dtb"

现在,在您了解如何将设备树放置在内核中之后,您可以使其自动执行,为您的

bbappend
内核主配方创建一个
linux-at91
配方,并在其中添加自定义设备树。

meta-local/
  recipes-kernel/
     linux/
       files/
          new_custom.dts
       linux-at91_%.bbappend

现在,您需要在编译内核(do_compile)之前复制新的dts文件,最好的时刻是在do_configure之后:

FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
SRC_URI_append = " file://new_custom.dts"
do_configure_append(){
 cp ${WORKDIR}/new_custom.dts ${S}/arch/arm/boot/dts
 echo "dtb-$(CONFIG_SOC_AT91SAM9) += new_dts.dtb" >> ${S}/arch/arm/boot/dts/Makefile
}

现在,您的新设备树将被编译,任何编译错误都可能是由于语法错误造成的。

知道设备树已编译并添加到

KERNEL_DEVICETREE
后,这意味着它与所有其他设备树一起存在于启动分区中,也存在于
KERNEL_DEVICETREE
变量中,但 u-boot 仅加载其中之一加载 Linux 内核之前的 RAM,并且该设备树在您的 u-boot 目标
defconfig
文件中设置:

/tmp/work/sama5d27_wlsom1_ek_sd-poky-linux-gnueabi/u-boot-.../<version>/git/configs/your_machine_defconfig

您可以在位于主板 BSP 层的机器配置文件中的

your_machine_defconfig
变量中找到
UBOOT_CONFIG

meta-<board>/conf/machine/<board>.conf

找到defconfig后你可以找到一个变量

DEFAULT_FDT_FILE

首先,不要更改它,只需构建您的映像,然后在 uboot 阶段暂停,然后

printenv
查看
fdt_file
变量并将其设置为您的
new_name.dtb
文件,然后
saveenv
将其保存在每次启动时。

如果没问题,您现在可以修补 uboot defconfig 文件以设置新的设备树文件。

Yocto 提示:

内核配方中的

${WORKDIR}
指向:

/tmp/work/sama5d27_wlsom1_ek_sd-poky-linux-gnueabi/linux-at91/5.4+gitAUTOINC+3dba8c9991-r0/

${S}
指向
${WORKDIR}

下的git目录
/tmp/work/sama5d27_wlsom1_ek_sd-poky-linux-gnueabi/linux-at91/5.4+gitAUTOINC+3dba8c9991-r0/git

这就是我从

${WORKDIR}

复制新设备树的原因

4
投票

我建议使用

devtool modify linux-at91
来修改 Linux 内核源代码树。这将在您的
${TOPDIR}/workspace/sources/linux-at91
中创建一个 linux-at91 文件夹。如果您不知道 ${TOPDIR},请尝试使用
bitbake -e <recipe-name> | grep "TOPDIR"
bitbake -e
将打印该配方的整个元数据,在这里您可以使用 grep 查找不同变量的分配。 (就像你的 KERNEL_DEVICETREE)

${TOPDIR}/workspace/sources/linux-at91

这将是您的 linux-at91 配方的源代码树。

将 dts 文件复制到

${TOPDIR}/workspace/sources/linux-at91/arch/arm/boot/dts

修改 Makefile 以包含您的 dts,如 @BelHadjSalem TALEL 所指出的(谢谢!)。

提交这些更改并生成补丁。

在您自己的图层中,在

recipes-kernel/linux-at91/linux-at91
下放置此补丁文件。添加
recipes-kernel/linux-at91/linux-at91.bbappend
以包含此补丁,如下所示:

FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
SRC_URI += "file://0001-add-dts-file.patch"

现在要构建您的自定义机器,请添加

conf/machine/custom-machine.conf
并为您的自定义 KERNEL_DEVICETREE 添加条目,如此处

所示
# This will inherit your base machine
require conf/machine/sama5d27-wlsom1-ek-sd.conf

KERNEL_DEVICETREE = "your-dts-file.dtb"

总的来说,您的图层将包含以下文件:

- conf/layer.conf
- conf/machine/custom-machine.conf (Contains the above settings)
- recipes-kernel/linux-at91/linux-at91/0001-add-dts-file.patch
- recipes-kernel/linux-at91/linux-at91/linux-at91.bbappend

1
投票

只是为了了解 @BelHadjSalem 的出色回应:我们也可以使用 subdir,而不是通过“do_configure_append”手动复制 dts 文件。 所以而不是

do_configure_append() {
    cp ${WORKDIR}/new_custom.dts ${S}/arch/arm/boot/dts
}

我们只需要:

SRC_URI_append = " file://new_custom.dts;subdir=git/arch/arm/boot/dts"

0
投票

好的,我将 DTS 添加到内核,我看到它在我的图像中。但是当我尝试修改内核配方(devtool 修改 linux-imx)时,custom_dts 不在临时 devtool workdir 中。

make[1]: Leaving directory '/home/yoctodevelop/Yocto/build/tmp/work/foo-poky-linux/linux-imx/5.15.52+gitAUTOINC+a665f5d8eb-r0/devtooltmp-5cy829n6/workdir/build'
| make: Leaving directory '/home/yoctodevelop/Yocto/build/tmp/work/foo-poky-linux/linux-imx/5.15.52+gitAUTOINC+a665f5d8eb-r0/devtooltmp-5cy829n6/workdir/git'
| cp: cannot stat '/home/yoctodevelop/Yocto/build/tmp/work/foo-poky-linux/linux-imx/5.15.52+gitAUTOINC+a665f5d8eb-r0/devtooltmp-5cy829n6/workdir/custom.dts': No such file or directory

发生什么事了?

© www.soinside.com 2019 - 2024. All rights reserved.