Search code examples
gitsshraspberry-piyoctoopenssh

YOCTO: "error: cannot run ssh: No such file or directory"


I'm making a recipe in yocto raspberry. I want to get some files from a server with git. This is my recipe:

DESCRIPTION = "test"
SECTION = "abc"
LICENSE = "CLOSED"
PR = "r0"

SRC_URI = 
"git://gerrit.g1.abc.corp:29418/cardlog;protocol=ssh;rev=master"
"
PACKAGE_ARCH = "${MACHINE_ARCH}"
S = "${WORKDIR}/git"
inherit pkgconfig cmake

do_install() {
install -d ${D}${base_bindir}
install -m 0755 cardlog ${D}${base_bindir}
}

I'm getting this error message when I run bitbake:

ERROR: abc-cardlog-1.0-r0 do_fetch: 
Fetcher failure: 
Fetch command export DBUS_SESSION_BUS_ADDRESS="unix:abstract=/tmp/dbus-j365B7zbUr,guid=20e178f2b82d0bb8e57068dc59e83e63"; 
export SSH_AUTH_SOCK="/run/user/1000/keyring/ssh"; export no_proxy="localhost,127.0.0.0/8,::1"; 
export NO_PROXY="localhost,127.0.0.0/8,::1"; 
export PATH="/home/abc-int/Desktop/yocto_r/build-rpi/tmp/sysroots-uninative/x86_64-linux/usr/bin:
/home/abc-int/Desktop/yocto_r/poky/scripts:
/home/abc-int/Desktop/yocto_r/build-rpi/tmp/work/raspberrypi-poky-linux-gnueabi/abc-cardlog/1.0-r0/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi:
/home/abc-int/Desktop/yocto_r/build-rpi/tmp/work/raspberrypi-poky-linux-gnueabi/abc-cardlog/1.0-r0/recipe-sysroot/usr/bin/crossscripts:
/home/abc-int/Desktop/yocto_r/build-rpi/tmp/work/raspberrypi-poky-linux-gnueabi/abc-cardlog/1.0-r0/recipe-sysroot-native/usr/sbin:
/home/abc-int/Desktop/yocto_r/build-rpi/tmp/work/raspberrypi-poky-linux-gnueabi/abc-cardlog/1.0-r0/recipe-sysroot-native/usr/bin:
/home/abc-int/Desktop/yocto_r/build-rpi/tmp/work/raspberrypi-poky-linux-gnueabi/abc-cardlog/1.0-r0/recipe-sysroot-native/sbin:
/home/abc-int/Desktop/yocto_r/build-rpi/tmp/work/raspberrypi-poky-linux-gnueabi/abc-cardlog/1.0-r0/recipe-sysroot-native/bin:
/home/abc-int/Desktop/yocto_r/poky/bitbake/bin:/home/abc-int/Desktop/yocto_r/build-rpi/tmp/hosttools"; 
export HOME="/home/abc-int"; git -c core.fsyncobjectfiles=0 ls-remote ssh://gerrit.g1.abc.corp:29418/cardlog  failed with exit code 128, output:

error: cannot run ssh: No such file or directory
fatal: unable to fork

ERROR: abc-cardlog-1.0-r0 do_fetch: Function failed: base_do_fetch
ERROR: Logfile of failure stored in: /home/abc-int/Desktop/yocto_r/build-rpi/tmp/work/raspberrypi-poky-linux-gnueabi/abc-cardlog/1.0-r0/temp/log.do_fetch.16941
ERROR: Task (/home/abc-int/Desktop/yocto_r/build-rpi/../poky/meta-abc/recipes-abc-cardlog/abc-cardlog/abc-cardlog.bb:do_fetch) failed with exit code '1'

I'm already running with success this recipe on another yocto project. I have no problem there, my files are downloaded this success from git.

I've moved my work on a rasbberrypi board. So I created a new yocto project with a raspberry layer. I've added my own layer. I tried just to copy some files, with this recipe and everything is working fine.

Any suggestions, please?


Solution

  • I assume you're using rocko. What will likely solve your problem is merging the latest upstream version of the rocko branch into your poky directory, for example by doing a git pull.

    I was dealing with the same problem today and the reason bitbake couldn't find ssh is that since rocko, the OpenEmbedded developers decided to sanitize the build environment by replacing PATH with a directory containing symlinks to "approved" native binaries. This list of approved binaries is determined by the HOSTTOOLS variable which is defined in meta/conf/bitbake.conf. Someone accidentally caused ssh to be removed from that list, which has since been fixed.