onemyndseye
05-14-2009, 10:41 AM
Here you will find a work around for the issue found in this thread:
http://regnumonlinegame.com/forum/showthread.php?t=36774
http://regnumonlinegame.com/forum/showthread.php?t=41714
UPDATE [05/15/2009]: Script and HOWTO solve the issue of RO running as root
UPDATE [05/16/2009]: Script and HOWTO with some minor code improvements
UPDATE [05/18/2009]: Script and HOWTO updated to solve an issue that can cause the internet connection inside the chroot to stop working.
UPDATE [05/18/2009]: Spainish/English support has been added. Chroot locale will match your system.
UPDATE [05/22/2009]: Proper Spanish translations added to script
UPDATE [08/04/2009]: New Download location.
UPDATE [10/20/2009]: Issue fixed by Arafails and hopefully soon NGD *** THIS METHOD IS OBSOLETE ****
************ NOTICE: THIS METHOD IS OBSOLETE ********************
Please see this thread for a more solid fix: http://regnumonlinegame.com/forum/showthread.php?t=50234
************************************************** ****************
First of all -- AFAIK this fix works on Ubuntu Jaunty or similar version distros of Linux. This means:
Xorg 7.4
Mesa 7.4
Kernel 2.6.28
The basic method is to create a chroot using debootstrap and configure it for running X apps under your current Xserver/desktop. There is a good guide for this here: https://wiki.ubuntu.com/DebootstrapChroot
At the end of this post youll find a script to take care of the work for you...
You need to have RO installed to ~/regnum before starting
From now on assume we are working as root... First we need to install a couple needed packages. debootstrap and libtxc-dxtn which I will assume you need since you are reading this ;)
sudo su
apt-get install debootstrap
wget http://debian-multimedia.org/pool/main/libt/libtxc-dxtn/libtxc-dxtn0_0.070518-0.1_i386.deb
dpkg -i libtxc-dxtn0_0.070518-0.1_i386.deb
rm -f libtxc-dxtn0_0.070518-0.1_i386.deb
To build your chroot we will assume you wish to put it in /opt/hardy-chroot
mkdir -p /opt/hardy-chroot
debootstrap --variant=buildd hardy /opt/hardy-chroot http://archive.ubuntu.com/ubuntu/
mkdir -p /opt/hardy-chroot/var/run/dbus
mkdir -p /opt/hardy-chroot/lib/modules
mkdir -p /opt/hardy-chroot/home
mkdir -p /opt/hardy-chroot/host-etc
Replace the contents of /opt/hardy-chroot/etc/apt/sources.list
with the following lines: (hint: pico /opt/hardy-chroot/etc/apt/sources.list)
deb http://us.archive.ubuntu.com/ubuntu/ hardy main restricted
deb-src http://us.archive.ubuntu.com/ubuntu/ hardy main restricted
deb http://us.archive.ubuntu.com/ubuntu/ hardy-updates main restricted
deb-src http://us.archive.ubuntu.com/ubuntu/ hardy-updates main restricted
deb http://us.archive.ubuntu.com/ubuntu/ hardy universe
deb-src http://us.archive.ubuntu.com/ubuntu/ hardy universe
deb http://us.archive.ubuntu.com/ubuntu/ hardy-updates universe
deb-src http://us.archive.ubuntu.com/ubuntu/ hardy-updates universe
deb http://us.archive.ubuntu.com/ubuntu/ hardy multiverse
deb-src http://us.archive.ubuntu.com/ubuntu/ hardy multiverse
deb http://us.archive.ubuntu.com/ubuntu/ hardy-updates multiverse
deb-src http://us.archive.ubuntu.com/ubuntu/ hardy-updates multiverse
deb http://us.archive.ubuntu.com/ubuntu/ hardy-backports main restricted universe multiverse
deb-src http://us.archive.ubuntu.com/ubuntu/ hardy-backports main restricted universe multiverse
deb http://archive.canonical.com/ubuntu hardy partner
deb-src http://archive.canonical.com/ubuntu hardy partner
deb http://security.ubuntu.com/ubuntu hardy-security main restricted
deb-src http://security.ubuntu.com/ubuntu hardy-security main restricted
deb http://security.ubuntu.com/ubuntu hardy-security universe
deb-src http://security.ubuntu.com/ubuntu hardy-security universe
deb http://security.ubuntu.com/ubuntu hardy-security multiverse
deb-src http://security.ubuntu.com/ubuntu hardy-security multiverse
These lines should be added to your /etc/fstab
/proc /opt/hardy-chroot/proc none rbind 0 0
/dev /opt/hardy-chroot/dev none rbind 0 0
/sys /opt/hardy-chroot/sys none rbind 0 0
/tmp /opt/hardy-chroot/tmp none rbind 0 0
/home /opt/hardy-chroot/home none rbind 0 0
/etc /opt/hardy-chroot/host-etc none rbind 0 0
/lib/modules /opt/hardy-chroot/lib/modules none rbind 0 0
/var/run/dbus /opt/hardy-chroot/var/run/dbus none rbind 0 0
Then issue the follow command to mount the needed file systems and enter the
chroot
mount -a
chroot /opt/hardy-chroot
Once here we need to install the needed packages to properly configure the
system and to run RO
rm /etc/resolv.conf
ln -s /host-etc/resolv.conf /etc/resolv.conf
export LANG=C
apt-get update
apt-get --yes --force-yes --no-install-recommends install wget debconf devscripts gnupg nano
apt-get update
apt-get --yes --force-yes install language-pack-en
apt-get --yes --force-yes install xorg libgl1-mesa-dri libgl1-mesa-glx libglu1-mesa mesa-utils libglib2.0-0 libgtk2.0-0 libxt6 libopenal0a
wget http://debian-multimedia.org/pool/main/libt/libtxc-dxtn/libtxc-dxtn0_0.070518-0.1_i386.deb
dpkg -i libtxc-dxtn0_0.070518-0.1_i386.deb
rm -f libtxc-dxtn0_0.070518-0.1_i386.deb
apt-get clean
rm /etc/hostname
rm /etc/group
rm /etc/passwd
rm /etc/shadow
rm /etc/gshadow
ln -s /host-etc/hosts /etc/hosts
ln -s /host-etc/hostname /etc/hostname
ln -s /host-etc/group /etc/group
ln -s /host-etc/passwd /etc/passwd
ln -s /host-etc/shadow /etc/shadow
ln -s /host-etc/gshadow /etc/gshadow
mkdir -p /etc/default
rm /etc/default/locale
ln -s /host-etc/default/locale /etc/default/locale
exit
Leave the current root session:
exit
** NOTE: You should no longer be working as root **
You now must create 2 helper scripts for launching RO:
~/regnum/chrooted_ro.sh
!/bin/bash
##
##
### DO NOT RUN THIS SCRIPT DIRECTLY. It should be called by regnum-online.sh
# accept the running user as a arg passed from regnum-online.sh
USER=$1
## Function to wait until RO was exited
wait_game() {
RO_EXIT="0"
while [ $RO_EXIT = "0" ]
do
TMP1=$(ps -U $USER |grep game |grep -v grep |awk '{print $1}')
if [ -z "$TMP1" ]; then
RO_EXIT=1
fi
sleep 0.5
done
}
### Setup the env and start launcher
cd /home/$USER/regnum
export MALLOC_CHECK_=1
su $USER -c ./rolauncher
## Wait for main process to exit. Use a loop to get this done
#
sleep 2
wait_game
~/regnum/chrooted_ro.sh
#!/bin/bash
sudo chroot /opt/hardy-chroot /home/$USER/regnum/chrooted_ro.sh $USER
exit 0
Now finally set the 2 scripts as executable:
chmod +x ~/chrooted_ro.sh
chmod +x ~/regnum-online.sh
Thankfully I have created a script to do all this for you ;) Find it here:
***** DOWNLOAD LINK REMOVED - THIS METHOD IS OBSOLETE *****
*** UPDATE: Spainish/English locale support added to script. Language is detected from the host system and may be overridden by the --lang argument.. in which case you will be prompted. Example:
onemyndseye@onemyndsmobile ~ $ ./build-ro-bottle.sh --lang
1. English
2. Enspanol
English or Espanol?:
This script handles everything above including building the scripts to launch RO. The only this I left out of the script is to edit your /etc/sudoers file to allow you to skip entering your password....
To do this... edit your sudoers file with the command: sudo pico /etc/sudoers
Add the following line
<YOUR USER NAME> ALL = NOPASSWD: /usr/sbin/chroot
Example:
onemyndseye ALL = NOPASSWD: /usr/sbin/chroot
Now you may launch RO with the following command: ~/regnum/regnum-online.sh
**** IMPORTANT: If you wish to delete the files in /opt/hardy-chroot YOU MUST remove the related lines from /etc/fstab first THEN REBOOT YOUR PC... failure to do this WILL trash your linux install
This method and script should be considered a rough draft so expect it to evolve and improve over time... also note that it may break without warning and RO cease to function -- we will just have to cross that hurdle when we get there
Once again the link for the script: ***** DOWNLOAD LINK REMOVED - THIS METHOD IS OBSOLETE *****
http://regnumonlinegame.com/forum/showthread.php?t=36774
http://regnumonlinegame.com/forum/showthread.php?t=41714
UPDATE [05/15/2009]: Script and HOWTO solve the issue of RO running as root
UPDATE [05/16/2009]: Script and HOWTO with some minor code improvements
UPDATE [05/18/2009]: Script and HOWTO updated to solve an issue that can cause the internet connection inside the chroot to stop working.
UPDATE [05/18/2009]: Spainish/English support has been added. Chroot locale will match your system.
UPDATE [05/22/2009]: Proper Spanish translations added to script
UPDATE [08/04/2009]: New Download location.
UPDATE [10/20/2009]: Issue fixed by Arafails and hopefully soon NGD *** THIS METHOD IS OBSOLETE ****
************ NOTICE: THIS METHOD IS OBSOLETE ********************
Please see this thread for a more solid fix: http://regnumonlinegame.com/forum/showthread.php?t=50234
************************************************** ****************
First of all -- AFAIK this fix works on Ubuntu Jaunty or similar version distros of Linux. This means:
Xorg 7.4
Mesa 7.4
Kernel 2.6.28
The basic method is to create a chroot using debootstrap and configure it for running X apps under your current Xserver/desktop. There is a good guide for this here: https://wiki.ubuntu.com/DebootstrapChroot
At the end of this post youll find a script to take care of the work for you...
You need to have RO installed to ~/regnum before starting
From now on assume we are working as root... First we need to install a couple needed packages. debootstrap and libtxc-dxtn which I will assume you need since you are reading this ;)
sudo su
apt-get install debootstrap
wget http://debian-multimedia.org/pool/main/libt/libtxc-dxtn/libtxc-dxtn0_0.070518-0.1_i386.deb
dpkg -i libtxc-dxtn0_0.070518-0.1_i386.deb
rm -f libtxc-dxtn0_0.070518-0.1_i386.deb
To build your chroot we will assume you wish to put it in /opt/hardy-chroot
mkdir -p /opt/hardy-chroot
debootstrap --variant=buildd hardy /opt/hardy-chroot http://archive.ubuntu.com/ubuntu/
mkdir -p /opt/hardy-chroot/var/run/dbus
mkdir -p /opt/hardy-chroot/lib/modules
mkdir -p /opt/hardy-chroot/home
mkdir -p /opt/hardy-chroot/host-etc
Replace the contents of /opt/hardy-chroot/etc/apt/sources.list
with the following lines: (hint: pico /opt/hardy-chroot/etc/apt/sources.list)
deb http://us.archive.ubuntu.com/ubuntu/ hardy main restricted
deb-src http://us.archive.ubuntu.com/ubuntu/ hardy main restricted
deb http://us.archive.ubuntu.com/ubuntu/ hardy-updates main restricted
deb-src http://us.archive.ubuntu.com/ubuntu/ hardy-updates main restricted
deb http://us.archive.ubuntu.com/ubuntu/ hardy universe
deb-src http://us.archive.ubuntu.com/ubuntu/ hardy universe
deb http://us.archive.ubuntu.com/ubuntu/ hardy-updates universe
deb-src http://us.archive.ubuntu.com/ubuntu/ hardy-updates universe
deb http://us.archive.ubuntu.com/ubuntu/ hardy multiverse
deb-src http://us.archive.ubuntu.com/ubuntu/ hardy multiverse
deb http://us.archive.ubuntu.com/ubuntu/ hardy-updates multiverse
deb-src http://us.archive.ubuntu.com/ubuntu/ hardy-updates multiverse
deb http://us.archive.ubuntu.com/ubuntu/ hardy-backports main restricted universe multiverse
deb-src http://us.archive.ubuntu.com/ubuntu/ hardy-backports main restricted universe multiverse
deb http://archive.canonical.com/ubuntu hardy partner
deb-src http://archive.canonical.com/ubuntu hardy partner
deb http://security.ubuntu.com/ubuntu hardy-security main restricted
deb-src http://security.ubuntu.com/ubuntu hardy-security main restricted
deb http://security.ubuntu.com/ubuntu hardy-security universe
deb-src http://security.ubuntu.com/ubuntu hardy-security universe
deb http://security.ubuntu.com/ubuntu hardy-security multiverse
deb-src http://security.ubuntu.com/ubuntu hardy-security multiverse
These lines should be added to your /etc/fstab
/proc /opt/hardy-chroot/proc none rbind 0 0
/dev /opt/hardy-chroot/dev none rbind 0 0
/sys /opt/hardy-chroot/sys none rbind 0 0
/tmp /opt/hardy-chroot/tmp none rbind 0 0
/home /opt/hardy-chroot/home none rbind 0 0
/etc /opt/hardy-chroot/host-etc none rbind 0 0
/lib/modules /opt/hardy-chroot/lib/modules none rbind 0 0
/var/run/dbus /opt/hardy-chroot/var/run/dbus none rbind 0 0
Then issue the follow command to mount the needed file systems and enter the
chroot
mount -a
chroot /opt/hardy-chroot
Once here we need to install the needed packages to properly configure the
system and to run RO
rm /etc/resolv.conf
ln -s /host-etc/resolv.conf /etc/resolv.conf
export LANG=C
apt-get update
apt-get --yes --force-yes --no-install-recommends install wget debconf devscripts gnupg nano
apt-get update
apt-get --yes --force-yes install language-pack-en
apt-get --yes --force-yes install xorg libgl1-mesa-dri libgl1-mesa-glx libglu1-mesa mesa-utils libglib2.0-0 libgtk2.0-0 libxt6 libopenal0a
wget http://debian-multimedia.org/pool/main/libt/libtxc-dxtn/libtxc-dxtn0_0.070518-0.1_i386.deb
dpkg -i libtxc-dxtn0_0.070518-0.1_i386.deb
rm -f libtxc-dxtn0_0.070518-0.1_i386.deb
apt-get clean
rm /etc/hostname
rm /etc/group
rm /etc/passwd
rm /etc/shadow
rm /etc/gshadow
ln -s /host-etc/hosts /etc/hosts
ln -s /host-etc/hostname /etc/hostname
ln -s /host-etc/group /etc/group
ln -s /host-etc/passwd /etc/passwd
ln -s /host-etc/shadow /etc/shadow
ln -s /host-etc/gshadow /etc/gshadow
mkdir -p /etc/default
rm /etc/default/locale
ln -s /host-etc/default/locale /etc/default/locale
exit
Leave the current root session:
exit
** NOTE: You should no longer be working as root **
You now must create 2 helper scripts for launching RO:
~/regnum/chrooted_ro.sh
!/bin/bash
##
##
### DO NOT RUN THIS SCRIPT DIRECTLY. It should be called by regnum-online.sh
# accept the running user as a arg passed from regnum-online.sh
USER=$1
## Function to wait until RO was exited
wait_game() {
RO_EXIT="0"
while [ $RO_EXIT = "0" ]
do
TMP1=$(ps -U $USER |grep game |grep -v grep |awk '{print $1}')
if [ -z "$TMP1" ]; then
RO_EXIT=1
fi
sleep 0.5
done
}
### Setup the env and start launcher
cd /home/$USER/regnum
export MALLOC_CHECK_=1
su $USER -c ./rolauncher
## Wait for main process to exit. Use a loop to get this done
#
sleep 2
wait_game
~/regnum/chrooted_ro.sh
#!/bin/bash
sudo chroot /opt/hardy-chroot /home/$USER/regnum/chrooted_ro.sh $USER
exit 0
Now finally set the 2 scripts as executable:
chmod +x ~/chrooted_ro.sh
chmod +x ~/regnum-online.sh
Thankfully I have created a script to do all this for you ;) Find it here:
***** DOWNLOAD LINK REMOVED - THIS METHOD IS OBSOLETE *****
*** UPDATE: Spainish/English locale support added to script. Language is detected from the host system and may be overridden by the --lang argument.. in which case you will be prompted. Example:
onemyndseye@onemyndsmobile ~ $ ./build-ro-bottle.sh --lang
1. English
2. Enspanol
English or Espanol?:
This script handles everything above including building the scripts to launch RO. The only this I left out of the script is to edit your /etc/sudoers file to allow you to skip entering your password....
To do this... edit your sudoers file with the command: sudo pico /etc/sudoers
Add the following line
<YOUR USER NAME> ALL = NOPASSWD: /usr/sbin/chroot
Example:
onemyndseye ALL = NOPASSWD: /usr/sbin/chroot
Now you may launch RO with the following command: ~/regnum/regnum-online.sh
**** IMPORTANT: If you wish to delete the files in /opt/hardy-chroot YOU MUST remove the related lines from /etc/fstab first THEN REBOOT YOUR PC... failure to do this WILL trash your linux install
This method and script should be considered a rough draft so expect it to evolve and improve over time... also note that it may break without warning and RO cease to function -- we will just have to cross that hurdle when we get there
Once again the link for the script: ***** DOWNLOAD LINK REMOVED - THIS METHOD IS OBSOLETE *****