For direct access use https://forums.oldunreal.com
It's been quite a while since oldunreal had an overhaul, but we are moving to another server which require some updates and changes. The biggest change is the migration of our old reliable YaBB forum to phpBB. This system expects you to login with your username and old password known from YaBB.
If you experience any problems there is also the usual "password forgotten" function. Don't forget to clear your browser cache!
If you have any further concerns feel free to contact me: Smirftsch@oldunreal.com

Script for compatibility with FHS?

for Unreal & UnrealTournament
User avatar
GreatEmerald
OldUnreal Member
Posts: 5347
Joined: Mon May 21, 2007 2:30 pm

Script for compatibility with FHS?

Post by GreatEmerald »

I think there was a discussion about this somewhere, but I can't seem to find it right now... But anyway, given all the legal issues, since we still have to use Wine to install things, it would be nice to actually have a tool that would automatically configure the game, after it's been installed correctly via Wine, to both launch without much effort and be compliant with the Filesystem Hierarchy Standard. I read about that not a long while ago, and it's quite fascinating (and practical, too).

Essentially, all well-written software on Linux follow the FHS. That means, all of the binaries go to /usr/bin (it's not an essential Linux program (those go to /bin), and it's not for testing (those go to /usr/local/bin), and it doesn't require root privileges (those go to /sbin, /usr/sbin and /usr/local/sbin) ), all of the libraries go to /usr/lib, all other read-only data goes to /usr/share, and all the configuration goes to ~/.config directory, with the menu shortcut going to /usr/share/applications directory.

The idea of FHS is pretty simple and effective - the / partition is read- and sometimes execute-only for regular users, while /home is fully read-write. / holds all of the important system files, and /home holds all of the user-specific files and configuration. That way two birds are being hit with one stone - for one, this scheme prevents any malicious attacks, since changing anything vital is limited to the root account, which is password-protected. And for two, when you reinstall the OS, you can overwrite your / partition, and keep your /home partition intact, thus saving all of your configuration between installs in a clean and efficient manner.

Making it work with Unreal would not be very difficult, either. Have a script move all of the Linux-specific files (so omit the EXE files and such) to /usr/share/unreal, and then symlink/create a launch script for UnrealLinux.bin in /usr/bin. Then change the Paths in UnrealLinux.ini (or make a few more symlinks) to include ~/.config/unreal, and put UnrealLinux.ini and User.ini there. Also create a few more Paths to something like ~/Unreal (it has to be somewhere in /home, but it's not defined exactly where) where people could store their installed mods, so that they would be preserved between installations. Lastly, add a preconfigured .desktop file to /usr/share/applications. And there you go - you have Unreal that is compliant with the FHS, which means more security, less clutter, ability to reinstall the game without losing anything (including mods), ability to launch the game from anywhere with a single command, having the game listed in the system menu, and any other tweaks an install script can do (like check for dependencies).

Any thoughts about that? And perhaps someone would be willing to create such a script?
Last edited by GreatEmerald on Fri Jan 13, 2012 10:31 pm, edited 1 time in total.
User avatar
Marzanna
OldUnreal Member
Posts: 446
Joined: Fri Feb 15, 2008 5:47 pm

Re: Script for compatibility with FHS?

Post by Marzanna »

I have unfinished installer for 227g (to lazy to make new for 227h, because it's quite easy to install using wine). It's intended to install game where you want, install additional patches, optional tools/mods, add symlink to start script and ucc.
Support for user mods and configs should be implemented in engine itself (even for [ch1064]indows), you can find my suggestions to 227 to support user configs.
Last edited by Guest on Sat Jan 14, 2012 6:12 pm, edited 1 time in total.
User avatar
GreatEmerald
OldUnreal Member
Posts: 5347
Joined: Mon May 21, 2007 2:30 pm

Re: Script for compatibility with FHS?

Post by GreatEmerald »

I'm trying to set up the system manually so far, and I wonder how I can make my bash script for running the executable neater. Right now, it's a basic script:

Code: Select all

#!/bin/bash
cd /usr/share/unreal/System
./UnrealLinux.bin $@
UnrealLinux.bin requires you to run it from the System directory, so the cd is mandatory. However, that leaves the terminal you run the game from in the System directory after you exit the game, and thus after you exit the game, you have to manually cd to where you launched the script from originally. Is there a way for the script to get the original location the script was called from? That way it could cd back automatically.

By the way, I love the flexibility of bash. This command came in handy:

Code: Select all

for file in *.ini; do mv $file /home/user/.config/unreal/System/; ln -s /home/user/.config/unreal/System/$file; done
[edit]Or, uh, it exits gracefully and in the same directory as I started off after all?.. Well, colour me confused. Does that start a new bash instance or something, then?[/edit]
Last edited by GreatEmerald on Sun Jan 15, 2012 8:31 pm, edited 1 time in total.
User avatar
Marzanna
OldUnreal Member
Posts: 446
Joined: Fri Feb 15, 2008 5:47 pm

Re: Script for compatibility with FHS?

Post by Marzanna »

First of all, it is better to use Loki's launch scripts for Unreal/UT, IMHO.
To return to previous directory save current location with pwd command or $PWD before launching game.
Does that start a new bash instance or something, then?
You are right.

I have an idea to make Unreal use $HOME for storing configs and stuff. Simple program can hook syscalls and check if certain file, that Unreal tries to open, exists in ~/ or not. If yes, it makes Unreal to use that file instead of original one.
Last edited by Guest on Mon Jan 16, 2012 10:07 am, edited 1 time in total.
User avatar
GreatEmerald
OldUnreal Member
Posts: 5347
Joined: Mon May 21, 2007 2:30 pm

Re: Script for compatibility with FHS?

Post by GreatEmerald »

What do their scripts offer that my simple one doesn't?

And so far my system with symlinks is working surprisingly well. I have all configuration settings in ~/.config/unreal/System and, by using the full path, set Paths to include ~/.config/unreal/Maps as an additional map source.

The only thing that I couldn't get to work is setting up the desktop file for Unreal using the binary. If I set the desktop file like this, it works perfectly:

Code: Select all

[Desktop Entry]
Comment[lt]=
Comment=
Exec=UnrealLinux
GenericName[lt]=Pirmojo asmens šaudykl[ch279]
GenericName=First person shooter
Icon=/usr/share/unreal/Help/Unreal.xpm
MimeType=
Name[lt]=Unreal
Name=Unreal
Path=/usr/bin
StartupNotify=true
Terminal=false
TerminalOptions=
Type=Application
X-DBUS-ServiceName=
X-DBUS-StartupType=
X-KDE-SubstituteUID=false
X-KDE-Username=
X-SuSE-translate=true
Categories=Game;ActionGame;
But if I set it to use UnrealLinux.bin itself, and set the path to /usr/share/unreal/System, it just crashes for some reason (complains about not finding Engine.u). Ah well...

I have to say, 227h works perfectly on Linux now. It launched correctly the first time I attempted to launch it (had to install two required packages first, but that's all) and runs with no audio or video problems whatsoever. Even keeping in mind that I'm using this custom system with symlinks. Great job!
User avatar
Marzanna
OldUnreal Member
Posts: 446
Joined: Fri Feb 15, 2008 5:47 pm

Re: Script for compatibility with FHS?

Post by Marzanna »

What do their scripts offer that my simple one doesn't?
Loki's sturt up script is common for almost all UE games. Just variables should be changed.
User avatar
Salafrance
Posts: 3
Joined: Wed Apr 25, 2012 1:59 am

Returning to an earlier directory...

Post by Salafrance »

GreatEm,

If you use brackets around a bash code sequence, it starts the enclosed code in a separate process. Useful in some scenarios and an easy way to stack directories...

xx@shadow:~/Games/UnrealGold/System$ pwd; ( cd ~; pwd; ); pwd
/home/ariane/Games/UnrealGold/System
/home/ariane
/home/ariane/Games/UnrealGold/System
xx@shadow:~/Games/UnrealGold/System$

Return to “Linux-Board”