protonscr

Make run_steam.sh distribution agnostic

steamclosed reviewedNot a bugnot reproducible
ValveSoftware/steam-for-linux#400 · opened 2012-12-26 by schrotthaufen · updated 2013-01-03 · 13 comments · github
Sschrotthaufen 2012-12-26 github

run_steam.sh uses the arch command to determine the host OS architecture. Not all Linux distributions ship it. I'm not even sure if it's not just an alias to uname -m that Canonical included in Ubuntu.
Therefore uname -m should be used.

Aancow 2012-12-26 github

It's not an alias:

> which arch
/usr/bin/arch
> less /usr/bin/arch
"/usr/bin/arch" may be a binary file.  See it anyway?
> file /usr/bin/arch
/usr/bin/arch: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.26, BuildID[sha1]=0x6e18ef189d1ab6ece5f70c2dfa8dbd5c302a5052, stripped

Note that this is on debian testing, not ubuntu. Doesn't make your point any less valid, though.

NNecoro 2012-12-26 github

/usr/bin/arch is part of coreutils and was introduced there with version 6.9.90 (Dec 2007). So if your distribution ships with a coreutils version older than that, you probably also have other issues running steam.

http://www.gnu.org/software/coreutils/manual/html_node/arch-invocation.html

FFreso 2012-12-26 github

Then either arch was removed again from upstream, or Arch Linux is for some reason filtering it out:

freso@kotake> pacman -Ql coreutils|grep arch
[1] freso@kotake> pacman -Qi coreutils|grep -i version
Version        : 8.20-1
Ffalconindy 2012-12-26 github

Arch Linux used to take the arch binary from util-linux, not coreutils. As of recently, both coreutils and util-linux both will not build the arch tool by default. When this happened, Arch Linux stopped shipping the arch binary. uname -m is definitely preferred here.

SSalamek 2012-12-27 github

+1 for uname -m

Lltsavar 2012-12-27 github

+1 for uname -m

Jjohnv-valve maintainer 2013-01-01 github

Which script are you seeing this in? The only place I see we are using 'arch' is in an OSX-only branch.

Sschrotthaufen 2013-01-01 github
find .local/share/Steam/SteamApps/common/ -name run_steam.sh -exec grep arch {} +
.local/share/Steam/SteamApps/common/Uplink/run_steam.sh:if [ `arch` == "x86_64" ]; then
.local/share/Steam/SteamApps/common/Amnesia The Dark Descent/run_steam.sh:if [ `arch` == "x86_64" ]; then
FFreso 2013-01-01 github
freso@kotake> grep --recursive '`arch`' .local/share/Steam
.local/share/Steam/steam.sh:   ARCH=`arch`

@schrotthaufen Those two instances are inside game packages and are really outside Steam/Valve's reach, though they should still be updated. :)

Sschrotthaufen 2013-01-01 github

I am aware that those files are outside Valve's responsibility, but they surely have a template they give out to 3rd party developers, right?
By changing said template (if it in fact exists) this issue could be avoided in the future.

Jjohnv-valve maintainer 2013-01-02 github

@schrotthaufen - we don't have such a template - can you make a new issue specific to Amnesia for that one
@Freso - if you look at the script you'll see that's OSX-specific and should not affect Linux in any way

Lltsavar 2013-01-02 github

I've got the same problem with an other game:

Game update: AppID 215160 "The Book of Unwritten Tales", ProcID 2625, IP 0.0.0.0:0
/home/savar/.local/share/Steam/steamapps/common/The Book of Unwritten Tales/bout.sh: Zeile 9: arch: Kommando nicht gefunden.
/home/savar/.local/share/Steam/steamapps/common/The Book of Unwritten Tales/bout.sh: Zeile 11: [: ==: Einstelliger (unärer) Operator erwartet.
/home/savar/.local/share/Steam/steamapps/common/The Book of Unwritten Tales/bout.sh: Zeile 17: [: ==: Einstelliger (unärer) Operator erwartet.

Don't know if there are guidelines for 3rd Party Games. But if so maybe you could add to use uname rather than arch...

Eekohl 2013-01-03 github

@ltsavar those line 11 and 17 sound like a bashisms. Are you using dash or some other shell than bash for /bin/sh by any chance? Probably best to open separate issues.

Nothing extracted yet.