In Yocto, how to read a git repository via ssh on a nonstandard port
Asked Answered
T

1

8

I created a recipe containing these definitions:

SRC_URI = "git://git:<password>@<ip address>:<ssh_port>/home/git/tuxin-repo/project.git;protocol=ssh;branch=test"
SRCREV_default = "5a0b8545d39c97bd9f9628143ed174dabb71f641"

bitbake ends with errors

ERROR: Fetcher failure: Fetch command failed with exit code 128, output: Cloning into bare repository '/home/yocto/build/downloads/git2/..home.git.tuxin-repo.project.git'... Permission denied, please try again. Permission denied, please try again. Permission denied (publickey,password). fatal: Could not read from remote repository.

Please make sure you have the correct access rights and the repository exists.

ERROR: Function failed: Fetcher failure for URL: 'git://git:@:/home/git/tuxin-repo/project.git;protocol=ssh;branch='test''. Unable to fetch URL from any source. ERROR: Logfile of failure stored in: /home/yocto/build/tmp/work/cortexa8hf-vfp-neon-poky-linux-gnueabi/capsystem/1.0-r0/temp/log.do_fetch.7045 ERROR: Task 4 (/home/yocto/sources/poky/../meta-tuxin/recipes-support/project/project.bb, do_fetch) failed with exit code '1'

while in command line, and after typing the password, the project is loaded.

git clone --branch test ssh://git@<ip_address>:<ssh_port>/home/git/tuxin-repo/project.git

Can someone explain to me my mistake?

Theressa answered 22/2, 2019 at 9:24 Comment(1)
Did you try to add user,password and port in parameters after protocol=ssh?Legion
T
6

You have to specify the SRC_URI in this way:

SRC_URI = "git://git@<ip address>:<ssh_port>/home/git/tuxin-repo/project.git;protocol=ssh;branch=test"

Note the use of git@ before the IP address. You cannot specify the password in the SRC_URI as a security measure. For automatic authentication you will have to use other methods as .ssh/config

Tiller answered 16/8, 2021 at 8:20 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.