Compiling Dropbear for DM500
#1
Posted 25 January 2008 - 03:42
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
Posted 25 January 2008 - 07:56
Re: Compiling Dropbear for DM500 #3
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
Posted 28 January 2008 - 08:56
Re: Compiling Dropbear for DM500 #5
Posted 29 January 2008 - 05:05
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
Re: Compiling Dropbear for DM500 #7
Posted 30 January 2008 - 18:44
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.
Re: Compiling Dropbear for DM500 #8
Posted 30 January 2008 - 19:13
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
Posted 30 January 2008 - 19:58
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
Re: Compiling Dropbear for DM500 #10
Posted 31 January 2008 - 10:33
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
Posted 3 February 2008 - 11:48
Attached Files
Re: Compiling Dropbear for DM500 #12
Posted 4 February 2008 - 02:22
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
Posted 4 February 2008 - 08:30
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).
Re: Compiling Dropbear for DM500 #14
Posted 5 February 2008 - 20:41
Could you plese supply them too? I used to have them my self before, but can't find them...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....
By the way, thanks for sharing!
Re: Compiling Dropbear for DM500 #15
Re: Compiling Dropbear for DM500 #16
Posted 6 February 2008 - 04:32
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
Re: Compiling Dropbear for DM500 #18
Posted 6 February 2008 - 06:52
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
Posted 6 February 2008 - 10:29
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).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 #20
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!
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users