cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Highlighted
Voyager
Voyager
420 Views
Registered: ‎07-06-2016

ftp server petalinux 2019.2/2020.1 not working

Jump to solution

Hello,

I ported my project from petalinux 2018.3 to 2019.2  and I realised that the ftp server doesn't work I can't access to the folders/files like before.

I've seen a related thread here  but without solution, and unfortunately non of the suggestions work for me either. The only way I had to connect to the target through ftp was removing the -w option but the problem is that I can't write files, the steps I followed after petalinux boot are:

-> Edit: vi /etc/inetd.conf
-> Remove -w from the line:
ftp stream tcp nowait root ftpd ftpd -w
-> Restart busybox:
/etc/init.d/# ./inetd.busybox restart

does anyone know a proper workaround to this to be able to do a ftp connection with write permissions (from boot)?

Even when I try to access to the busybox config (petalinux-config -c busybox) I've got errors (pls see log attached).

So is there an official working solution to fully work with ftp in petalinux 2019.2?

Thanks.

 

0 Kudos
1 Solution

Accepted Solutions
Highlighted
Observer
Observer
149 Views
Registered: ‎05-21-2013

@joseer 

Yes it is. As I said  in my case I was able to connect to the ftp (if I remove the -w switch) and able to read the files. When I have -w switch it was giving the error 

ftpd: invalid option -- w

Then once I enable the switch in the defconfig read/write both started to work. I'm using Petalinux 2019.2 

1) Can you use any other ftp clients(filezilla) and post the error code/message when you try to connect

2) When you try to connect via ftp you should see a service in the linux side (running 'top' in the shell)

Mem: 27488K used, 453188K free, 32K shrd, 348K buff, 17688K cached
CPU: 0.2% usr 1.0% sys 0.0% nic 98.7% idle 0.0% io 0.0% irq 0.0% sirq
Load average: 0.13 0.08 0.05 1/50 968
PID PPID USER STAT VSZ %VSZ CPU %CPU COMMAND
883 1 root R 90140 18.7 0 0.8 ./SMCServer.elf
848 2 root SW 0 0.0 0 0.3 [fpgaDriver]
963 962 root S 3036 0.6 0 0.0 -sh
815 1 root S 3028 0.6 0 0.0 /sbin/inetd
962 815 root S 2952 0.6 0 0.0 telnetd -i
964 963 root R 2948 0.6 0 0.0 top
967 815 root S 2948 0.6 0 0.0 ftpd -w /
1 0 root S 1836 0.3 0 0.0 init

Are you sure the permissions are good? user name and password to access the petalinux

 

 

View solution in original post

9 Replies
Highlighted
Observer
Observer
267 Views
Registered: ‎05-21-2013

I went through the similar upgrading from 2018.2 to 2019.2 and ran into couple of issues. One of the issues was that the FTP server doesn't have the write access. There are some solutions to switch it to SFTP etc. But I wanted to continue with what I had earlier using the FTPServer via busybox.

In the busybox configuration, the write permission is disabled by default. Please enable the following setting 

CONFIG_FEATURE_FTPD_WRITE=y 

in the defconfig file in the following folder

{PetalinuxFolder}/components/yocto/source/arm/layers/core/meta/recipes-core/busybox/busybox/

 

0 Kudos
Highlighted
Voyager
Voyager
227 Views
Registered: ‎07-06-2016

Hi @seethapp , sorry for the late response, just got back to this issue,

Thanks for your suggestion but that option is already set it in the busybox config and still not working...

 

 

0 Kudos
Highlighted
Voyager
Voyager
215 Views
Registered: ‎07-06-2016

I've just trying now in 2020.1 and I'm having same problem, the ftp server doesn't work and I'm not able to connect to the board from the host...

The in inetd.conf file looks like this:

#/etc/inetd.conf:  see inetd(8) for further informations.
#
# Internet server configuration database
#
# If you want to disable an entry so it isn't touched during
# package updates just comment it out with a single '#' character.
#
# <service_name> <sock_type> <proto> <flags> <user> <server_path> <args>
#
#:INTERNAL: Internal services
#echo          stream  tcp     nowait  root    internal
#echo          dgram   udp     wait    root    internal
#chargen       stream  tcp     nowait  root    internal
#chargen       dgram   udp     wait    root    internal
#discard               stream  tcp     nowait  root    internal
#discard               dgram   udp     wait    root    internal
#daytime               stream  tcp     nowait  root    internal
#daytime       dgram   udp     wait    root    internal
#time          stream  tcp     nowait  root    internal
#time          dgram   udp     wait    root    internal
#telnet  stream  tcp     nowait  root    telnetd telnetd -i
#ftp     stream  tcp     nowait  root    ftpd    ftpd -w /var/ftp/

The telnet and ftp last two lines are commented with # , I tried to delete the # and restart busybox: 

/etc/init.d/# ./inetd.busybox restart

But still not working.

The Busybox ftpd.cfg file in /components/yocto/source/arm/layers/core/meta/recipes-core/busybox/busybox/ looks like this:

CONFIG_FTPD=y

CONFIG_FEATURE_FTP_WRITE=y

CONFIG_FEATURE_FTPD_ACCEPT_BROKEN_LIST=y

The ftp.cfg:

CONFIG_FTPGET=y

CONFIG_FTPPUT=y

CONFIG_FEATURE_FTPGETPUT_LONG_OPTIONS=y

inetd.cfg:

CONFIG_INETD=y

CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_ECHO=y

CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_DISCARD=y

CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_TIME=y

CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_DAYTIME=y

CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_CHARGEN=y

 

Does anyone know how to get the ftp server working in petalinux 2020.1?

0 Kudos
Highlighted
Observer
Observer
202 Views
Registered: ‎05-21-2013

I checked all the *.cfg files you mentioned and the settings are same as mine. But in my case they resides in a different folder

/components/yocto/source/arm/layers/meta-petalinux/meta/recipes-core/busybox/busybox/. Also you didn't mention anything on the 'CONFIG_FEATURE_FTPD_WRITE' other than it is set already. In my case defconfig  resides in the following folder

/components/yocto/source/arm/layers/core/meta/recipes-core/busybox/busybox/. If it is set please use 'grep' or some other means to check for the 'CONFIG_FEATURE_FTPD_WRITE' anywhere else overwritten. 

inetd.conf looks fine as long as ftp is enabled which is working in your case except the write access.

 

Highlighted
Voyager
Voyager
185 Views
Registered: ‎07-06-2016

Hi @seethapp ,

Thanks for getting back on this and the suggestion,

I searched for the file defconfig  in the petalinux project (v2020.1), and I could find it here: components/yocto/layers/core/meta/recipes-core/busybox/busybox/defconfig and as you suspected the CONFIG_FEATURE_FTPD_WRITE is not set:

 

grep -rnw -e 'CONFIG_FEATURE_FTPD_WRITE'
components/yocto/layers/core/meta/recipes-core/busybox/busybox/defconfig:848:# CONFIG_FEATURE_FTPD_WRITE is not set

 

So I changed it to : 

 

CONFIG_FEATURE_FTPD_WRITE=y

 

 After rebuilding and booting petalinux  I'm still not able to access through ftp, i.e if I type (like I did with 2018.3) the board static IP in a windows explorer (e.g: ftp://192.168.1.5) got a 'cannot access to folder' message ... obviously I can 'ping' the board...

I think that flag (CONFIG_FEATURE_FTPD_WRITE) only enables or disables the write option for ftp server? but the problem I'm having is that I'm not even able to access in reading mode...it is like the ftp server was not enable at all...

Any ideas what is going on?

0 Kudos
Highlighted
Observer
Observer
179 Views
Registered: ‎05-21-2013

@joseer ,

So that change should take care of the write access issue. I think now we're dealing with getting ftp up and running. Earlier you have mentioned the ftp was commented in the inetd.conf file. Is it still that way? You will see the inetd.conf in the following folder.

{PetalinuxFolder}/{project}/project-spec/meta-plnx-generated/recipes-core/busybox/files

Please enable the ftp instead of enabling it once after the system booted. (you will see all folders at the root level then you can restrict it to the folder /var/ftp) . Build the components again and make sure ftp is running once the system is booted and give it a try. If it is still not working just post the services running and contents of /etc/inetd.conf

 

#/etc/inetd.conf: see inetd(8) for further informations.
#
# Internet server configuration database
#
# If you want to disable an entry so it isn't touched during
# package updates just comment it out with a single '#' character.
#
# <service_name> <sock_type> <proto> <flags> <user> <server_path> <args>
#
#:INTERNAL: Internal services
{Removed the commented other services for clarity}
telnet stream tcp nowait root telnetd telnetd -i
ftp stream tcp nowait root ftpd ftpd -w

0 Kudos
Highlighted
Voyager
Voyager
161 Views
Registered: ‎07-06-2016

Hi @seethapp ,

Thanks for your quick answer,

Yes I did changed it in folder: /project-spec/configs/busybox/inetd.conf and it boots with the uncommented lines, this is the file after booting now:

#/etc/inetd.conf:  see inetd(8) for further informations.
#
# Internet server configuration database
#
# If you want to disable an entry so it isn't touched during
# package updates just comment it out with a single '#' character.
#
# <service_name> <sock_type> <proto> <flags> <user> <server_path> <args>
#
#:INTERNAL: Internal services
#echo          stream  tcp     nowait  root    internal
#echo          dgram   udp     wait    root    internal
#chargen       stream  tcp     nowait  root    internal
#chargen       dgram   udp     wait    root    internal
#discard               stream  tcp     nowait  root    internal
#discard               dgram   udp     wait    root    internal
#daytime               stream  tcp     nowait  root    internal
#daytime       dgram   udp     wait    root    internal
#time          stream  tcp     nowait  root    internal
#time          dgram   udp     wait    root    internal
telnet  stream  tcp     nowait  root    telnetd telnetd -i
ftp     stream  tcp     nowait  root    ftpd    ftpd -w

 That's the part I don't understand because looking the config looks enable but I'm not able to connect....

Is it working fine on your side? what petalinux version are you using?

0 Kudos
Highlighted
Observer
Observer
150 Views
Registered: ‎05-21-2013

@joseer 

Yes it is. As I said  in my case I was able to connect to the ftp (if I remove the -w switch) and able to read the files. When I have -w switch it was giving the error 

ftpd: invalid option -- w

Then once I enable the switch in the defconfig read/write both started to work. I'm using Petalinux 2019.2 

1) Can you use any other ftp clients(filezilla) and post the error code/message when you try to connect

2) When you try to connect via ftp you should see a service in the linux side (running 'top' in the shell)

Mem: 27488K used, 453188K free, 32K shrd, 348K buff, 17688K cached
CPU: 0.2% usr 1.0% sys 0.0% nic 98.7% idle 0.0% io 0.0% irq 0.0% sirq
Load average: 0.13 0.08 0.05 1/50 968
PID PPID USER STAT VSZ %VSZ CPU %CPU COMMAND
883 1 root R 90140 18.7 0 0.8 ./SMCServer.elf
848 2 root SW 0 0.0 0 0.3 [fpgaDriver]
963 962 root S 3036 0.6 0 0.0 -sh
815 1 root S 3028 0.6 0 0.0 /sbin/inetd
962 815 root S 2952 0.6 0 0.0 telnetd -i
964 963 root R 2948 0.6 0 0.0 top
967 815 root S 2948 0.6 0 0.0 ftpd -w /
1 0 root S 1836 0.3 0 0.0 init

Are you sure the permissions are good? user name and password to access the petalinux

 

 

View solution in original post

Highlighted
Voyager
Voyager
90 Views
Registered: ‎07-06-2016

Hi @seethapp ,

Thanks again for  all  your help,

I installed the filezilla client and when I tried to connect I've got the next messages:

 

 

Status:	Connecting to 192.168.1.12:21...
Status:	Connection established, waiting for welcome message...
Response:	ftpd: invalid option -- 'w'
Error:	Could not connect to server

 

 

So the error was the same as you had, even enabling the CONFIG_FEATURE_FTPD_WRITE parameter  in defconfig...

But if I follow the next steps(once petalinux boots):

- Edit inetd.conf file delete -w option and re-write it again.

-Save file and exit.

- Restart inetd service:

 

 

cd /etc/init.d
./inetd.busybox restart

 

 

The ftp server works fine.

So that helped me to realise that it might be a format issue in the inetd.conf file, so I checked the line in {petalinux project}/project-spec/configs/busybox/inetd.conf file and I removed a space at the end of the line: 

 

 

ftp     stream  tcp     nowait  root    ftpd    ftpd -w

 

 

And after rebuilding petalinux with the change the ftp server works fine (read and write).

In summary to get the ftp server to work with petalinux 2020.1 I followed the next steps:

-  Enable CONFIG_FEATURE_FTPD_WRITE parameter (CONFIG_FEATURE_FTPD_WRITE =y) in: 

 

 

{petalinux project}/components/yocto/layers/core/meta/recipes-core/busybox/busybox/defconfig

 

 

- Uncomment the line: 

 

 

ftp     stream  tcp     nowait  root    ftpd    ftpd -w /var/ftp/

 

 

 in {petalinux project}/project-spec/configs/busybox/inetd.conf file (if you remove the /var/ftp make sure there's not any spaces or tabs after -w)

Hope this can help anyone else in the future. For next petalinux versions would be great to have all this enabled out-of-the-box