bootstrap for 213j

Questions about IPKG can go here!
Forum rules
We've moved! Head over to Synology Community (community.synology.com) to meet up with our team and other Synology enthusiasts!
burghy86
Trainee
Trainee
Posts: 18
Joined: Sat Mar 24, 2012 6:06 pm

Re: bootstrap for 213j

Unread post by burghy86 » Tue Dec 31, 2013 2:56 am

Hello everyone, I installed ipkg on my ds213j and I wanted to install irssi.

I installed screen, irssi and perl

when I give the command "irssi" or "screen irssi" I do not nothing happens, no errors, but not part of the package.

how can I fix it?

sorry for my english

stefangio
I'm New!
I'm New!
Posts: 4
Joined: Sat Dec 28, 2013 2:22 pm

Re: bootstrap for 213j

Unread post by stefangio » Tue Dec 31, 2013 9:21 am

burghy86 wrote:Hello everyone, I installed ipkg on my ds213j and I wanted to install irssi.

I installed screen, irssi and perl

when I give the command "irssi" or "screen irssi" I do not nothing happens, no errors, but not part of the package.

how can I fix it?

sorry for my english
Hi,
I don't know irssi but I had recentlly a problem with perl.
Do you have installed perl with ipkg.
Is perl running correctly ? If you do: perl -e "print 'ok' ", do you have an error message ?

Regards
DS213j

efroymson
I'm New!
I'm New!
Posts: 4
Joined: Sun Oct 13, 2013 5:14 am

Re: bootstrap for 213j

Unread post by efroymson » Mon Jan 06, 2014 7:01 pm

I'm also seeing the "VFP register argument" error, when trying to run:
/opt/bin/python2.5 setup.py install

as directed here:
http://www.synology-wiki.de/index.php/D ... y.com_nach
(German page).

It seems that the opt ware stuff works, as the binaries are compatible, but the gcc is not the right version, as it wasn't configured to build for the 370, which apparently has a hardware FPU. The 6281 doesn't have one, and that is where this page:
https://github.com/trepmag/ds213j-optware-bootstrap
sends you to get your binaries.

I tried to build a better version of gcc that would run on the 213j, but I couldn't do it, after a fair amount of effort. I got the cross-compiler working on a Linux box, but the configuration of gcc defeated me.

Perhaps someone else has had success and can share a proper gcc binary for the 213j?

Of course all I really want is to be able to AirPrint to my printers, which are currently not supported by DSM 4.3 (a Samsung ML2510 and an HP Photosmart 2610 (I mean I can print to them, but the AirPrint function is not available)).
rsc wrote:
arminus wrote:Same problem here.

I'm failing to compile sqlite3 for node. What I did was to cross-compile node on a regular Linux and installed it on the 213j, works fine.

An npm install sqlite then tries to build the module from source but fails with this error:

Code: Select all

/opt/lib/gcc/arm-none-linux-gnueabi/4.2.3/../../../../arm-none-linux-gnueabi/bin/ld: ERROR: /lib/libc.so.6 uses VFP register arguments, Release/obj.target/node_sqlite3.node does not
So I guess the question is with which register arguments libc.so.6 was actually compiled...

I tried various CFLAGS -mfloat-abi=hard/soft etc. no success. Some of them don't seem to be support by sqlite either (e.g. with -mfloat-abi=hard) sqlite complains:

Code: Select all

Release/obj/gen/sqlite-autoconf-3071700/sqlite3.c:1: sorry, unimplemented: -mfloat-abi=hard and VFP

Same problem here, looking forward for the solution....

burghy86
Trainee
Trainee
Posts: 18
Joined: Sat Mar 24, 2012 6:06 pm

Re: bootstrap for 213j

Unread post by burghy86 » Thu Jan 09, 2014 6:54 pm


Hi,
I don't know irssi but I had recentlly a problem with perl.
Do you have installed perl with ipkg.
Is perl running correctly ? If you do: perl -e "print 'ok' ", do you have an error message ?

Regards
i read this:
perl -e "print 'ok' "
your random numbers are not that random.

what is the problem?
how can I solve the problem of perl?

rsc
I'm New!
I'm New!
Posts: 2
Joined: Sun Dec 29, 2013 6:40 am

Re: bootstrap for 213j

Unread post by rsc » Fri Jan 10, 2014 10:10 am

HI efroymson.

Same here. I created a linux box and was able to cross compile the kernel, but when I tried to compile an open source project that I got from github I was not able to make it work (probably due to some misconfiguration of the required libraries).

Still waiting for a solution to use gcc on my ds213j.... Very much disappointed with Synology...

efroymson wrote:I'm also seeing the "VFP register argument" error, when trying to run:
/opt/bin/python2.5 setup.py install

as directed here:
http://www.synology-wiki.de/index.php/D ... y.com_nach
(German page).

It seems that the opt ware stuff works, as the binaries are compatible, but the gcc is not the right version, as it wasn't configured to build for the 370, which apparently has a hardware FPU. The 6281 doesn't have one, and that is where this page:
https://github.com/trepmag/ds213j-optware-bootstrap
sends you to get your binaries.

I tried to build a better version of gcc that would run on the 213j, but I couldn't do it, after a fair amount of effort. I got the cross-compiler working on a Linux box, but the configuration of gcc defeated me.

Perhaps someone else has had success and can share a proper gcc binary for the 213j?

Of course all I really want is to be able to AirPrint to my printers, which are currently not supported by DSM 4.3 (a Samsung ML2510 and an HP Photosmart 2610 (I mean I can print to them, but the AirPrint function is not available)).
rsc wrote:
arminus wrote:Same problem here.

I'm failing to compile sqlite3 for node. What I did was to cross-compile node on a regular Linux and installed it on the 213j, works fine.

An npm install sqlite then tries to build the module from source but fails with this error:

Code: Select all

/opt/lib/gcc/arm-none-linux-gnueabi/4.2.3/../../../../arm-none-linux-gnueabi/bin/ld: ERROR: /lib/libc.so.6 uses VFP register arguments, Release/obj.target/node_sqlite3.node does not
So I guess the question is with which register arguments libc.so.6 was actually compiled...

I tried various CFLAGS -mfloat-abi=hard/soft etc. no success. Some of them don't seem to be support by sqlite either (e.g. with -mfloat-abi=hard) sqlite complains:

Code: Select all

Release/obj/gen/sqlite-autoconf-3071700/sqlite3.c:1: sorry, unimplemented: -mfloat-abi=hard and VFP

Same problem here, looking forward for the solution....

alexkr
I'm New!
I'm New!
Posts: 4
Joined: Tue Sep 17, 2013 10:55 am

Re: bootstrap for 213j

Unread post by alexkr » Fri Jan 10, 2014 1:52 pm

Hello guys,
I was not able to get any help, but will share my workaround here =>

1) Download = > http://ukdl.synology.com/ftp/ds/usergui ... _Guide.pdf
2) install it on your linux machine (used Centos 5)
3) configure env variables
4) build the code for Armada ARM using cross compiling.

Able to build - ps3netsrv and genisoimage for my needs.

Regards,

vputz
Trainee
Trainee
Posts: 18
Joined: Fri Feb 14, 2014 4:12 pm

Re: bootstrap for 213j

Unread post by vputz » Fri Feb 14, 2014 4:35 pm

Thanks to alexkr!

With that link I was able to "make an optware bootstrap" setup and generate a few packages ("less" for testing, squid, and privoxy/squid3). Less, squid, and privoxy built without thinking twice; squid3 was hell on wheels and required manual intervention (and disabling authentication, which is fine for my network).

But it's worth noting that the existing squid and squid3 packages from the cs08q1armel feeds didn't work (squid gave an error parsing the conf and squid3 core dumped) and my packages both worked. So this seems like a good start at getting binary-compatible ipks!

The process for doing it was a little messy, and if I have time I'll try to duplicate/write it up (not the squid3 part though!) but it may be easier to just try and set up a feed if people want so everyone doesn't have to set up a linux cross-compilation environment... I really can't afford the time and space to maintain it long term, but I could certainly do a bunch of package builds for the ds213j and put them up somewhere, stressing the "unstable, not sure it will work for everyone" part.

But I was really glad to get squid running, so I'm game to do a bunch of builds for people if we can find a host; looks like you just need a directory people can wget from! Anyone with space?

vputz
Trainee
Trainee
Posts: 18
Joined: Fri Feb 14, 2014 4:12 pm

Re: bootstrap for 213j

Unread post by vputz » Sat Feb 15, 2014 1:48 am

Just as a followup--

Well, it's harder than I thought ;) Setting up a "feed" turns out to be really easy; we just need a WGET-able directory (I did it with a local directory and it works fine). But cross-compiling the packages isn't a straight shot... Perl took some doing and I couldn't get rrdtool to compile. Mediatomb seems to be working but SVN will take more work. In other words, it's more case-by-case than I thought rather than "just type make and walk away for a few hours."

So I'll try to post a howto for getting the environment working (probably Monday as next two days are busy) and if anyone has packages they really want to see done fast I can try to do those, but I'm heading out in a week for a three-week trip.

I freely admit this is a bit of a hack (I try to do the packages "right" but Perl for example I wound up directly copying a file to where it needed to be, which is a blatant hack), so if anyone actually knows what they're doing that is always preferable--I'm just glad that it seems to work as well as it does.

burghy86
Trainee
Trainee
Posts: 18
Joined: Sat Mar 24, 2012 6:06 pm

Re: bootstrap for 213j

Unread post by burghy86 » Mon Feb 17, 2014 3:46 pm

looking forward to your how to for proper installation of perl. thank you very much friend

marijnk
I'm New!
I'm New!
Posts: 5
Joined: Wed Jul 31, 2013 10:24 am

Re: bootstrap for 213j

Unread post by marijnk » Mon Feb 17, 2014 3:53 pm

Looking forward to instructions, would love to be able to compile lftp from http://lftp.yar.ru/

vputz
Trainee
Trainee
Posts: 18
Joined: Fri Feb 14, 2014 4:12 pm

Re: bootstrap for 213j

Unread post by vputz » Tue Feb 18, 2014 8:08 pm

lftp works! Had to modify the make script so it downloaded 4.4.15, and libgcrypt and libtasn1 had a collision so you had to "ipkg install --force-overwrite" one.

Writeup almost done, but I do think a feed is a better choice; getting some of these working is like pulling teeth if you haven't done this sort of thing before.

-->VPutz

vputz
Trainee
Trainee
Posts: 18
Joined: Fri Feb 14, 2014 4:12 pm

Re: bootstrap for 213j

Unread post by vputz » Tue Feb 18, 2014 8:24 pm

Okay, here we go! But I'll warn you you may not like it. You'll need a linux machine, and you're going to have to set up the full optware environment.

First, check out the optware tree.

Code: Select all

  svn co https://svn.nslu2-linux.org/svnroot/optware/trunk optware
But optware doesn't have a ds213j target! So we will have to make one. We know that the cs08q1armel feed works for us, so we'll start there.

Code: Select all

  cd optware/platforms
  cp toolchain-cs08q1armel.mk toolchain-ds213j.mk
And then make the following changes, by hand (the versions, etc are to match the file we're about to download, from the synology guide Alexkr posted). This is the "diff" I got between the old and knew files, so it should be obvious what to do to the new toolchain-ds213j.mk file:

Code: Select all

  3c3
  < GNU_TARGET_NAME = arm-none-linux-gnueabi
  ---
  > GNU_TARGET_NAME = arm-marvell-linux-gnueabi
  9c9
  < LIBSTDC++_VERSION=6.0.9
  ---
  > LIBSTDC++_VERSION=6.0.16
  32c32
  < TARGET_CROSS_TOP = $(BASE_DIR)/toolchain/arm-2008q1
  ---
  > TARGET_CROSS_TOP = $(BASE_DIR)/toolchain/arm-marvell-linux-gnueabi
  41,43c41,43
  < TOOLCHAIN_SITE=http://www.codesourcery.com/public/gnu_toolchain/arm-none-linux-gnueabi
  < TOOLCHAIN_BINARY=arm-2008q1-126-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2
  < TOOLCHAIN_SOURCE=arm-2008q1-126-arm-none-linux-gnueabi.src.tar.bz2
  ---
  > TOOLCHAIN_SITE=http://sourceforge.net/projects/dsgpl/files/DSM%204.3%20Tool%20Chains/Marvell%20armada%20370%20Linux%203.2.40/
  > TOOLCHAIN_BINARY=gcc464_glibc215_hard_armada-GPL.tgz
  > TOOLCHAIN_SOURCE=
  58c58
  < 	tar -xj -C $(BASE_DIR)/toolchain -f $(DL_DIR)/$(TOOLCHAIN_BINARY)
  ---
  > 	tar -xz -C $(BASE_DIR)/toolchain -f $(DL_DIR)/$(TOOLCHAIN_BINARY)
The last 3 lines are so we can retrieve the DSM tool chain that works with the DS213J.

We'll need to do the same, with the "packages" file

Code: Select all

  cp packages-cs08q1armel.mk packages-ds213j.mk
...but we don't need to change that, we can just copy it.

One more thing; we need to add our target to the script that checks the final packages

cd .. (should now be in your "optware" directory, not "optware/platforms"

now edit "scripts/optware-check-package.pl and add the following "patch"

Code: Select all

  77a78
  > 	"ds213j" => "32-bit LSB .* ARM",
You can add this anywhere in the appropriate section (I added it after the line '"cs08q1armel" => "32-bit LSB .* ARM",'

Now build our target directory!

Code: Select all

  make ds213j-target
We've made the directory structure we need... now we need to download that toolchain.

Code: Select all

  cd ds213j
  make toolchain
This should take some time (we're downloading about 74M).

Okay! We now have a platform and a compiler. Let's make something! "Which" is a good test case

Code: Select all

  make which
  make which-ipk
  make which-check
The first command downloads and compiles the sources; that's where your problems are going to be if there are any. The second command packages everything into a file, and the third just makes sure the files in the package were compiled with the correct compiler for your architecture.

Now you can make packages. But to make it more elegant, we want something more: we want to build a feed and index. So we have to make a "fake" xsh file for the build to work

Code: Select all

  touch builds/invalid.xsh
Now...

Code: Select all

  make index
  ls packages
The packages you have build should now be in the directory, along with the files "Packages" "Packages.filelist" and "Packages.gz" This directory is now a feed! You can rsync it to your ds213j (I put mine in "/volume1/media/ds213j") and then add the following line (it may have to be the only line) to /opt/etc/ipkg/feeds.conf (this assumes you've set up ipkg as in https://github.com/trepmag/ds213j-optware-bootstrap):

Code: Select all

  src cross file://volume1/media/ds213j
Then you should be able to "ipkg update" and "ipkg install which"

...painful and convoluted as this is, it works. I am now running squid, lftp, and others on my ds213j. But the process is pretty painful to get some packages to work (Perl was cryptic because a legitimate command was failing and I had to copy a file; squid3 was frustrating because cross-compilation tried tests that didn't work). But a lot of things do work, and that's a step forward.

We need a feed, though. That would really help. I can't figure out how to enable anonymous ftp access on my website, but maybe we can talk the nslu2 guys into giving us some space, though I'm not sure since I'm not "properly" making the packages in some cases and doing ad hoc hacks.

But hey, it's better than nothing!

marijnk
I'm New!
I'm New!
Posts: 5
Joined: Wed Jul 31, 2013 10:24 am

Re: bootstrap for 213j

Unread post by marijnk » Wed Feb 19, 2014 2:46 pm

Thanks for the instructions vputz! I finally managed to cross compile lftp with your help :D

For anyone else who isn't a linux expert but mainly for my own reference in case I want to update the lftp version in a couple of months this is how I proceeded:

I had to install Subversion / SVN first before going on to the optware.

Code: Select all

sudo apt-get install subversion 
Trying to install the optware from https it started complaining about missing client certificates. I tried setting up a certificate, but I couldn't get this to work (quickly enough). You can loose the s and it works:

Code: Select all

  svn co http://svn.nslu2-linux.org/svnroot/optware/trunk optware
Then I followed vputz's instructions:
vputz wrote:Okay, here we go! But I'll warn you you may not like it. You'll need a linux machine, and you're going to have to set up the full optware environment.

First, check out the optware tree.

Code: Select all

  svn co https://svn.nslu2-linux.org/svnroot/optware/trunk optware
But optware doesn't have a ds213j target! So we will have to make one. We know that the cs08q1armel feed works for us, so we'll start there.

Code: Select all

  cd optware/platforms
  cp toolchain-cs08q1armel.mk toolchain-ds213j.mk
And then make the following changes, by hand (the versions, etc are to match the file we're about to download, from the synology guide Alexkr posted). This is the "diff" I got between the old and knew files, so it should be obvious what to do to the new toolchain-ds213j.mk file:

Code: Select all

  3c3
  < GNU_TARGET_NAME = arm-none-linux-gnueabi
  ---
  > GNU_TARGET_NAME = arm-marvell-linux-gnueabi
  9c9
  < LIBSTDC++_VERSION=6.0.9
  ---
  > LIBSTDC++_VERSION=6.0.16
  32c32
  < TARGET_CROSS_TOP = $(BASE_DIR)/toolchain/arm-2008q1
  ---
  > TARGET_CROSS_TOP = $(BASE_DIR)/toolchain/arm-marvell-linux-gnueabi
  41,43c41,43
  < TOOLCHAIN_SITE=http://www.codesourcery.com/public/gnu_toolchain/arm-none-linux-gnueabi
  < TOOLCHAIN_BINARY=arm-2008q1-126-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2
  < TOOLCHAIN_SOURCE=arm-2008q1-126-arm-none-linux-gnueabi.src.tar.bz2
  ---
  > TOOLCHAIN_SITE=http://sourceforge.net/projects/dsgpl/files/DSM%204.3%20Tool%20Chains/Marvell%20armada%20370%20Linux%203.2.40/
  > TOOLCHAIN_BINARY=gcc464_glibc215_hard_armada-GPL.tgz
  > TOOLCHAIN_SOURCE=
  58c58
  < 	tar -xj -C $(BASE_DIR)/toolchain -f $(DL_DIR)/$(TOOLCHAIN_BINARY)
  ---
  > 	tar -xz -C $(BASE_DIR)/toolchain -f $(DL_DIR)/$(TOOLCHAIN_BINARY)
The last 3 lines are so we can retrieve the DSM tool chain that works with the DS213J.

We'll need to do the same, with the "packages" file

Code: Select all

  cp packages-cs08q1armel.mk packages-ds213j.mk
...but we don't need to change that, we can just copy it.

One more thing; we need to add our target to the script that checks the final packages

cd .. (should now be in your "optware" directory, not "optware/platforms"

now edit "scripts/optware-check-package.pl and add the following "patch"

Code: Select all

  77a78
  > 	"ds213j" => "32-bit LSB .* ARM",
You can add this anywhere in the appropriate section (I added it after the line '"cs08q1armel" => "32-bit LSB .* ARM",'

Now build our target directory!

Code: Select all

  make ds213j-target
We've made the directory structure we need... now we need to download that toolchain.

Code: Select all

  cd ds213j
  make toolchain
This should take some time (we're downloading about 74M).

Okay! We now have a platform and a compiler. Let's make something! "Which" is a good test case

Code: Select all

  make which
  make which-ipk
  make which-check
The first command downloads and compiles the sources; that's where your problems are going to be if there are any. The second command packages everything into a file, and the third just makes sure the files in the package were compiled with the correct compiler for your architecture.

Now you can make packages. But to make it more elegant, we want something more: we want to build a feed and index. So we have to make a "fake" xsh file for the build to work

Code: Select all

  touch builds/invalid.xsh
Now...

Code: Select all

  make index
  ls packages
The packages you have build should now be in the directory, along with the files "Packages" "Packages.filelist" and "Packages.gz" This directory is now a feed! You can rsync it to your ds213j (I put mine in "/volume1/media/ds213j") and then add the following line (it may have to be the only line) to /opt/etc/ipkg/feeds.conf (this assumes you've set up ipkg as in https://github.com/trepmag/ds213j-optware-bootstrap):

Code: Select all

  src cross file://volume1/media/ds213j
Then you should be able to "ipkg update" and "ipkg install which"

...painful and convoluted as this is, it works. I am now running squid, lftp, and others on my ds213j. But the process is pretty painful to get some packages to work (Perl was cryptic because a legitimate command was failing and I had to copy a file; squid3 was frustrating because cross-compilation tried tests that didn't work). But a lot of things do work, and that's a step forward.

We need a feed, though. That would really help. I can't figure out how to enable anonymous ftp access on my website, but maybe we can talk the nslu2 guys into giving us some space, though I'm not sure since I'm not "properly" making the packages in some cases and doing ad hoc hacks.

But hey, it's better than nothing!
To install the latest version of LFTP:
Edit the makefile on your cross compile box and change the version number: ~/optware/ds213j/make/lftp.mk

Code: Select all

< LFTP_VERSION=4.4.0
> LFTP_VERSION=4.5.0
Download http://lftp.yar.ru/get.html and save in /home/username/optware/ds213j/downloads/lftp-4.5.0.tar.gz

Make, ipk and check:

Code: Select all

cd ~/optware/ds213j/
make lftp
make lftp-ipk
make lftp-check
If you haven't followed vputz's instructions for which run

Code: Select all

touch builds/invalid.xsh
(Re)make the index

Code: Select all

make index
Copy files from package to DS213j.

On your DS213j run:

Code: Select all

ipkg update
ipkg install lftp
I got all excited until trying to run lftp gave the error:

Code: Select all

lftp: libstdc++.so.6: version `CXXABI_ARM_1.3.3' not found (required by lftp)
I ended up fixing this by copying the lib from the linux box /optware/ds213j/builds/libstdc++/libstdc++.so.6.0.16 to /opt/lib/libstdc++.so.6.0.16 on my DS213j.

My DS213j had two symbolic links in /opt/lib that needed updating too. Make sure you are in /opt/lib

Code: Select all

 ln -f -s libstdc++.so.6.0.16 libstdc++.so.6
 ln -f -s libstdc++.so.6.0.16 libstdc++.so
lftp --version now shows: Version 4.4.15.

Happy days!
Last edited by marijnk on Fri May 23, 2014 1:05 pm, edited 1 time in total.

burghy86
Trainee
Trainee
Posts: 18
Joined: Sat Mar 24, 2012 6:06 pm

Re: bootstrap for 213j

Unread post by burghy86 » Wed Feb 19, 2014 3:39 pm

for a perl and a problem for the number random, any solution?

vputz
Trainee
Trainee
Posts: 18
Joined: Fri Feb 14, 2014 4:12 pm

Re: bootstrap for 213j

Unread post by vputz » Wed Feb 19, 2014 7:37 pm

Marijnk (and others)--

Glad it worked--and addendum to the above! It's not obvious, but when you build a package, the build system seems to bring in the other packages... and build the relevant files... but it won't automatically build the .ipk files. So you might have been able to "build libstdc++-ipk" and get that one too (some packages wouldn't install because of dependencies so I had to build extra ipks).

Burghy86: I built a perl ipk, maybe I can find a way to upload it somewhere... what was the random problem again?

Locked

Return to “IPKG”