我想交叉编译与Yocto,一个简单的C,Hello,为我的Colibri iMX7从Toradex。我的梅特-哈洛之树如下:
meta-hellow
├── conf
│ └── layer.conf
└── recipes-myhello
└── files
└── helloworld.c
└── README.TXT
└── myhello_0.0.bbhelloworld.c:
#include <stdio.h>
int main(int argc, char** argv)
{
printf("Hello World!\n");
return 0;
}myhello_0.0.bb是受这一个启发的:
DESCRIPTION = "Hello world program"
#To prevent the LICENSE field not set error
LICENSE = "CLOSED"
PR = "r0"
SRC_URI = "file://helloworld.c \
file://README.txt"
do_compile() {
${CC} ${CFLAGS} ${LDFLAGS} ${WORKDIR}/helloworld.c -o helloworld
}
do_install() {
install -m 0755 -d ${D}${bindir} ${D}${docdir}/helloworld
install -m 0644 ${S}/helloworld ${D}${bindir}
install -m 0644 ${WORKDIR}/README.txt ${D}${docdir}/helloworld
}我在我的bblayers.conf类似于so ${TOPDIR}/../layers/meta-hellow \中添加了我的层,并在local.conf类似于so IMAGE_INSTALL_append = "myhello"中添加了包。
但是,在用opkg install在我的板上安装它之后,我遇到的问题如下:
root@colibri-imx7:~# myhello
-sh: /usr/bin/myhello: Permission denied为什么有一个Permission denied,因为我是根?
谢谢你的帮助!
发布于 2017-04-12 12:24:33
install -m 0644 ${S}/helloworld ${D}${bindir}您告诉安装设置任何人不执行权限:尝试"0755“代替。
https://stackoverflow.com/questions/43365674
复制相似问题