我想为phyBOARD Mira 板的CANBOAT 存储库创建一个 Yocto 层,该板将连接到船上的 NMEA2000。我想读取不同的 PGN 值并将其存储在数据库中。
配置
我有一个 Linux 虚拟机(Ubuntu 16.04 LTS)
Linux ubuntu 4.13.0-39-generic #44~16.04.1-Ubuntu SMP Thu Apr 5 16:43:10 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
我将所有图层都meta
放在一个名为sources
. $YOCTO_DIR
在sources
我创建了meta-canboat
具有以下结构的层:
├── conf
│ └── layer.conf
├── COPYING.MIT
├── README
└── recipes-canboat
└── canboat
└── canboat.bb
canboat.bb基于Makefile 的 Yocto-Mega-Manual
SUMMARY = "CANBOAT"
SECTION = "base"
LICENSE = "GPLv3"
#DEPENDS = "xsltproc"
LIC_FILES_CHKSUM = "file://GPL;md5=05507c6da2404b0e88fe5a152fd12540"
S = "${WORKDIR}/git"
SRC_URI = "git://github.com/canboat/canboat.git;branch=${SRCBRANCH}"
SRCBRANCH = "master"
SRCREV = "93b2ebfb334d7a9750b6947d3a4af9b091be2432"
do_compile() {// this is not necessary for Yocto
make
}
do_install() { // for Makefile Packages do_install is necessary
oe_runmake install DESTDIR=${D}
}
构建和错误
在build
我执行的目录中
bitbake canboat
并获取错误日志:
| DEBUG: Executing shell function do_compile
| mkdir -p rel/linux-x86_64
| for dir in actisense-serial analyzer n2kd nmea0183 ip group-function candump2analyzer socketcan-writer; do make -C $dir; done
| make[1]: Entering directory '/opt/PHYTEC_BSPs/yocto_fsl/build/tmp/work/cortexa9hf-neon-phytec-linux-gnueabi/canboat/1.0-r0/git/actisense-serial'
| arm-phytec-linux-gnueabi-gcc -march=armv7-a -mfpu=neon -mfloat-abi=hard -mcpu=cortex-a9 --sysroot=/opt/PHYTEC_BSPs/yocto_fsl/build/tmp/sysroots/phyboard-mira-imx6-3 -O2 -pipe -g -feliminate-unused-debug-types -fdebug-prefix-map=/opt/PHYTEC_BSPs/yocto_fsl/build/tmp/work/cortexa9hf-neon-phytec-linux-gnueabi/canboat/1.0-r0=/usr/src/debug/canboat/1.0-r0 -fdebug-prefix-map=/opt/PHYTEC_BSPs/yocto_fsl/build/tmp/sysroots/x86_64-linux= -fdebug-prefix-map=/opt/PHYTEC_BSPs/yocto_fsl/build/tmp/sysroots/phyboard-mira-imx6-3= -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed -o ../rel/linux-x86_64/actisense-serial -I../common actisense-serial.c ../common/common.c
| make[1]: Leaving directory '/opt/PHYTEC_BSPs/yocto_fsl/build/tmp/work/cortexa9hf-neon-phytec-linux-gnueabi/canboat/1.0-r0/git/actisense-serial'
| make[1]: Entering directory '/opt/PHYTEC_BSPs/yocto_fsl/build/tmp/work/cortexa9hf-neon-phytec-linux-gnueabi/canboat/1.0-r0/git/analyzer'
| arm-phytec-linux-gnueabi-gcc -march=armv7-a -mfpu=neon -mfloat-abi=hard -mcpu=cortex-a9 --sysroot=/opt/PHYTEC_BSPs/yocto_fsl/build/tmp/sysroots/phyboard-mira-imx6-3 -O2 -pipe -g -feliminate-unused-debug-types -fdebug-prefix-map=/opt/PHYTEC_BSPs/yocto_fsl/build/tmp/work/cortexa9hf-neon-phytec-linux-gnueabi/canboat/1.0-r0=/usr/src/debug/canboat/1.0-r0 -fdebug-prefix-map=/opt/PHYTEC_BSPs/yocto_fsl/build/tmp/sysroots/x86_64-linux= -fdebug-prefix-map=/opt/PHYTEC_BSPs/yocto_fsl/build/tmp/sysroots/phyboard-mira-imx6-3= -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed -o ../rel/linux-x86_64/analyzer -I../common pgn.c analyzer.c ../common/common.c
| make[1]: Leaving directory '/opt/PHYTEC_BSPs/yocto_fsl/build/tmp/work/cortexa9hf-neon-phytec-linux-gnueabi/canboat/1.0-r0/git/analyzer'
| make[1]: Entering directory '/opt/PHYTEC_BSPs/yocto_fsl/build/tmp/work/cortexa9hf-neon-phytec-linux-gnueabi/canboat/1.0-r0/git/n2kd'
| arm-phytec-linux-gnueabi-gcc -march=armv7-a -mfpu=neon -mfloat-abi=hard -mcpu=cortex-a9 --sysroot=/opt/PHYTEC_BSPs/yocto_fsl/build/tmp/sysroots/phyboard-mira-imx6-3 -O2 -pipe -g -feliminate-unused-debug-types -fdebug-prefix-map=/opt/PHYTEC_BSPs/yocto_fsl/build/tmp/work/cortexa9hf-neon-phytec-linux-gnueabi/canboat/1.0-r0=/usr/src/debug/canboat/1.0-r0 -fdebug-prefix-map=/opt/PHYTEC_BSPs/yocto_fsl/build/tmp/sysroots/x86_64-linux= -fdebug-prefix-map=/opt/PHYTEC_BSPs/yocto_fsl/build/tmp/sysroots/phyboard-mira-imx6-3= -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed -o ../rel/linux-x86_64/n2kd -I../common main.c gps_ais.c nmea0183.c ../common/common.c -lm
| cp n2kd_monitor ../rel/linux-x86_64/n2kd_monitor
| make[1]: Leaving directory '/opt/PHYTEC_BSPs/yocto_fsl/build/tmp/work/cortexa9hf-neon-phytec-linux-gnueabi/canboat/1.0-r0/git/n2kd'
| make[1]: Entering directory '/opt/PHYTEC_BSPs/yocto_fsl/build/tmp/work/cortexa9hf-neon-phytec-linux-gnueabi/canboat/1.0-r0/git/nmea0183'
| arm-phytec-linux-gnueabi-gcc -march=armv7-a -mfpu=neon -mfloat-abi=hard -mcpu=cortex-a9 --sysroot=/opt/PHYTEC_BSPs/yocto_fsl/build/tmp/sysroots/phyboard-mira-imx6-3 -O2 -pipe -g -feliminate-unused-debug-types -fdebug-prefix-map=/opt/PHYTEC_BSPs/yocto_fsl/build/tmp/work/cortexa9hf-neon-phytec-linux-gnueabi/canboat/1.0-r0=/usr/src/debug/canboat/1.0-r0 -fdebug-prefix-map=/opt/PHYTEC_BSPs/yocto_fsl/build/tmp/sysroots/x86_64-linux= -fdebug-prefix-map=/opt/PHYTEC_BSPs/yocto_fsl/build/tmp/sysroots/phyboard-mira-imx6-3= -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed -o ../rel/linux-x86_64/nmea0183-serial -O2 -pipe -g -feliminate-unused-debug-types -fdebug-prefix-map=/opt/PHYTEC_BSPs/yocto_fsl/build/tmp/work/cortexa9hf-neon-phytec-linux-gnueabi/canboat/1.0-r0=/usr/src/debug/canboat/1.0-r0 -fdebug-prefix-map=/opt/PHYTEC_BSPs/yocto_fsl/build/tmp/sysroots/x86_64-linux= -fdebug-prefix-map=/opt/PHYTEC_BSPs/yocto_fsl/build/tmp/sysroots/phyboard-mira-imx6-3= -I../common nmeareader.c ../common/common.c
| make[1]: Leaving directory '/opt/PHYTEC_BSPs/yocto_fsl/build/tmp/work/cortexa9hf-neon-phytec-linux-gnueabi/canboat/1.0-r0/git/nmea0183'
| make[1]: Entering directory '/opt/PHYTEC_BSPs/yocto_fsl/build/tmp/work/cortexa9hf-neon-phytec-linux-gnueabi/canboat/1.0-r0/git/ip'
| arm-phytec-linux-gnueabi-gcc -march=armv7-a -mfpu=neon -mfloat-abi=hard -mcpu=cortex-a9 --sysroot=/opt/PHYTEC_BSPs/yocto_fsl/build/tmp/sysroots/phyboard-mira-imx6-3 -O2 -pipe -g -feliminate-unused-debug-types -fdebug-prefix-map=/opt/PHYTEC_BSPs/yocto_fsl/build/tmp/work/cortexa9hf-neon-phytec-linux-gnueabi/canboat/1.0-r0=/usr/src/debug/canboat/1.0-r0 -fdebug-prefix-map=/opt/PHYTEC_BSPs/yocto_fsl/build/tmp/sysroots/x86_64-linux= -fdebug-prefix-map=/opt/PHYTEC_BSPs/yocto_fsl/build/tmp/sysroots/phyboard-mira-imx6-3= -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed -o ../rel/linux-x86_64/iptee -O2 -pipe -g -feliminate-unused-debug-types -fdebug-prefix-map=/opt/PHYTEC_BSPs/yocto_fsl/build/tmp/work/cortexa9hf-neon-phytec-linux-gnueabi/canboat/1.0-r0=/usr/src/debug/canboat/1.0-r0 -fdebug-prefix-map=/opt/PHYTEC_BSPs/yocto_fsl/build/tmp/sysroots/x86_64-linux= -fdebug-prefix-map=/opt/PHYTEC_BSPs/yocto_fsl/build/tmp/sysroots/phyboard-mira-imx6-3= -I../common iptee.c ../common/common.c
| make[1]: Leaving directory '/opt/PHYTEC_BSPs/yocto_fsl/build/tmp/work/cortexa9hf-neon-phytec-linux-gnueabi/canboat/1.0-r0/git/ip'
| make[1]: Entering directory '/opt/PHYTEC_BSPs/yocto_fsl/build/tmp/work/cortexa9hf-neon-phytec-linux-gnueabi/canboat/1.0-r0/git/group-function'
| arm-phytec-linux-gnueabi-gcc -march=armv7-a -mfpu=neon -mfloat-abi=hard -mcpu=cortex-a9 --sysroot=/opt/PHYTEC_BSPs/yocto_fsl/build/tmp/sysroots/phyboard-mira-imx6-3 -O2 -pipe -g -feliminate-unused-debug-types -fdebug-prefix-map=/opt/PHYTEC_BSPs/yocto_fsl/build/tmp/work/cortexa9hf-neon-phytec-linux-gnueabi/canboat/1.0-r0=/usr/src/debug/canboat/1.0-r0 -fdebug-prefix-map=/opt/PHYTEC_BSPs/yocto_fsl/build/tmp/sysroots/x86_64-linux= -fdebug-prefix-map=/opt/PHYTEC_BSPs/yocto_fsl/build/tmp/sysroots/phyboard-mira-imx6-3= -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed -o ../rel/linux-x86_64/command-group-function -I../common command.c ../common/common.c
| arm-phytec-linux-gnueabi-gcc -march=armv7-a -mfpu=neon -mfloat-abi=hard -mcpu=cortex-a9 --sysroot=/opt/PHYTEC_BSPs/yocto_fsl/build/tmp/sysroots/phyboard-mira-imx6-3 -O2 -pipe -g -feliminate-unused-debug-types -fdebug-prefix-map=/opt/PHYTEC_BSPs/yocto_fsl/build/tmp/work/cortexa9hf-neon-phytec-linux-gnueabi/canboat/1.0-r0=/usr/src/debug/canboat/1.0-r0 -fdebug-prefix-map=/opt/PHYTEC_BSPs/yocto_fsl/build/tmp/sysroots/x86_64-linux= -fdebug-prefix-map=/opt/PHYTEC_BSPs/yocto_fsl/build/tmp/sysroots/phyboard-mira-imx6-3= -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed -o ../rel/linux-x86_64/request-group-function -I../common request.c ../common/common.c
| make[1]: Leaving directory '/opt/PHYTEC_BSPs/yocto_fsl/build/tmp/work/cortexa9hf-neon-phytec-linux-gnueabi/canboat/1.0-r0/git/group-function'
| make[1]: Entering directory '/opt/PHYTEC_BSPs/yocto_fsl/build/tmp/work/cortexa9hf-neon-phytec-linux-gnueabi/canboat/1.0-r0/git/candump2analyzer'
| arm-phytec-linux-gnueabi-gcc -march=armv7-a -mfpu=neon -mfloat-abi=hard -mcpu=cortex-a9 --sysroot=/opt/PHYTEC_BSPs/yocto_fsl/build/tmp/sysroots/phyboard-mira-imx6-3 -O2 -pipe -g -feliminate-unused-debug-types -fdebug-prefix-map=/opt/PHYTEC_BSPs/yocto_fsl/build/tmp/work/cortexa9hf-neon-phytec-linux-gnueabi/canboat/1.0-r0=/usr/src/debug/canboat/1.0-r0 -fdebug-prefix-map=/opt/PHYTEC_BSPs/yocto_fsl/build/tmp/sysroots/x86_64-linux= -fdebug-prefix-map=/opt/PHYTEC_BSPs/yocto_fsl/build/tmp/sysroots/phyboard-mira-imx6-3= -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed -o ../rel/linux-x86_64/candump2analyzer -I../common candump2analyzer.c ../common/common.c -lm
| make[1]: Leaving directory '/opt/PHYTEC_BSPs/yocto_fsl/build/tmp/work/cortexa9hf-neon-phytec-linux-gnueabi/canboat/1.0-r0/git/candump2analyzer'
| make[1]: Entering directory '/opt/PHYTEC_BSPs/yocto_fsl/build/tmp/work/cortexa9hf-neon-phytec-linux-gnueabi/canboat/1.0-r0/git/socketcan-writer'
| arm-phytec-linux-gnueabi-gcc -march=armv7-a -mfpu=neon -mfloat-abi=hard -mcpu=cortex-a9 --sysroot=/opt/PHYTEC_BSPs/yocto_fsl/build/tmp/sysroots/phyboard-mira-imx6-3 -O2 -pipe -g -feliminate-unused-debug-types -fdebug-prefix-map=/opt/PHYTEC_BSPs/yocto_fsl/build/tmp/work/cortexa9hf-neon-phytec-linux-gnueabi/canboat/1.0-r0=/usr/src/debug/canboat/1.0-r0 -fdebug-prefix-map=/opt/PHYTEC_BSPs/yocto_fsl/build/tmp/sysroots/x86_64-linux= -fdebug-prefix-map=/opt/PHYTEC_BSPs/yocto_fsl/build/tmp/sysroots/phyboard-mira-imx6-3= -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed -o ../rel/linux-x86_64/socketcan-writer -I../analyzer -I../common socketcan-writer.c ../analyzer/pgn.c ../common/common.c
| make[1]: Leaving directory '/opt/PHYTEC_BSPs/yocto_fsl/build/tmp/work/cortexa9hf-neon-phytec-linux-gnueabi/canboat/1.0-r0/git/socketcan-writer'
| make -C analyzer json
| make[1]: Entering directory '/opt/PHYTEC_BSPs/yocto_fsl/build/tmp/work/cortexa9hf-neon-phytec-linux-gnueabi/canboat/1.0-r0/git/analyzer'
| ../rel/linux-x86_64/analyzer -explain-xml >pgns.xml && xsltproc pgns2json.xslt pgns.xml >pgns.json
| /bin/sh: ../rel/linux-x86_64/analyzer: 无法执行二进制文件: Exec 格式错误
| Makefile:33: recipe for target 'json' failed
| make[1]: *** [json] Error 126
| make[1]: Leaving directory '/opt/PHYTEC_BSPs/yocto_fsl/build/tmp/work/cortexa9hf-neon-phytec-linux-gnueabi/canboat/1.0-r0/git/analyzer'
| Makefile:29: recipe for target 'all' failed
| make: *** [all] Error 2
| WARNING: /opt/PHYTEC_BSPs/yocto_fsl/build/tmp/work/cortexa9hf-neon-phytec-linux-gnueabi/canboat/1.0-r0/temp/run.do_compile.47581:1 exit 2 from 'make'
| ERROR: Function failed: do_compile (log file is located at /opt/PHYTEC_BSPs/yocto_fsl/build/tmp/work/cortexa9hf-neon-phytec-linux-gnueabi/canboat/1.0-r0/temp/log.do_compile.47581)
-x86_64
我了解平台上的二进制文件可能不兼容gnueabi
。如何编译此存储库以克服这种不兼容性?