Jump to content


Photo

Compiling Dropbear for DM500


  • Please log in to reply
29 replies to this topic

#1 bartender

  • Senior Member
  • 207 posts

0
Neutral

Posted 25 January 2008 - 03:42

I am trying to compile up Dropbear 0.50 to work on the DM500 however I am still getting the error of a missing symbol in libc which is the same error I get when I use the Gemini build 4.2 build of Dropbear on the PLi Iolite image.

Checking out the latest CVS from cvs.tuxbox.org.

I build Dropbear on my SLES 10 box locally using:

./configure --build=i686-suse-linux --host=powerpc-tuxbox-linux-gnu --disable-largefile
Also edit the options.h and remove X11 forwarding, leave everything else as default.
then
make PROGRAMS="dropbear dropbearkey" MULTI=1

To make a dropbearmulti, then I strip the dropbearmulti from 1mb down to 140kb:

ls -la dropbearmulti
-rwxr-xr-x 1 root root 10264103 Jan 25 17:13 dropbearmulti
powerpc-tuxbox-linux-gnu-strip dropbearmulti
ls -la dropbearmulti
-rwxr-xr-x 1 root root 140104 Jan 25 17:14 dropbearmulti

And after uploading libutil to the PLi Iolite image plus the dropbear multi I am still getting the error:

./dropbear: relocation error: ./dropbear: symbol __xpg_basename, version GLIBC_2.0 not defined in file libc.so.6 with link time reference

If I don't compile dropbear as a multi-image then it works fine, however as soon as I compile it as multi then it give me the above error.

Any ideas what I could be doing wrong? Or if there is a way to add libutil, and update the glibc to include xpg_basename. That way we could run a sigificantly smaller version of dropbear in the PLi image.

Re: Compiling Dropbear for DM500 #2 dAF2000

  • PLi® Ex-Leden
  • 14,151 posts

+52
Good

Posted 25 January 2008 - 07:56

I think you're doing nothing wrong. The cdk boxes (56xx, 500, 7000) have a stripped libc. A full libc (containing all the symbols) wouldn't fit in the internal flash. So, we need to recompile the libc in the image to add symbols like __xpg_basename. I'm not sure if we already have dropbear in our build and why it's 720 kB. We'll have to check that.
Many answers to your question can be found in our wiki: http://openpli.org/wiki

Re: Compiling Dropbear for DM500 #3 bartender

  • Senior Member
  • 207 posts

0
Neutral

Posted 28 January 2008 - 01:14

I think you're doing nothing wrong. The cdk boxes (56xx, 500, 7000) have a stripped libc. A full libc (containing all the symbols) wouldn't fit in the internal flash. So, we need to recompile the libc in the image to add symbols like __xpg_basename. I'm not sure if we already have dropbear in our build and why it's 720 kB. We'll have to check that.


I could understand that however the libc I am using is from the CVS Tuxbox checkout, and that works fine, as does the Gemini 4.1 build. Both of them are for the 500's as well, and are not substantially that different in size than the PLi revision.

It seems that the glibc complied for the PLi images is different from the standard cvs.tuxbox.org & Gemini's build of glibc, as those versions are only 40kb larger than the PLi version. CVS Checkout libc.so.6 = 724k (works) -- Gemini 4.1 libc.so.6 = 768k (works) -- PLi Iolite 2008 libc.so.6 = 740k (doesn't work).

It seems that the PLi source for libc has branched from the CVS for the 500 and hasn't been updated for some time perhaps.

IMHO If the following could get done that would be great:
1) Merge the latest libc from the Tuxbox CVS into the PLi image
2) Add libutil as well, it's only 6kb
3) Compile a dropbearmulti release with only dropbear and dropbearkey as those are the only tools that are "really" needed on the 500, you don't need the dclient /scp / ssh as you only want to use dropbear to get files onto the box, not ssh to other boxes. That helps reduce the size of the dropbearmulti to ~160kb, which I think is not TOO much.

Anything I could do to help this happen I would happily do :)

Re: Compiling Dropbear for DM500 #4 dAF2000

  • PLi® Ex-Leden
  • 14,151 posts

+52
Good

Posted 28 January 2008 - 08:56

Could you post your dropbear binary here? I'll test it on a 7000 and 600.
Many answers to your question can be found in our wiki: http://openpli.org/wiki

Re: Compiling Dropbear for DM500 #5 bartender

  • Senior Member
  • 207 posts

0
Neutral

Posted 29 January 2008 - 05:05

Attached

The broken directory has the dropbearmulti that has been complied with dropbear and dropbearkey.

The Working directory are standalone dropbear and dropbearkey executeables

Dropbearmulti works fine on my DM600 running PLi Iolite 2008. So yeah... go figure :)

Attached Files



Re: Compiling Dropbear for DM500 #6 bartender

  • Senior Member
  • 207 posts

0
Neutral

Posted 29 January 2008 - 05:10

Sorry for the dual post, thought I hadn't posted the first time around, and can't delete posts.

Re: Compiling Dropbear for DM500 #7 dAF2000

  • PLi® Ex-Leden
  • 14,151 posts

+52
Good

Posted 30 January 2008 - 18:44

I've tested your binaries on my 7000 and indeed I get the unresolved symbol.
So, what we could do is to get dropbear in our build process. That would generate a libc with the right symbols. The libc sizes between images varies depending on what you got in the image. Our libc size is between Gemini and CVS but they might be quite different. So we can't just copy the libc because other things would not work anymore.

I'll see if we can get dropbear in our build. Note that the DM500 has still room in the flash, but the DM7000 image is quite full now. Even something like "only 40kB" would not fit anymore.
Many answers to your question can be found in our wiki: http://openpli.org/wiki

Re: Compiling Dropbear for DM500 #8 bartender

  • Senior Member
  • 207 posts

0
Neutral

Posted 30 January 2008 - 19:13

I think from my perspective it would be preferable to have it part of the base image since then telnetd/ftp could be turned off in inet or however it's started, however if the 7000 image is already full and adding an extra 40kb to the image size just can't be done <phew what else is in there....>. The other option would be to have a working dropbearmulti download via the ppanel which wasn't 700kb. That version must be a full static link including everything from libutil and glibc to make it that large. I have never had a stripped version of dropbearmulti with everything from the dropbear source including dclient (ssh/scp) ever be larger than 200kb. As long as glibc can have the required API's added then the problem in my mind is solved.

Could supply a patch if I had the pli source of libc to compare against... Anything I could to to help... But I understand why you keep your branch under wraps.

bedankt voor u medewerker :)

Re: Compiling Dropbear for DM500 #9 dAF2000

  • PLi® Ex-Leden
  • 14,151 posts

+52
Good

Posted 30 January 2008 - 19:58

The best solution would be if we fully build dropbear and rebuild the libc for that. The fastest solution would be if we just use your binary and rebuild libc. That's quite easy to do.

If I'm fast and have a quite evening, I could even give you tomorrow a new libc. However, the /lib directory of the 500 is read-only so you can't replace it easily unless you unpack the image before.

"Bedankt voor u medewerker" sounds funny. It's "Bedankt voor uw medewerking" in case you want to use it again ;)
Many answers to your question can be found in our wiki: http://openpli.org/wiki

Re: Compiling Dropbear for DM500 #10 bartender

  • Senior Member
  • 207 posts

0
Neutral

Posted 31 January 2008 - 10:33

I have a script to open up a Squashfs & cramfs image and recompress it afterwards so if you had a new libc I could easily add it into the image. I found the mkdreamboxfs scripts, and got them working....

I remember it was something like that.. the whole u/uw (male,female/formal informal.. argh!) and medewerking .. my mistake :)... My speaking dutch is a whole lot better than my written, as I never wrote dutch ever while I lived there for 4 years. To me the most important thing I learn't while living in cheeseheadland was you needed to understand what everyone was saying around you rather than being able to speak dutch. After two years of people saying "don't bother speaking the language, we speak better english" I just gave up. The only way I could get the dutchies to speak dutch to me was to swear at them in dutch. "God damm me, is this the netherlands or england, why are you such an acorn to speak english to me when I am trying to speak your language" was the expression (in dutch) I used most often.... :)

Re: Compiling Dropbear for DM500 #11 dAF2000

  • PLi® Ex-Leden
  • 14,151 posts

+52
Good

Posted 3 February 2008 - 11:48

Here's a libc.so for the DM500 which should work for dropbearmulti.

Attached Files


Many answers to your question can be found in our wiki: http://openpli.org/wiki

Re: Compiling Dropbear for DM500 #12 bartender

  • Senior Member
  • 207 posts

0
Neutral

Posted 4 February 2008 - 02:22

Cool... that works perfectly.

And attached is a modified PLi Iolite 2008 image with Dropbear multi complied with dropbear,dropbearkey,ssh,scp,dbclient + updated libc you included + libutil from the Gemini 4.1 image + CCcam 2.0.5 (hey I thought I would just throw it in there :)...

Also attached is a TGZ with only the files required to modify the base image. The only thing I did was create /bin/start_dropbear script, and call it from /etc/init.d/rcS

Yay... works a treat for me :)

And in case you wanted to compile up Dropbear yourself this is what I did.

Downloaded http://matt.ucc.asn....ar-0.50.tar.bz2

Then setup the following variables to point to the CVS Checkout of the CDK:

export PATH=$PATH:/data/tuxbox/root/cdk/bin (change this to wherever your CDK root is!)
export CC=powerpc-tuxbox-linux-gnu-gcc
export CFLAGS="-Wall -mcpu=405 -msoft-float -mmultiple -mstring -meabi -pipe -Os -ggdb3 -DHAVE_DREAMBOX_HARDWARE"
export CPP="powerpc-tuxbox-linux-gnu-gcc -E"
export RANLIB=powerpc-tuxbox-linux-gnu-ranlib
export STRIP=powerpc-tuxbox-linux-gnu-strip

then did:

./configure --host=powerpc-tuxbox-linux-gnu

Comment out the "#define ENABLE_X11FWD" out of the options.h since X11 forwarding isn't required, strangely enough :)

Then compiled up the dropbearmulti using (as per the readme "MUTLI" in the root dir of the dropbear archive):

make PROGRAMS="dropbear dropbearkey dbclient scp ssh" MULTI=1

then stripped dropbearmulti from 1mb down to 174k:

powerpc-tuxbox-linux-gnu-strip dropbearmulti

And I was done!

--Update
I updated the image to have the correct 2.0.5 CCcam in the /var_init/etc/plimgr/cams/CCcam file to say 2.0.5 not 2.0.4 so there shouldn't be any confusion.

Attached Files



Re: Compiling Dropbear for DM500 #13 dAF2000

  • PLi® Ex-Leden
  • 14,151 posts

+52
Good

Posted 4 February 2008 - 08:30

Nice!
I'll add dropbear to our build, and discuss if we want it by default in the image or just as a download (a smaller one we have now of course).
Many answers to your question can be found in our wiki: http://openpli.org/wiki

Re: Compiling Dropbear for DM500 #14 hutten

  • Senior Member
  • 67 posts

0
Neutral

Posted 5 February 2008 - 20:41

I have a script to open up a Squashfs & cramfs image and recompress it afterwards so if you had a new libc I could easily add it into the image. I found the mkdreamboxfs scripts, and got them working....

Could you plese supply them too? I used to have them my self before, but can't find them...
By the way, thanks for sharing!

Re: Compiling Dropbear for DM500 #15 nfnovice

  • Senior Member
  • 696 posts

0
Neutral

Posted 5 February 2008 - 22:19

bartender - I would love to have those scripts too please
DM800+DM7025+DM7020+DM7000+DM600+DM5620+DM500+VUDUO Dreambox great invention - whats it for ?

Re: Compiling Dropbear for DM500 #16 bartender

  • Senior Member
  • 207 posts

0
Neutral

Posted 6 February 2008 - 04:32

Hey guys... the undreamboxfs and mkdreamboxfs scripts I found on some site a while ago, I think it was the sejrom site?... the problem I faced was the unsquashfs tried to use some nasty 2.4 kernel module and mount the image via loopback... I think part of the OpenWRT modification toolkit I found a version of unsquashfs-lzma that worked via command line and had no dependencies on what kernel you ran.

To get a working script took me quite some time.... it's gotta be worth something to someone who wants it ;)...

When I get back to work I will compress up the files and ponder if I want to post them (or PM them to those who want them) as I could see a lot of not-so-good rogue images turning up if they got out into the wild. Just makes me a little cautious about posting them.

Re: Compiling Dropbear for DM500 #17 nfnovice

  • Senior Member
  • 696 posts

0
Neutral

Posted 6 February 2008 - 05:47

Understood bartender - thanks for consideration
DM800+DM7025+DM7020+DM7000+DM600+DM5620+DM500+VUDUO Dreambox great invention - whats it for ?

Re: Compiling Dropbear for DM500 #18 bartender

  • Senior Member
  • 207 posts

0
Neutral

Posted 6 February 2008 - 06:52

Had a brilliant idea over the last hour, if you can prove that you have made a donation to the PLi team (how does 10Euro sound).. then I will happily PM the files through. I feel bad that I haven't yet donated to the team, but this way I may be in-directly donating to them :)

Follow this link to make a 10 Euro / USD donation (no Aussie Funny Money nfnovice, unless it's 20 bucks :),

Re: Compiling Dropbear for DM500 #19 dAF2000

  • PLi® Ex-Leden
  • 14,151 posts

+52
Good

Posted 6 February 2008 - 10:29

Had a brilliant idea over the last hour, if you can prove that you have made a donation to the PLi team (how does 10Euro sound).. then I will happily PM the files through. I feel bad that I haven't yet donated to the team, but this way I may be in-directly donating to them :)

Follow this link to make a 10 Euro / USD donation (no Aussie Funny Money nfnovice, unless it's 20 bucks :),

Well, I must admit it's kinda brilliant but we wouldn't want any money for our images or support. So, I think it's enough if the users just know there's a donation page, whether they donate or not. We will use all donations for internet server costs (which are quite high) and computer infrastructure (e.g. buildservers).

Re: Compiling Dropbear for DM500 #20 bartender

  • Senior Member
  • 207 posts

0
Neutral

Posted 6 February 2008 - 20:56

Well, I must admit it's kinda brilliant but we wouldn't want any money for our images or support. So, I think it's enough if the users just know there's a donation page, whether they donate or not. We will use all donations for internet server costs (which are quite high) and computer infrastructure (e.g. buildservers).


Well I was thinking of way of giving back to PLi as it's such a great image and a way that I can support the good work you are doing... whist encouraging others to do the same :) Hosting and internet charges are not cheap (let alone additional build servers, or trying supporting all the DM hardware models)... I applaud your work!


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users