cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Explorer
Explorer
3,331 Views
Registered: ‎03-09-2017

unable to run cross compiled files sent using scp on petalinux running on zc706

Jump to solution

I compiled and generated an image file using following

 

export ARCH=arm
export PATH=/opt/pkg/peta2017.1/Xilinx/SDK/2017.1/gnu/arm/lin/arm-xilinx-linux-gnueabi/bin/
export CROSS_COMPILE = arm-xilinx-linux-gnueabi
Source /opt/pkg/peta2017.1/Xilinx/SDK/2017.1/settings64.sh
arm-xilinx-linux-gnueabi-gcc hello.c -o hello

and next i tried to send the image file to my board using scp commands as i have dropbear ssh and dropbear sftp on my zc706.

 

Firs it was tough to send using scp commands to my board with ip address 192.168.4.14 with an error message 

 

[user@hostname ~]$ scp hello root@192.168.4.14:/usr/bin
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@    WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!     @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
Someone could be eavesdropping on you right now (man-in-the-middle attack)!
It is also possible that a host key has just been changed.
The fingerprint for the RSA key sent by the remote host is
6e:45:f9:a8:af:38:3d:a1:a5:c7:76:1d:02:f8:77:00.
Please contact your system administrator.
Add correct host key in /home/hostname /.ssh/known_hosts to get rid of this message.
Offending RSA key in /var/lib/sss/pubconf/known_hosts:3
RSA host key for .... has changed and you have requested strict checking.
Host key verification failed.

later i tried with sudo scp.. then the image hello is transferred but on /usr/bin I am not able to execute though i could find the image hello in my /usr/bin and when i run hello , it is showing an error message that command not found. Is that problem with petalinux2017.1? I didnot face problem when i worked on 2015.4 petalinux previously to send the images and run on my board.

 

 

And for a trial i tried to send the image which was generated from the cross compilation from 2015.4 version and sent using scp to the zc706 and tried to run but it didnot. Does the externally cross compiled files run on the petalinux running on the zc706?

0 Kudos
Reply
1 Solution

Accepted Solutions
Explorer
Explorer
4,739 Views
Registered: ‎03-09-2017

 

 

I understood that why my previously cross compiled files for zedboard did not work for zc706 board. SCP and SSH are working perfectly but unable to run those files which are built outside petalinux but using Xilinx-linux-gnueabi-gcc tool chain (2015.4) and sent to this board.

 

Because it seems it needs armhf.

 

Though both (zedboard and zc706) have ARM cortex A9 with ARMv7-A (architecture) and also 32 bit. Found that this zc706 is not running externally compiled arm-xilinx-linux-gnueabi-gcc toolchain but it is running those from gnueabihf-gcc (gnueabi hard float for armhf) for the ZC706.

 

Got gcc-linaro-arm-linux-gnueabihf-4.8-2014.04_linux.tar.xz  from

https://releases.linaro.org/archive/14.04/components/toolchain/binaries/

 

 

 

But it is not present in Xilinx tool chain as arm-xilinx-gnueabihf-gcc but got it from linaro from. But don’t know why, petalinux has Xilinx-linux-gnueabi-gcc only but the images generated for arm and not armhf run over this zc706 board. 

 

 

 

View solution in original post

0 Kudos
Reply
9 Replies
Teacher
Teacher
3,317 Views
Registered: ‎06-16-2013

Hi @jenny_august13

 

It's ssh connection issue.

 

Please remove incorrect ssh key information in known_host file.

After that you try "scp" command.

 

- Remove incorrect ssh key information in known_hosts file.

$ ssh-keygen -R 192.168.4.14

 

Thank you.

Best regards,

 

 

 

Explorer
Explorer
3,301 Views
Registered: ‎03-09-2017

Here is the attachment , i deleted the old RSA keys from hosts and generated new and transferred but still I am unable to run the image clustering though i found it in my /usr/bin.

scp.png
0 Kudos
Reply
Explorer
Explorer
3,290 Views
Registered: ‎03-09-2017

Do i need any libraries to run externally compiled and generated images?

0 Kudos
Reply
Contributor
Contributor
3,283 Views
Registered: ‎05-27-2015
Normally no but what's the problem you are having when you run the binary ?
Do you have the rights to execute the binary ? If not, change it by executing `chmod +x hello` and then execute it by runnging `./hello`.
0 Kudos
Reply
Teacher
Teacher
3,280 Views
Registered: ‎06-16-2013

Hi @jenny_august13

 

Could you confirm permission of "~/.ssh/known_hosts" ?

 

I guess you have permission issue, too.

 

Thank you.

Best regards,

0 Kudos
Reply
Explorer
Explorer
3,246 Views
Registered: ‎03-09-2017
Nope I tried those ways. And i also copied the binary directly into my filesystem partition of sd card and after booting tried to run it and it didnot run on the board. But the cross compiled files which were run on petalinux 2015.4 on the ZedBoard. Now, it isnt running on 2017.1 petalinux on the zc706.
0 Kudos
Reply
Contributor
Contributor
3,238 Views
Registered: ‎05-27-2015

Could you show the content of `/lib/` folder with ls -l options ? What error are you getting when you run ? Please show the screenshot with all the informations so that we can find a solution. 
Best regards,
Abdul

0 Kudos
Reply
Explorer
Explorer
3,222 Views
Registered: ‎03-22-2016

You can set up an entry in your ssh config to allow it to ignore ssh host key errors. Just like the error message states, this can allow for a man-in-the-middle attack, but I think it's ok to do in a development environment when you know that the your host key changes on every reboot anyway.

 

Host zynq_device
    User root
    Hostname 10.0.0.1
    ForwardX11 no
    ForwardAgent no
    StrictHostKeyChecking no
    UserKnownHostsFile /dev/null
    IdentityFile ~/.ssh/id_zynq_device_rsa

The lines of interest are StrictHostKeyChecking and UserKnownHostsFile

 

Setting up an SSH key to be automatically pushed to the root fs image is also worth doing to avoid needing to type a password every time.

 

To do that, create a petalinux app and make the recipe look something like this:

 

#
# This file is the ssh key install recipe.
#

SUMMARY = "ssh key install"
SECTION = "PETALINUX/apps"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"

SRC_URI = "file://id_zynq_device_rsa.pub"
S = "${WORKDIR}"

do_install() {
    install -d ${D}/home/root/.ssh
    install -m 0600 ${S}/id_zynq_device_rsa.pub ${D}/home/root/.ssh/authorized_keys
}

FILES_${PN} += "/home/root/"

And make sure your key is in the files/ directory.

0 Kudos
Reply
Explorer
Explorer
4,740 Views
Registered: ‎03-09-2017

 

 

I understood that why my previously cross compiled files for zedboard did not work for zc706 board. SCP and SSH are working perfectly but unable to run those files which are built outside petalinux but using Xilinx-linux-gnueabi-gcc tool chain (2015.4) and sent to this board.

 

Because it seems it needs armhf.

 

Though both (zedboard and zc706) have ARM cortex A9 with ARMv7-A (architecture) and also 32 bit. Found that this zc706 is not running externally compiled arm-xilinx-linux-gnueabi-gcc toolchain but it is running those from gnueabihf-gcc (gnueabi hard float for armhf) for the ZC706.

 

Got gcc-linaro-arm-linux-gnueabihf-4.8-2014.04_linux.tar.xz  from

https://releases.linaro.org/archive/14.04/components/toolchain/binaries/

 

 

 

But it is not present in Xilinx tool chain as arm-xilinx-gnueabihf-gcc but got it from linaro from. But don’t know why, petalinux has Xilinx-linux-gnueabi-gcc only but the images generated for arm and not armhf run over this zc706 board. 

 

 

 

View solution in original post

0 Kudos
Reply