Jump to content

The Linux User's Guide to Installing Mods on the Enhanced Editions


Recommended Posts

You can do

OWNER_NAME=$(sed -nr '/:1000:/ s,^([^:]*).*$,\1,p' /etc/passwd)

It's a great default, since most users will be the single normal user on the system.

Are you doing this for speed? It's much more complicated compared to just reserving some space and creating a file to hold desirable filesystem that you can then loop mount.

Link to comment
22 minutes ago, lynx said:

Are you doing this for speed? It's much more complicated compared to just reserving some space and creating a file to hold desirable filesystem that you can then loop mount.

Speed is one reason, but the fact that a ram disk is discarded after a system reboot or a manual reset can be an advantage if you want to go wild with modding the games.

I've been using a similar option on Windows for years and with my switch to Linux I wanted something like that for Linux, too. The scripts above are a bit verbose because I avoided the use of systemd-related tools to create a ram disk. It could be more compact otherwise.

Edited by argent77
Link to comment

Hello, thank you everyone for this great resource.  I just wanted to contribute how I went about it, as I did have to go back and forth between some posts and various websites tracking things down.

1. cd into the directory you want to place the image and mount point. In this example, I created an Infinity Engine folder in my ~/Games directory.

cd ~/Games/Infinity\ Engine/


2. Use fallocate to reserve the space to be mounted as ext4 with casefolding. I used 25G but more or less may be appropriate for your mods.
 

fallocate -l 25G bgee.img

 

3.  Format the Image with ext4 and enable casefolding.

 

mkfs.ext4 -O casefold bgee.img

 

4. Make a directory and mount the image to it.
 

mkdir bgee
sudo mount -o loop bgee.img bgee

 

5.  Delete the lost+found directory that was created on the img when we formatted to ext4.

sudo rm -rf bgee/*

 

6. Use chattr to turn on casefolding on the image. Then use lsattr to make sure it worked.
 

sudo chattr +F bgee/
lsattr -d bgee/

The output should be as follows, the F is good.
 

--------------e--F---- bgee/

 

7.  Change the permissions so the users can write in the image.
 

sudo chmod -R 777 bgee/

 

At this point you should be ready to install or move the game files onto the image and start modding. To do that we will need to get the WeiDU tools off of github and move them to a folder in your $PATH.  I just threw the binaries in ~/.local/bin, which was already in my $PATH by default.

https://github.com/WeiDUorg/weidu/releases
 

Further explanation:
 

Spoiler

The $PATH variable is an environment variable that lists directories where the system looks for executable files when you run a command in the terminal. It will save time and effort if your WeiDU tools are there.

To list the directories in your $PATH

echo $PATH

To temporarily add a folder to your $PATH for the current terminal session:
export PATH=$PATH:/path/to/your/folder

To permanently add the folder to your path, add the above line to your ~/.bashrc, ~/.bash_profile, or ~/.profile . To reload, source ~/.bashrc

 

In my case, I have the games on GOG, so I downloaded the Linux installer, and pointed it to my image directory and installed right on it. This may or may not be a good way to do it. You may choose to install it elsewhere and copy the files over. 

In the case of the GOG installer, the game will not launch on modern Linux distributions because it requires libraries that aren't shipped anymore. The files are libcrypto.so.1.0.0 and libssl.so.1.0.0

Be mindful of where you get them, I found them in an older linux package and extracted them with a gui unzip tool (ark in my case). Small note, 1.0.1 seems to be the highest the game will accept, 1.0.2 didn't work for me.

You can find them here: https://software.opensuse.org/download/package?package=libopenssl1_0_0&project=home%3AMir_ppc%3Aopenssl1.0.1#directopenSUSE

I would recommend against installing them on your system, instead place them in your game folder and place the following in your start.sh script, for example: (edit in bold)

Spoiler

#!/bin/bash
# GOG.com (www.gog.com)
# Game

# Initialization
CURRENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
cd "${CURRENT_DIR}"
source support/gog_com.shlib

# Game info
GAME_NAME="$(get_gameinfo 1)"
VERSION="$(get_gameinfo 2)"
VERSION_DEV="$(get_gameinfo 3)"

# Add the current directory to LD_LIBRARY_PATH
export LD_LIBRARY_PATH=$PWD:$LD_LIBRARY_PATH

# Actions
run_game() {
echo "Running ${GAME_NAME}"
cd "${CURRENT_DIR}/game"
chmod +x *
 ./"BaldursGate"

}
default() {
run_game
}

# Options
define_option "-s" "--start" "start ${GAME_NAME}" "run_game" "$@"

# Defaults
standard_options "$@"

 


With the above change it will launch if the files are in the same directory as your start.sh

For an example of how to install a mod, lets start with DlcMerger provided by the fine fellow who posted above me. It is required if you install Siege of Dragonspear so it's a good place to start.

1. Download the mod:
https://github.com/Argent77/A7-DlcMerger/releases/
 

2. Extract the DlcMerger folder from the zip and place it in your installed game folder on your mounted image.

3. Navigate to the installed game folder in your terminal.  I was able to just click 'open in terminal' in my file browser.
4. Run weinstall DlcMerger
   
If all goes well the mod should install. 
5. Repeat with your other mods.
 

I almost forgot, to unmount the image when you are done, just sudo umount /the/location/you/mounted/to

When you are ready to replay again, just mount the image and you are good to go. I suppose you could edit your fstab if you are inclined to do so.

If I have any other notes, I'll add them here.

Edited by logicalafternoon
Link to comment

Join the conversation

You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...