Table of Contents

Copying files from host to starterkit

There are several options to copy files to the starterkit, in this tutorial we decribe how to do this.

Using NFS to copy files between Ubuntu 14.04 and STK

To use NFS file sharing you need the package 'nfs-kernel-server', you also need to create the file /etc/exports on the host machine. Inside /etc/exports is a list of exportable filesystems which you need to set up manually. The filesystem we export in this tutorial is /home/embedded.

The contents of the file are as follows:

/etc/exports

After this file was changed the NFS server should be restarted:

user@ubuntu:~$ sudo service nfs-kernel-server restart

To access the specified filesystem from your starterkit you need to run the following command:

 mount -o nolock [HostIP]:[specified_filesystem] [target_filesystem]

example:

Using SCP/ SSH

To copy files to your starterkit make sure you have the openssh-server package installed on your host machine. Openssh-server comes standard with our BSP, you do not need to further adapt it to use ssh.

To copy a file from the host to the starterkit via ssh you need the scp command. The port through which STK and Host communicate is 22 by default. The scp command looks like this:

scp [Host user]@[Host IP-address]:[path of the file on host machine] [target path on STK]

example

Troubleshooting:

If access to the host system is denied, make sure the ssh-server on the host machine is listening to the right port and is able to communicate through the firewall.

To check if the Server is listening to the right port use this command:

sudo netstat -anp | grep sshd

what it should look like:

If the ssh-server is not listening to tcp 0 0.0.0.0:22 you need to open a new port. To do that you need to edit the sshd_config file.

sudo nano /etc/ssh/sshd_config

This is what sshd_config should ideally look like:

If your sshd_config looks like this and you are still denied access to the host machine, use the following command open the host systems firewall to port 22:

sudo ufw allow 22