Skip to main content

Lying to Get the Job Done: Adventures in setarch and export

It says something about the power and flexibility Linux when you are provided a means to lie in order to get an application to execute. And by this, I mean using the setarch command and a few other tricks to fool an application created for an older system so it will run on more modern system architectures.

I'm occupying myself trying to install some old games and so far, it has been challenging. In the heady turn-of-the-Millennium days, Linux installers were all the rage, promoted by Loki, a company the developed the Linux installers and produced Linux versions of then-popular games, but wound up in Chapter 7 bankruptcy. Even in the throes of  their demise they didn't forget the Linux gaming community and made their installers and the GPL source code available for the world to use. That would be great had not fewer and fewer servers carried the actual (now "old") files -- most of the links are dead -- and had not the development of Linux progressed so much. Many of their *.run installation scripts can be downloaded from the author, Icculus.

For example, Unreal Tournament 2003 was shipped with a Linux installer on disc 3, but it won't execute on a modern Linux. The installer itself is created with makeself which is still available, but
"Archives created with Makeself prior to v2.1.2 were using an old syntax for the head and tail Unix commands that is being progressively obsoleted in their GNU forms. Therefore you may have problems uncompressing some of these archives. A workaround for this is to set the environment variable $_POSIX2_VERSION to enable the old syntax, i.e. :
$ export _POSIX2_VERSION=199209 
 It is possible to launch the *.run file with useful arguments.
--help  displays the full list of arguments

--list lists the contents of the archive
--target extracts the contents of the                 archive to but does not install             anything
It's also possible to extract the archive, add files to it like special config files, updated binaries, add-ons and game data files, and recreate the *.run archive for your personal use.
So using that trick works and I can now list the contents of the .run file without a checksum error, but it won't install anything because of a glibc mismatch. 

That, however, can be fixed by invoking:
 $ export SETUP_LIBC=glibc-2.1
We're still not out of the woods because the installer checks the environment and, of course, balks at our powerful, modern 64-bit, kernel 4.x, multi-gigabyte RAM, multi-processor miracles of the modern age.

The fix for that is the setarch application. It deceives the application by feeding it bogus uname information. Note that it does not provide an actual environment, it just feeds information you can choose to the application so that it believes it is running in the appropriate environment.

If the application needs specific version of older libraries, you are still required to actually supply those. 

The setarch command deceives about linux32, linux64, i386, i486, i586, i686, athlon and x86_64 , can tell the app that we're running kernel 2.6, can deceive about the amount of available RAM available and other devious things. See the man page for more details.

Finally, I was able to use the old, obsolete, crusty installer on the CD by invoking
$ export _POSIX2_VERSION=199209 && export SETUP_LIBC=glibc-2.1. && linux32 ./linux_installer.run
I expect to have to use more deception to get the binaries to run. For example, to run Quake with sound, I had to create a wrapper script and execute SDL_AUDIODRIVER=dsp prior to executing the game binary.

If you run into these kinds of problems, now you can lie to your application of choice as well. It's all lies from now on.

RESOURCES



DRM-free games. Most run using WINE

Old games packaged for win32, but extractable for the data files; most run using WINE

Comments

Popular posts from this blog

DOS4GW.EXE Version 2.01a and Alternative DOS Extenders

DOS4GW.EXE The Tenberry DOS extender DOS4GW.EXE was used by many early DOS games. I still enjoy playing many of these games and DOS4GW.EXE is usable with DOSBox , so they can be played on Linux. However, the version of DOS4GW.EXE that was included with the game was whatever was current at the time. The most recent version that includes many bugfixes that possibly affected the games when used with DOSBox have been fixed in the latest version, 2.01a. It's not free at US$49, but you can downloaded it here . Simply substitute it for whatever version of DOS4GW.EXE your game provided and enjoy the bug-fixed goodness. Tenberry also makes a "high-performance" "pro" version of DOS4GW.EXE, but it costs $300. I think that they could sell quite a few of these to hobby users (since, you know, DOS is dead) for US$5. Open Souce to the Rescue There are better performing, free and Open Source alternatives available and worth a look. DPMI Explained Let's unders

Return to Castle Wolfenstein for Modern Linux

Return to Castle Wolfenstein is a first-person shooter originally released on November 19, 2001. The game, like many other classic games, is available at GOG.com and costs only US$5.99. iortcw for Linux Don't bother with old and crusty Linux binaries offered by idsoft; they are problematic and it's painful to use them on a modern Linux. Fortunately for us, there are more modern GPL-licensed Linux binaries available for 32- and 64-bit systems as well as high resolution textures packages. The project at GitHub provides source code that can also be compiled for MS Windows using MinGW. iortcw for Windows and Mac You can download pre-compiled binaries for 32- and 64-bit Linux, MS Windows and Mac from here . Let's put our files in /usr/local/games/rtcw . As root, extract the downloaded .ZIP file for your architecture to  /usr/local/games/rtcw . All we are missing are the game data files. I purchased them from GOG.com. The game installer downloaded from GOG.com can be

Unreal Tournament GOTY/UT99 for Modern Linux

Released on November 16, 1999, Unreal Tournament (also known as UT99) is an arena first-person shooter for Multiplayer on-line competition or you can play against bots off-line. It features several game types, with more details provided at Wikipedia . The game was re-released on February 25, 2000 as Unreal Tournament Game of the Year Edition (GOTY) which included the three bonus packs released previously and additional mods, or game modifiers that had become popular. It is the GOTY version that is available from STEAM or  GOG.com . The GOG version for Windows installs in Linux and plays well using WINE , PlayOnLinux or Codeweaver's Crossover . There is a Linux binary available in two versions, one for the original game and one for the GOTY edition . Also provided at that site is the Official Bonus Pack with a Linux installer. All these Linux installers are created with makeself . There are some issues using such a crusty old Linux binary. Let's see why getting a Lin