2011-04-26 05:34:41     installing dropbear on uCLinux

Document created by Aaronwu Employee on Aug 26, 2013
Version 1Show Document
  • View in full screen mode

2011-04-26 05:34:41     installing dropbear on uCLinux

Sebastian Heinrich (GERMANY)

Message: 100165   

 

Hello,

 

I wanted to install dropbear on uClinux following the steps described here:

 

https://docs.blackfin.uclinux.org/doku.php?id=uclinux-dist:dropbear

 

But unfortunately I have no entry in "Network Applications" for dropbear.

 

I made a "make menuconfig" in the top directory of my uClinux distribution.

 

Then "Kernel/Library/Defaults Selection -> Customize Application/Library Settings"

 

Exit and Save

 

Then on the next config-screen i choosed "Network Applications".

 

After that I downloaded the sources of dropbear and tried to cross-compile it by myself.

 

By the way I'm trying to compile it for the BF537E board and the  uClinux Version I want to use is 2.6.28.10-ADI-2009R1.1

 

(uClinux is running very well on the BF537E board so far...)

 

But that makefile is not configured for the blackfin architecture and toolchain.

 

Does anybody know how to get the entry for dropbear in "make menuconfig" so that the compilation will complete successfull with "make romfs"?  And if thats not possible is there anybody who can tell me how I must run the configure-scrip (with which parameters) or adapt the makefile so that I'm able to cross-compile dropbear ?

 

Please notice that I'm new to uClinux und the Blackfin Processors. So if I didn't give you all the informations that you need to help me than please tell me that:-)

 

Thank you for your help

TranslateQuoteReplyEditDelete

 

 

2011-04-26 05:37:39     Re: installing dropbear on uCLinux

Mike Frysinger (UNITED STATES)

Message: 100166   

 

you'll need to upgrade to the 2010R1 release

QuoteReplyEditDelete

 

 

2011-04-26 09:48:13     Re: installing dropbear on uCLinux

Robert Wimmer (GERMANY)

Message: 100170   

 

[Posting this with helping more than one person in mind -> Application Development]

 

 

 

Otherwise, if you REALLY want to use the old 2009R1.1 (not really recommended):

 

 

 

[uClinux-root]/user/Kconfig

 

===========================

 

 

config USER_DROPBEAR_DROPBEAR

    bool "dropbear"

    depends on USER_INETD_INETD

    select LIB_ZLIB

    help

      Dropbear-SSH ist a small sshd-replacement, that does not depend on

      foreign Libraries. It is configured to be statically linked, without

      zlib and most features disabled. It is configured to be invoked from

      inetd and may therefore need a few seconds to answer a connection.

      Approx. binary size: 100k

 

 

 

and [uClinux-root]/user/Makefile

 

================================

 

dir_$(CONFIG_USER_DROPBEAR_DROPBEAR)        += dropbear

 

as well as in [uClinux-root]/user/dropbear/Makefile

 

===============================================

 

VER = dropbear-0.52

 

FLTFLAGS += -s 0x4000

 

export MULTI = 1

export PROGRAMS = dropbear dbclient dropbearkey dropbearconvert scp

 

AUTOTOOLS_BUILD_HOST = true

 

include $(ROOTDIR)/tools/autotools.mk

 

pre-build::

    $(MAKE) -C build-$(VER)

 

host-build:

    $(MAKE) -C build-host-$(VER) dropbearkey MULTI=0

 

romfs:

    $(ROMFSINST) -d build-$(VER)/dropbearmulti /usr/bin/dropbear

    $(ROMFSINST) -s dropbear /usr/bin/dropbearkey

    $(ROMFSINST) -s dropbear /usr/bin/dbclient

    $(ROMFSINST) -s dropbear /usr/bin/dropbearconvert

    $(ROMFSINST) -s dropbear /usr/bin/scp

    $(ROMFSINST) -a "ssh     stream tcp nowait root /usr/bin/dropbear -i 2 > /dev/null" /etc/inetd.conf

 

    mkdir -p $(ROMFSDIR)/etc/dropbear

    [ -e $(ROMFSDIR)/etc/dropbear/dropbear_dss_host_key ] || ./build-host-$(VER)/dropbearkey -t dss -f $(ROMFSDIR)/etc/dropbear/dropbear_dss_host_key

    [ -e $(ROMFSDIR)/etc/dropbear/dropbear_rsa_host_key ] || ./build-host-$(VER)/dropbearkey -t rsa -f $(ROMFSDIR)/etc/dropbear/dropbear_rsa_host_key

 

Also refer to:

 

  docs.blackfin.uclinux.org/doku.php?id=application_development

TranslateQuoteReplyEditDelete

 

 

2011-04-26 12:47:19     Re: installing dropbear on uCLinux

Sebastian Heinrich (GERMANY)

Message: 100175   

 

Ok thanks for your realy fast answer ;-)

 

I will give it a try on the old 2009 release. This is because I'm working for my diploma thesis (on german university) and unfortunately I'm not the first one working with that stuff for the research project.

 

My predecessor has somehow adapted (compiled) it for the 2009 release (and naturally not documented :-) ). But if I start dropbear (with -E -F) on the blackfin and my client pc wants to connect dropbear prints the error that forking is not implemented.

 

If I'm informed right thats because of the function fork() is not supported on blackfin and should be replaced with vfork().

 

I've done that and wanted to recompile and thats the reason for my question here.

 

Ok thanks for answering me!! I will do some experiments, and if thats with the 2009er release not working in a day, i'll try the 2010RC.

 

 

 

 

TranslateQuoteReplyEditDelete

 

 

2011-04-26 19:25:48     Re: installing dropbear on uCLinux

Steve Strobel (UNITED STATES)

Message: 100180   

 

We used to use Dropbear with uClinux-dist-2008R1.5-RC3.tar.bz2.  Since upgrading to uClinux-dist-2009R1.1-RC4.tar.bz2 we haven't had it working (I tried to enable it but it didn't work right off and I haven't figured out why).  I am not very excited about doing another update (we have lots of changes that would need ported), so if you figure out how to get it working, I would love to know about it.  Thanks.

 

Steve

QuoteReplyEditDelete

 

 

2011-04-27 09:38:18     Re: installing dropbear on uCLinux

Sebastian Heinrich (GERMANY)

Message: 100203   

 

Hi Guys

 

I got a problem. I changed Kconfig and the Makefile in /uClinux-dist/user/ to what Robert told me. But no drobear entry in the application/library settings of make menuconfig appears. Then I played a little bit around with the entries and I discovered that if I change the entry in /uClinux-dist/user/Kconfig from

 

config USER_DROPBEAR

 

bool "dropbear"

 

depends on USER_INETD_INETD

 

select LIB_ZLIB

 

help

 

Dropbear-SSH ist a small sshd-replacement, that does not depend on

 

foreign Libraries. It is configured to be statically linked, without

 

zlib and most features disabled. It is configured to be invoked from

 

inetd and may therefore need a few seconds to answer a connection.

 

Approx. binary size: 100k

 

 

 

to that

 

config USER_DROPBEAR

 

bool "dropbear"

 

help

 

Dropbear-SSH ist a small sshd-replacement, that does not depend on

 

foreign Libraries. It is configured to be statically linked, without

 

zlib and most features disabled. It is configured to be invoked from

 

inetd and may therefore need a few seconds to answer a connection.

 

Approx. binary size: 100k

 

the dropbear entry appears. Naturally this is then not compileable. I think the lib LIB_ZLIB and INED must be choosen (or already compiled ??) to enable the dropbear entry ? is that right, so far ?

 

My question is now:

What libraries do I have to add that the make menuconfig is able to display the dropbear entry ?

What entries I have to choose exactly to get the libs LIB_ZLIB and the program USER_INED_INED ?

 

Is my question clear ?

Unfortunately I cannot change to RC2010. 

 

Thank you for your help!!

 

Sebastian

TranslateQuoteReplyEditDelete

 

 

2011-04-27 10:01:26     Re: installing dropbear on uCLinux

Sebastian Heinrich (GERMANY)

Message: 100204   

 

Sorry for asking that fast.

 

Inetd was not enabled. thats a little bit embarrassing. Sorry.

 

Other question:

 

I changed in

 

compate.c:  

svr-main.c

scp.c

svr-chansession.c

cli-authpasswd.c

 

the fork() system call to vfork(). Then I made a make menuconfig (select dropbear and inetd!) and then make romfs.

 

But dropbear runs in the same "forking not implemented" error. Which files do i have to edit to get rid of the fork() system call ?

 

And how do i compile dropbear correct ?

 

 

 

With best regards.

 

Sebastian

 

 

 

TranslateQuoteReplyEditDelete

 

 

2011-04-27 11:37:31     Re: installing dropbear on uCLinux

Robert Wimmer (GERMANY)

Message: 100207   

 

Hmmm, as I can see in scp.c you shouldn't have to modify the sources. You can see e.g.:

 

 

 

#ifdef __uClinux__

                replacearg(&args, 0, "%s", ssh_program);

                if (remuser != NULL)

                        addargs(&args, "-l%s", remuser);

                addargs(&args, "%s", host);

                addargs(&args, "%s", cmd);

#endif /* __uClinux__ */

 

 

 

That means to me you only should ensure that __uClinux__ is defined. It somehow looks like dropbear is handling vfork() differently to fork(), so just replacing fork() probably isn't doing the trick.

TranslateQuoteReplyEditDelete

 

 

2011-04-28 05:10:01     Re: installing dropbear on uCLinux

Sebastian Heinrich (GERMANY)

Message: 100245   

 

Hello again

 

 

 

dropbear is now working on release from 2009.

 

I changed the fork() system call to a vfork() system call in the files described in    hi.baidu.com/kkernel/blog/item/ff919681141beddebc3e1e23.html (this is for arm processors, but that should only have an impact on the configuration).

 

Then i followed the steps from Robert, adapting the Kconfig and the Makefile accordingly. In make menuconfig->Application/Library settings->Networkapplication inetd has to be enabled.

 

With that make and make romfs is runnung through and dropbear is working fine.

 

How can I mark this thread as solved ??

 

So thanks for your help !!

 

Sebastian

TranslateQuoteReplyEditDelete

 

 

2011-04-28 10:40:35     Re: installing dropbear on uCLinux

Wojtek Skulski (UNITED STATES)

Message: 100265    Sebastian:

 

could you please post the patch? I am using 2009 and I cannot switch, so

your contribution is very important to me.

 

Many thanks in advance. -- Wojtek

QuoteReplyEditDelete

 

 

2011-04-28 11:01:22     Re: installing dropbear on uCLinux

Sebastian Heinrich (GERMANY)

Message: 100266   

 

There's no patch I've used.

 

Only changed the fork() to vfork() in the files described in above link.

 

At what point do you have an error ?

 

Follow the steps of Robert (I think they are very detailed) and replace the fork() call.

 

Then do a make (with dropbear and inetd enabled in make menuconfig) and that's it.

TranslateQuoteReplyEditDelete

 

 

2011-04-28 11:08:12     Re: installing dropbear on uCLinux

Wojtek Skulski (UNITED STATES)

Message: 100267    Sebastian:

thank you for the info. I will start using dropbear under 2009 as soon as

we deploy our boards.

QuoteReplyEditDelete

Attachments

    Outcomes