0

我尝试使用以下命令在 yocto 中安装 CANopen。但是 CANOpen 没有安装。

bitbake canopensocket_git

在我添加的 local.conf 文件中

CORE_IMAGE_EXTRA_INSTALL += " canopensocket_git "

如何安装 canopen 包?

还考虑任何输入。

4

1 回答 1

0

First of all, that's a syntax error canopensocket_git.

The recipe name ${PN} is canopensocket and every thing after the_ is the version number ${PV}.

So, you need to only specify the recipe name. Or if you have different versions you can specify one by:

PREFERRED_VERSION_canopensocket = "version_here"

That being said, I found a recipe for canopensocket in here.

But if fails and it is not updated with latest github commit.

I did some modifications on it, here is my recipe:

SUMMARY = "Linux CANOpen tools"
DESCRIPTION = "Linux CANOpen Protocol Stack Tools"
LICENSE = "GPLv2"
LIC_FILES_CHKSUM = "file://gpl-2.0.txt;md5=b234ee4d69f5fce4486a80fdaf4a4263"

SRC_URI = "git://github.com/CANopenNode/CANopenSocket.git"
SRCREV = "ec9735165502e08b5d2e84d641833709b6faeb96"

S = "${WORKDIR}/git"

do_compile_prepend() {
    cd ${S}
    git submodule init
    git submodule update
}

do_compile() {
    cd ${S}/cocomm
    make
    cd ${S}/canopencgi
    make
}

do_install(){
    install -d ${D}${bindir}
    install -m 0755 ${S}/cocomm/cocomm ${D}${bindir}
    install -m 0755 ${S}/canopencgi/canopen.cgi ${D}${bindir}
}

FILES_${PN} += "${bindir}/*"

I modified do_compile, do_install and added the packaging of FILES.

And I set SRCREV to the latest v4 tag commit instead of AUTOREV.

I do not know what this recipe does, but I compiled it and the build was okay for me on a zeus build.

The build produced two binaries: cocomm and canopen.cgi .

No if you want to install it to your image, add this to you cutom image recipe:

IMAGE_INSTALL_append = " canopensocket"
于 2021-08-06T09:56:33.057 回答