Optware / Optware-ng

279 stars 52 forks source link

PowerPC e500v2 #41

Closed mrizzato closed 8 years ago

mrizzato commented 8 years ago

Will the PPC e500v2 platform ever be supported?

alllexx88 commented 8 years ago

It's quite doable, we already have PowerPC 603e, porting to e500v2 shouldn't be very different. I'll look into it, it's a matter of free time. But don't ask for ETAs please :-)

alllexx88 commented 8 years ago

@mrizzato PowerPC e500v2 feed added: http://ipkg.nslu2-linux.org/optware-ng/ct-ng-ppc-e500v2/Packages.html. It was harder than I anticipated :-)

Refer to the README for bootstrapping instructions.

Since I don't own a compatible device, it'd be good if you could test this feed.

mrizzato commented 8 years ago

That's great news!! Thanks a lot! I will gladly test it on my Synology DS213+. I have though a couple of questions:

  1. I have the old optware installed: what shall I do with that? Uninstall?
  2. Can I follow the instructions on the github page to install, or are there special installtion instructions?
alllexx88 commented 8 years ago

I'd do this with the old optware install:

  1. Stop all running optware processes
  2. Backup /opt content
  3. Clear /opt/*
  4. Run the bootstrap script: wget -O - http://ipkg.nslu2-linux.org/optware-ng/bootstrap/ct-ng-ppc-e500v2-bootstrap.sh | sh

Waiting for the test report, thanks :-)

mrizzato commented 8 years ago

Ok, thank you for the hints. I will have to allocate some time to this task. It probably will take some time to get back to you, but I will do it.

steef84 commented 8 years ago

Ok i tried this. I cleared /opt, ran the script. Got this result. Latest DSM6 on DS213+ image

alllexx88 commented 8 years ago

@steef84 What's the output of uname -a? Looks like the kernel headers I used for toolchain are too new. If that's the case, rebuilding the feed with older headers should fix this.

steef84 commented 8 years ago

@alllexx88 root@diskstation:~# uname -a Linux diskstation 2.6.32.12 #7321 SMP Wed Mar 23 11:46:05 CST 2016 ppc GNU/Linux synology_qoriq_213+

mrizzato commented 8 years ago

This is what I get on my NAS DS213+ with DSM 5.2-5644 Update 5 :

uname -a Linux DiskStation 2.6.32.12 #5644 SMP Wed Jan 20 22:40:33 CST 2016 ppc GNU/Linux

alllexx88 commented 8 years ago

@steef84 @mrizzato Now it's all clear. I've built the feed with 3.2.66 kernel headers, just like the I686 feed, falsely assuming that Synology uses similar setup on all currently maintained devices. Funny that they use such old kernels for e500v2. OK, I'll try to rebuild with 2.6.32 kernel headers.

alllexx88 commented 8 years ago

@steef84 @mrizzato feed rebuilt with 2.6.32 kernel headers: please test.

steef84 commented 8 years ago

Still same errors for me.... Kernel to old errors.. Segmentation faults. Assuming link wget -O - http://ipkg.nslu2-linux.org/optware-ng/bootstrap/ct-ng-ppc-e500v2-bootstrap.sh | sh is still correct

alllexx88 commented 8 years ago

@steef84 forgot to mention: please run rm -f /tmp/*.ipk, and only then try the bootstrap script again. Otherwise it uses the previously downloaded ipk. Should probably fix this bug in bootstrap scripts

steef84 commented 8 years ago

@alllexx88 that appears to do the trick. IPKG working and packages seems to install properly for me

alllexx88 commented 8 years ago

@steef84 That's great news, thanks!

@steef84 @mrizzato I have a favour to ask of you now. Can you please test BubbleUPnP Server (see here) so that the dev can add PowerPC e500v2 to the Optware-ng archs list? Thanks in advance

steef84 commented 8 years ago

Did install it, but webif doensn't seem to response. No errors while BubbleUPnP started. Will dive into it when got some spare time

alllexx88 commented 8 years ago

@steef84 The Server is launched in the background, so it doesn't print any errors to stderr/stdout -- see /opt/share/bubbleupnpserver/BubbleUPnPServer.log.0 for errors instead. Also, did you try to wait a minute or two: it may require some time to initialize? Thanks

steef84 commented 8 years ago

No logs are created, and the browser throws this error. image. When stopping the package terminal spits out this error, so it seems package wont start properly

image

alllexx88 commented 8 years ago

@steef84 Looks like there's something wrong with java. What's the output of /opt/lib/jvm/openjdk7/jre/bin/java -version? And if it's OK, please try to launch the server manually:

cd /opt/share/bubbleupnpserver
/opt/lib/jvm/openjdk7/jre/bin/java -Djava.awt.headless=true -Djava.net.preferIPv4Stack=true -Dfile.encoding="UTF-8" -jar BubbleUPnPServerLauncher.jar

Thanks!

steef84 commented 8 years ago

Java seems to be faulty:

image

alllexx88 commented 8 years ago

@steef84 glibc-opt package was missing libgcc.so.1, and therefore the firmware lib was being loaded, leading to this error. This is now fixed, please run ipkg update; ipkg upgrade and try again. Thanks!

steef84 commented 8 years ago

Seems to work now: webif is available and working. Is there any ios app for iphone?

alllexx88 commented 8 years ago

@steef84 That's great news, thanks!

There's no BubbleUPnP app for iOS, however there're some alternatives that're compatible with BubbleUPnP Server: see here, for example

I think we can close the issue now

mrizzato commented 8 years ago

After long time I have installed and tested the package. Everything worked smoothly, except that when I log on to the DS and use bash, it complains about the locale setting: -bash: warning: setlocale: LC_ALL: cannot change locale (en_US.utf8): No such file or directory

alllexx88 commented 8 years ago

@mrizzato Thanks for the report. I can't reproduce the bash error, it works for me on an i686 Synology:

DiskStation> LC_ALL=en_US.utf8 /opt/bin/bash
bash-4.3#

Also, it gives a different warning on a wrong locale:

DiskStation> LC_ALL=en_US.utf9 /opt/bin/bash
bash: warning: setlocale: LC_ALL: cannot change locale (en_US.utf9)
bash-4.3#

Try to install glibc-locale package: maybe, feed bootstrap wasn't done completely (the bootstrap script installs this package, and after the standard locales are generated, removes it)

If it doesn't help, what's the content of log.txt after this command?

LC_ALL=en_US.utf8 strace /opt/bin/bash -c ':' &> log.txt

(this assumes you have strace: ipkg install strace)

mrizzato commented 8 years ago

Find attached the log file. It seems to me that it is looking for locale files in /opt/lib/locale/en/, but /opt/lib/locale is empty, and the listing of installed files for glibc-locale gives completely different location, something like /opt/share/i18n/locales/... (see the other attachment) .

log.txt glibc-locale_installedfiles.txt

alllexx88 commented 8 years ago

Hmm, it's missing /opt/lib/locale/locale-archive, which should've been auto generated during first glibc-locale install. It's generated by the postinst script:

#!/bin/sh

if [ ! -f /opt/lib/locale/locale-archive ] || [ ! -f /opt/lib/locale/.locale_generated ]; then

    rm -f /opt/lib/locale/.locale_generated /opt/lib/locale/locale-archive

    echo -n "Generating locale-archive with default locales ... "

    mkdir -p /opt/lib/locale

    /opt/bin/localedef -i cs_CZ -f UTF-8 cs_CZ.UTF-8
    /opt/bin/localedef -i de_DE -f ISO-8859-1 de_DE
    /opt/bin/localedef -i de_DE@euro -f ISO-8859-15 de_DE@euro
    /opt/bin/localedef -i de_DE -f UTF-8 de_DE.UTF-8
    /opt/bin/localedef -i en_GB -f UTF-8 en_GB.UTF-8
    /opt/bin/localedef -i en_HK -f ISO-8859-1 en_HK
    /opt/bin/localedef -i en_PH -f ISO-8859-1 en_PH
    /opt/bin/localedef -i en_US -f ISO-8859-1 en_US
    /opt/bin/localedef -i en_US -f UTF-8 en_US.UTF-8
    /opt/bin/localedef -i es_MX -f ISO-8859-1 es_MX
    /opt/bin/localedef -i fa_IR -f UTF-8 fa_IR
    /opt/bin/localedef -i fr_FR -f ISO-8859-1 fr_FR
    /opt/bin/localedef -i fr_FR@euro -f ISO-8859-15 fr_FR@euro
    /opt/bin/localedef -i fr_FR -f UTF-8 fr_FR.UTF-8
    /opt/bin/localedef -i it_IT -f ISO-8859-1 it_IT
    /opt/bin/localedef -i it_IT -f UTF-8 it_IT.UTF-8
    /opt/bin/localedef -i ja_JP -f EUC-JP ja_JP
    /opt/bin/localedef -i ru_RU -f KOI8-R ru_RU.KOI8-R
    /opt/bin/localedef -i ru_RU -f UTF-8 ru_RU.UTF-8
    /opt/bin/localedef -i tr_TR -f UTF-8 tr_TR.UTF-8
    /opt/bin/localedef -i zh_CN -f GB18030 zh_CN.GB18030

    touch /opt/lib/locale/.locale_generated

    echo "Done"

fi

Looks like /opt/bin/localedef is failing for some reason. What's the output of this:

mkdir -p /opt/lib/locale
/opt/bin/localedef -i en_US -f UTF-8 en_US.UTF-8
mrizzato commented 8 years ago

No output at all, and the folder /opt/lib/locale is empty

alllexx88 commented 8 years ago

@mrizzato I've added locale-archive package with pre-built /opt/lib/locale-archive. Simply run ipkg update; ipkg install locale-archive, and it should be good.

Not sure how to debug localedef, what's the output of strace /opt/bin/localedef -i en_US -f UTF-8 en_US.UTF-8?

mrizzato commented 8 years ago

Unfortunately, no change... find attached the strace dump. log1.txt

alllexx88 commented 8 years ago

@mrizzato This explains what goes wrong: localedef opens /usr/lib/locale/locale-archive for writing instead of /opt/lib/locale/locale-archive, as it should. I'll have to look closer at patches that should've fixed this to see what might be wrong. For now, please use locale-archive package: it installs a pre-built /opt/lib/locale-archive: it doesn't fix localedef, but should fix tje locale issue. Let's remove glibc-locale and reinstall it, then test bash:

ipkg remove glibc-locale
ipkg -force-reinstall install locale-archive
LC_ALL=en_US.utf8 /opt/bin/bash
mrizzato commented 8 years ago

Again... -bash: warning: setlocale: LC_ALL: cannot change locale (en_US.utf8): No such file or directory

alllexx88 commented 8 years ago

@mrizzato Thought it was complaining on missing /opt/lib/locale/locale-archive, but it's provided by locale-archive package. Is it missing something else? What's the output of LC_ALL=en_US.utf8 strace /opt/bin/bash -c ':' again, please

alllexx88 commented 8 years ago

I looked at strace output on i686 where everything works fine, and figured out that probably you're missing gconv-modules. I've added it to locale-archive dependencies: run ipkg update; ipkg install locale-archive to upgrade it

alllexx88 commented 8 years ago

Hmm, I tried removing gconv-modules on i686, and it didn't break locales on bash. Then again, there're no open() calls from strace on i686, apart from libdl.so.2, libc.so.6, /opt/lib/locale/locale-archive, /opt/lib/gconv/gconv-modules.cache and /opt/lib/gconv/gconv-modules. So, if gconv-modules don't help, please post LC_ALL=en_US.utf8 strace /opt/bin/bash -c ':' output again

mrizzato commented 8 years ago

when I run LC_ALL=en_US.utf8 strace /opt/bin/bash -c

I get the warning again (-bash: warning: setlocale: LC_ALL: cannot change locale (en_US.utf8)

Attached the log.

log3.txt

I have a stupid question. When I run the command

type locale

I get

/bin/locale,

not

/opt/bin/locale

, which I would expect.

Can it be that I have a PATH issue?

mrizzato commented 8 years ago

When I type

/bin/locale

I get the following:

LANG=en_US.utf8 LC_CTYPE="en_US.utf8" LC_NUMERIC="en_US.utf8" LC_TIME="en_US.utf8" LC_COLLATE="en_US.utf8" LC_MONETARY="en_US.utf8" LC_MESSAGES="en_US.utf8" LC_PAPER="en_US.utf8" LC_NAME="en_US.utf8" LC_ADDRESS="en_US.utf8" LC_TELEPHONE="en_US.utf8" LC_MEASUREMENT="en_US.utf8" LC_IDENTIFICATION="en_US.utf8" LC_ALL=en_US.utf8

with no warnings

Weh I type

/opt/bin/locale

I get the fllowing:

/opt/bin/locale: Cannot set LC_CTYPE to default locale: No such file or directory /opt/bin/locale: Cannot set LC_MESSAGES to default locale: No such file or directory /opt/bin/locale: Cannot set LC_ALL to default locale: No such file or directory LANG=en_US.utf8 LC_CTYPE="en_US.utf8" LC_NUMERIC="en_US.utf8" LC_TIME="en_US.utf8" LC_COLLATE="en_US.utf8" LC_MONETARY="en_US.utf8" LC_MESSAGES="en_US.utf8" LC_PAPER="en_US.utf8" LC_NAME="en_US.utf8" LC_ADDRESS="en_US.utf8" LC_TELEPHONE="en_US.utf8" LC_MEASUREMENT="en_US.utf8" LC_IDENTIFICATION="en_US.utf8" LC_ALL=en_US.utf8

alllexx88 commented 8 years ago

@mrizzato I don't quite get it now: the log3.txt has no trace of the warning: the only write() was /opt/bin/bash: -c: option requires an argument", 31-c: option requires an argument. Yet you say that you do have the warning.

alllexx88 commented 8 years ago

@mrizzato Ah, I get it: you typed it wrong and forgot the ':' part. Please give the output of a proper command: strace /opt/bin/bash -c ':'

alllexx88 commented 8 years ago

@mrizzato I just checked, and looks like fixing glibc-locale package is just a matter of repackaging. locale-archive package may be broken, since the locale-archive file can be glibc version sensitive, so the way I used to generate it is no good. Please run: ipkg remove locale-archive; ipkg update; ipkg install glibc-locale

mrizzato commented 8 years ago

Bingo!! It's fixed!! Thanks a lot!!

alllexx88 commented 8 years ago

@mrizzato Great, glad to know it's OK now :smiley: I recently patched the toolchains to change glibc prefix from /usr to /opt, so maybe this is what helped. I used a glibc locale patch I borrowed from Entware to make glibc use /opt/lib/locale instead of /usr/lib/locale, and it worked fine for other glibc targets on glibc 2.2[01]. Perhaps, it doesn't fully work with glibc 2.23, so it's another good reason to change glibc prefix.