Archived

This topic is now archived and is closed to further replies.

Please be aware that the content of this thread may be outdated and no longer applicable.

leeter

Solution: Linux Version Won't Start/ No Sound

Recommended Posts

leeter    0

Maybe this will help some of you.

 

I downloaded the non-steam version of the Humble Bundle and it didn't even start.

 

First what i did was to give full permissions for ninja-bin64 file (chmod). If you need to use the ninja-bin32 file then change the permissions for this one.

 

After that i recognized the code in the ninja-bin file didn't work properly. If i started the game with ninja-bin i had no sound because it chose ninja-bin32 instead of the 64 version.

 

Therefore i changed two lines in ninja-bin. If you write 64 instead of 32 it is forced to use the 64bit version. Of course there is a more elegant way but unfortunately i just have really no skills in script coding.

 

Have a nice day :-)

Share this post


Link to post
Share on other sites
smls    1

Yeah, you do need to manually give executable permissions to ninja-bin and ninja-bin64.

However, your second problem - that ninja-bin would select the wrong binary for you - seems very strange.

 

What's the console output of the following command on your system?

uname -m

(It should be either i686 or x86_64; that's how the script decides which binary to select.)

Share this post


Link to post
Share on other sites
leeter    0

The output is x86_64. 

 

Maybe the error is my fault. If i open ninja-bin with 'sh ninja-bin' i get this error: ninja-bin: 5: [: x86_64: unexpected operator

and the wrong file is chosen.

 

If i open it with './ninja-bin' then there's no error in the terminal.

Share this post


Link to post
Share on other sites
smls    1

It should be run as ./ninja-bin (without sh).

 

As for the wrong file being chosen, does it still do that if you double the brackets?

I.e. replace [ with [[, and replace ] with ]]? So that line 5 reads:

if [[ `uname -m` == x86_64 ]] ; then

Share this post


Link to post
Share on other sites
leeter    0

Thanks, i didn't know that.

 

I just found out that if i open with ./ninja-bin it just works fine with the original unchanged file.

 

Only with 'sh' it doesn't work properly even if i use the double brackets.

 

I didn't know that you don't open this files without 'sh' so this is my fault  :oops:

Share this post


Link to post
Share on other sites
smls    1

I didn't know that you don't open this files without 'sh'

 

Some background info if you're interested:

 

On many modern Linux distributions like Ubuntu, sh is a slightly faster but more limited version of bash.

 

If a script starts with !#/bin/sh then that means it is compatible with sh, and if you want you can explicitly run it with:

sh scriptname

But if the script starts with something else (e.g. !#/bin/bash or !#/bin/perl), that's an indication that sh probably can't run it properly, and it should be run with whatever that line says (e.g. bash).

 

The most fool-proof thing to do is to always execute scripts directly (in the same way as binary programs):

./scriptname

In that case the script will automatically be run using whatever the !#/bin/... line at the top of the script says.

The only "disadvantage" of this method is that you need to give the file executable permission (chmod +x) first.

Share this post


Link to post
Share on other sites
leeter    0

Good  :joyous:

 

I'm glad there are persons like you who have the patience to explain such things to Linux noobs like me :)

 

I'm using Ubuntu for a month now so there are many things i don't know. Nevertheless i hope this can help some other people too.

Share this post


Link to post
Share on other sites