Kodi Community Forum
[LINUX] XBMC Setup Script - Automatic installation of XBMC for Linux - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Support (https://forum.kodi.tv/forumdisplay.php?fid=33)
+--- Forum: Supplementary Tools for Kodi (https://forum.kodi.tv/forumdisplay.php?fid=116)
+--- Thread: [LINUX] XBMC Setup Script - Automatic installation of XBMC for Linux (/showthread.php?tid=55282)

Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17


- biptn - 2009-12-15

Here's the hacked up script I use to launch other apps in another X session (thanks go to
Mikey [email protected] for this) I had to modify it for the console install. This script will setup the necessary items and install x.game in "usr/local/bin"

Code:
#!/bin/bash
#x.game linux game daemon
#Version 0.8
#written by mikey <[email protected]>
# edited by biptn

function gettmpdir {
    TMPDIR=$(mktemp /tmp/x.game.XXXXXXXXXX || echo "Error unable to create temp directory in /tmp."; exit 1)
}

#Check that we are running as root
if [ "$USER" != "root" ]; then
    echo "xgame must be run as 'root'. Try 'sudo'."
    exit 1
fi

#replace "allowed_users=console"
#Allow any user to start an XServer
gettmpdir
awk '{ if ($1 ~ /^allowed_users=/) { printf "#"; print; } else print }' /etc/X11/Xwrapper.config > $TMPDIR
echo "allowed_users=anybody" >> $TMPDIR
mv $TMPDIR /etc/X11/Xwrapper.config
#Add group 'chvt' and add current user to group
groupadd chvt
USERS=$(awk -F: '{if ($3>=1000 && $3 < 65534) print "TRUE "$1 }' /etc/passwd)
#ANS=$(whiptail  --list  --textbox="Select users to access x.game?" --checklist  --column "Allow" --column "User" $USERS)
IFS="|"
for USR in $USR
do
        usermod -a -G chvt $USR
    #Authorise X for user on display :1
    USRHOME=$(awk -F:  -v user="$USR"  '{if ($1==user) print $6 }' /etc/passwd)
    sudo -u $USR xauth -f $USRHOME/.Xauthority add :1.1 . $(mcookie)
done
IFS="
"
#Add group 'chvt' to no password group for command 'chvt'
gettmpdir
cat /etc/sudoers > $TMPDIR; echo "%chvt ALL= NOPASSWD: /usr/bin/chvt" >> $TMPDIR
visudo -c -f $TMPDIR
if [ $? != 0 ]; then
    echo "Error updating /etc/sudoers!"
    exit 1
fi
if [ -e /etc/sudoers.tmp ]; then
    echo "Error updating /etc/sudoers! Locked by another user. Try again later."
    exit 1
fi
chmod 0440 $TMPDIR
chown 0:0 $TMPDIR
mv $TMPDIR /etc/sudoers

gettmpdir
head -n 5 $0 > $TMPDIR
#echo "BGIMAGE=\"${FILE}\"" >> $TMPDIR
tail -n 83 $0 >> $TMPDIR
mv $TMPDIR /usr/local/bin/x.game
chmod +rx /usr/local/bin/x.game
#Install icon
gettmpdir
echo '/* XPM */
static char * xgame_xpm[] = {
"32 32 2 1",
"     c None",
".    c #000000",
"                                ",
"                                ",
"                                ",
"                                ",
"                                ",
"                                ",
"                                ",
"           .                    ",
"          ...       ..          ",
"         ....     .....         ",
"         .....   ......         ",
"          ..... ......          ",
"          ...........           ",
"           .........            ",
"            .......             ",
"             ......             ",
"             .......            ",
"            .........           ",
"           ...........          ",
"           ....  ......         ",
"          .....  .......        ",
"         .....     .....        ",
"         ....       ...         ",
"          ...        .          ",
"           .                    ",
"                                ",
"                                ",
"                                ",
"                                ",
"                                ",
"                                ",
"                                "};' > $TMPDIR
mv $TMPDIR /usr/share/pixmaps/xgame.xpm
chmod +r /usr/share/pixmaps/xgame.xpm
echo "Successfully installed.\nRun 'x.game start [program]'."
exit 0

PIDFILE="${HOME}/.xgame.pid"
WMPATH="/usr/bin/openbox"
function start {
    if [ -f "/tmp/.X1-lock" ]; then
        echo "X Display :1 already open"
        sudo chvt 12
        DISPLAY=:1
    else
        echo "Starting Daemon:"
        echo $! > /tmp/x.game-notification
        start-stop-daemon --start --quiet --oknodo --pidfile $PIDFILE --make-pidfile --name xgame --startas /usr/bin/xinit -- $WMPATH -- :1 vt12 &
        sleep 2s
        DISPLAY=:1
    fi
    PROGRAM=$1
    echo "Program: $PROGRAM"
    if [ "$PROGRAM" != "" ]; then
        exec $*
    fi
}
function stop {
    echo "Stoping Daemon:"
    start-stop-daemon --stop --quiet --oknodo --pidfile $PIDFILE --name xinit --startas /usr/bin/xinit
    kill `cat /tmp/x.game-notification`
}
function execute {
    if [ -f "/tmp/.X1-lock" ]; then
        echo "Switching to display :1"
        sudo chvt 12
        DISPLAY=:1
    else
        echo "Display :1 is not running!"
        echo "Try 'x.game start PROGRAM'"
        exit 1    
    fi
    PROGRAM=$1
    shift
    if [ "$PROGRAM" == "" ]; then
        echo "Usage: "
        echo "x.game [start | stop] [PROGRAM] [parameters]"
        exit 1
    else
        while (( "$#" )); do
            if [[ -n "$1" && $1 == *\ * ]]; then
                ARGS="$ARGS \"$1\""
            else
                ARGS="$ARGS $1"
            fi
            shift
        done
    fi
    echo $PROGRAM $ARGS
    echo $ARGS | xargs $PROGRAM
}
#START OF SCRIPT
IFS="
"
SS=$1
echo "Selecting: $SS"
case "$SS" in
    start)
        echo "Starting:"
        shift
        start $*
        ;;
    stop)
        echo "Stoping:"
        shift
        stop $*
        ;;
    restart)
        echo "Restarting:"
        shift
        stop $*
        start $*
        ;;
    *)
        echo "Executing:"
        execute $*
esac
exit 0

After this is installed I make a little script in $HOME/bin or anywhere in my PATH to execute whatever it may be. I then point the "Launcher" plugin to that script in XBMC. Here's an example of the script launching huludesktop beta (which sucks very bad on the Revo....very very bad):

Code:
#!/bin/bash

trap "x.game stop" EXIT SIGINT SIGQUIT SIGHUP SIGSEGV

x.game start huludesktop

I have not had a chance to test this hacked down version of the xgame_installer, I will try it out this evening. The official script requires zenity and X to be running, zenity is not installed by default on a minimal install. I will merge this into the xbmc script and tidy things up here in the next few days provided I have the time. I will also add a little somethin to to above example to mv xbmc.bin's priority level way down while something else is running, esp. if it's Boxee.


- prupert - 2009-12-15

Out of interest, does sudo apt-get updating/upgrading install the latest version of the Intel drivers or does this need to be done manually each time they are udpated?


- Txori82 - 2009-12-15

I'm going to test the 0.8b. Thanks!!


- biptn - 2009-12-15

prupert Wrote:Out of interest, does sudo apt-get updating/upgrading install the latest version of the Intel drivers or does this need to be done manually each time they are udpated?

whatever you have already installed on your system is what will get updated.....provided there are any available updates for it.


- Txori82 - 2009-12-16

The script gives me an error of sintaxis on the last sentence? what happen?

and "deb http://ppa.launchpad.net/xbmc-addons/ppa/ubuntu karmic main" don't exist so it give another error...


- biptn - 2009-12-16

Sorry about that, here's the new script fixed. Please leave some feedback.

Code:
#!/bin/bash
#------------------------------------------------------------------------------------------------------------
# setupXBMC Version 0.8c - 12/16/2009
# XBMC Installation script - by VirtualDanny.net
# Modified by BiptoN
# This script will provide an automatic installation of Xbox Media Center
#
# REQUIREMENTS:
# * Clean Ubuntu Jaunty/Intrepid/Hardy Installation (https://help.ubuntu.com/community/Installation/MinimalCD)
# * XBMC Compatible Hardware (http://wiki.xbmc.org/?title=XBMC_for_Linux_specific_FAQ)
# * Internet access
#
# TO-DO LIST:
# * Menu to choose from Stable Release or Bleeding Edge Release
# * Automatic adjustments of all volume channels in Alsamixer
# * Additional tweaks
# * Setup common folders and setup simple samba
# *  Give option for ATI/Nvidia Driver setup
#
# KNOWN BUGS:
# * Installation will fail if you uncomment SVN Repositories during first time installation.
#
# Remember to run this script with: sudo ./setupXBMC.sh
#------------------------------------------------------------------------------------------------------------

function sysup {
    apt-get update && apt-get upgrade -y
    }

if [ "$USER" != "root" ]; then
    echo "You must run this script as 'root'. Try using 'sudo'."
    exit 1
fi

## Upgrade or Install ##

clear
echo "(U)pgrade system"
echo "(I)nstall on new system"
    read action
        case $action in
        "U" | "u" ) sysup ; exit 0
                ;;
        "I" | "i" ) echo "Alrighty then, installin' XBMC for ya"    ; clear
                ;;
        esac
        
## --[ Miscellaneous variables ]------------------------------------------------

RELEASE=`cat /etc/lsb-release | grep CODENAME | cut -d = -f2`
usr=`cat /etc/passwd | grep 1000 |cut -d : -f1`  ## Assuming the first account is the account your using ##
usrhm="/home/$usr"

cd /


##--[ ADDING REPOSITORIES TO SOURCE LIST ]-------------------------------------------------------------------
##    Repositories make it easier to download and stay up-to-date with current releases of Linux applications

apt-get install python-software-properties

if [ $RELEASE = karmic ]
    then
        add-apt-repository ppa:team-xbmc
    else    
        echo '#' XBMC Repositories >> /etc/apt/sources.list.d/xbmc.org.list
        echo '#' SVN builds are commented out. Remove comment '#' to enable.  >> /etc/apt/sources.list.d/xbmc.org.list
        echo '#' Please DO NOT use the SVN builds during first time installation  >> /etc/apt/sources.list.d/xbmc.org.list
        echo deb http://ppa.launchpad.net/team-xbmc/ppa/ubuntu/ $RELEASE main >> /etc/apt/sources.list.d/xbmc.org.list
        echo deb-src http://ppa.launchpad.net/team-xbmc/ppa/ubuntu/ $RELEASE main >> /etc/apt/sources.list.d/xbmc.org.list
        echo deb http://ppa.launchpad.net/xbmc-addons/ppa/ubuntu $RELEASE main >> /etc/apt/sources.list.d/xbmc.org.list
        echo '#'deb http://ppa.launchpad.net/team-xbmc-svn/ppa/ubuntu $RELEASE main >> /etc/apt/sources.list.d/xbmc.org.list
        echo '#'deb-src http://ppa.launchpad.net/team-xbmc-svn/ppa/ubuntu $RELEASE main >> /etc/apt/sources.list.d/xbmc.org.list
fi


##--[ ADDING NVIDIA REPOSITORIES TO SOURCE LIST ]------------------------------------------------------------

if [ $RELEASE = karmic ]
    then
        add-apt-repository ppa:nvidia-vdpau/ppa
    else
        echo   >> etc/apt/sources.list
        echo '#' NVIDIA Repositories >> etc/apt/sources.list
        echo deb http://ppa.launchpad.net/nvidia-vdpau/ppa/ubuntu $RELEASE main >> etc/apt/sources.list
        
fi


##--[ ADDING PGP KEYS TO VERFIY VALID SOURCES ]--------------------------------------------------------------

if [ $RELEASE = karmic ]
    then
        echo "We should have our keys already installed..rollin' on"
    else
        apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 318C7509 64234534 CEC06767 0x6D975C4791E7EE5E
fi


##--[ RUNNING A SYSTEM UPDATE ]------------------------------------------------------------------------------

apt-get update


##--[ INSTALL GENERIC NVIDIA GRAPHIC DRIVERS ]---------------------------------------------------------------

apt-get install linux-headers-generic nvidia-glx-190 -y



##--[ INSTALLS XBMC Media Center ]---------------------------------------------------------------------------

apt-get install xbmc -y
apt-get install xbmc-skin-* -y
apt-get install xbmc-eventclients-* -y
apt-get install xbmc-scripts-* -y



##--[ INSTALL XBMC SVN Repo Installer and Launcher]----------------------------------------------------------------------

apt-get install unzip -y
cd /
cd $usrhm/.xbmc/plugins/programs
wget http://xbmc-addons.googlecode.com/svn/packages/plugins/programs/SVN_Repo_Installer.zip
wget http://xbmc-launcher.googlecode.com/files/Launcher1.04.zip
unzip -o SVN_Repo_Installer.zip
unzip -o Launcher1.04.zip
rm SVN_Repo_Installer.zip
rm Launcher1.04.zip
chown -R $usr:$usr "SVN Repo Installer"
chown -R $usr:$usr Launcher




##--[ INSTALL Additional software ]--------------------------------------------------------------------------

apt-get install openbox xterm xinit x11-xserver-utils -y




## --[ INSTALL AND CONFIGURE ALSA SOUND ]--------------------------------------------------------------------

apt-get install linux-sound-base alsa-base alsa-utils -y
usermod -a -G audio $usr

echo
echo AlsaMixer will now start so that you can configre your volum levels.
echo
echo Press 'M' to activate/deactive, Arrows to adjust volume, and ESC to save/quit.
echo Press any Key to contiue, or wait 20 seconds to continue
read -n1 -t20 any_key

alsamixer
alsactl store 0



## --[ INSTALL XBMC Bootscreen ]-----------------------------------------------------------------------------

apt-get install usplash-theme-xbmc-* -y
update-alternatives --set usplash-artwork.so /usr/lib/usplash/xbmc-splash-spinner-black.so
echo xres=1024 >> /etc/usplash.conf
echo yres=768 >> /etc/usplash.conf

update-initramfs -u

## --[ FINAL SYSTEM UPGRADE ]--------------------------------------------------------------------------------

sysup

## --[ GENERATE XORG.CONF ]----------------------------------------------------------------------------------

nvidia-xconfig -s --no-logo --force-generate

## --[ ADDING HWcursor fix ]---------------------------------------------------------------------------------

sed -i '40i\    Option         "HWCursor" "False"' /etc/X11/xorg.conf



## --[ ENABLE 1080p 24Hz]------------------------------------------------------------------------------------

sed -i '50i\    Option         "DynamicTwinView" "False"' /etc/X11/xorg.conf


## --[ Disable Composite for better H264 acceleration ]------------------------------------------------------

sed -i '30i\Section "Extensions"' /etc/X11/xorg.conf
sed -i '31i\    Option         "Composite" "Disable"' /etc/X11/xorg.conf
sed -i '32i\EndSection' /etc/X11/xorg.conf


## --[ INSTALLING XBMC HELPERS ]-----------------------------------------------------------------------------
apt-get install xbmc-live python-apt -y

## --[ Setup autologin for user ]-----------------------------------------------------------------------------------

if [[ "$RELEASE" == "hardy" || "$RELEASE" == "intrepid" || "$RELEASE" == "jaunty" ]]
    then
        echo '# tty1 - getty' > /etc/event.d/tty1
        echo '#' >> /etc/event.d/tty1
        echo '# This service maintains a getty on tty1 from the point the system is' >> /etc/event.d/tty1
        echo '# started until it is shut down again.' >> /etc/event.d/tty1
        echo >> /etc/event.d/tty1
        echo 'start on stopped rc2' >> /etc/event.d/tty1
        echo 'start on stopped rc3' >> /etc/event.d/tty1
        echo 'start on stopped rc4' >> /etc/event.d/tty1
        echo 'start on stopped rc5' >> /etc/event.d/tty1
        echo >> /etc/event.d/tty1
        echo 'stop on runlevel 0' >> /etc/event.d/tty1
        echo 'stop on runlevel 1' >> /etc/event.d/tty1
        echo 'stop on runlevel 6' >> /etc/event.d/tty1
        echo >> /etc/event.d/tty1
        echo 'respawn' >> /etc/event.d/tty1
        echo 'exec /bin/login -f '$usr' </dev/tty1 > /dev/tty1 2>&1' >> /etc/event.d/tty1
elif [ "$RELEASE" == "karmic" ]
    then
        echo '# tty1 - getty' > /etc/init/tty1.conf
        echo '#' >> /etc/init/tty1.conf
        echo '# This service maintains a getty on tty1 from the point the system is' >> /etc/init/tty1.conf
        echo '# started until it is shut down again.' >> /etc/init/tty1.conf
        echo >> /etc/init/tty1.conf
        echo 'start on stopped rc RUNLEVEL=[2345]' >> /etc/init/tty1.conf
        echo 'stop on runlevel [!2345]' >> /etc/init/tty1.conf
        echo >> /etc/init/tty1.conf
        echo 'respawn' >> /etc/init/tty1.conf
        echo 'exec /bin/login -f '$usr' </dev/tty1 > /dev/tty1 2>&1' >> /etc/init/tty1.conf
fi

echo 'case "`tty`" in' > $usrhm/.bash_profile
echo '/dev/tty1) clear && startx &>/dev/null;;' >> $usrhm/.bash_profile
echo 'esac' >> $usrhm/.bash_profile

echo exec openbox-session > $usrhm/.xinitrc

mkdir -p $usrhm/.config/openbox

echo '#!/bin/bash' > /usr/local/bin/xbmc-session
echo >> /usr/local/bin/xbmc-session
echo 'trap "xbmc" SIGINT SIGHUP EXIT SIGTERM QUIT SIGSEGV' >> /usr/local/bin/xbmc-session
echo    'while true' >> /usr/local/bin/xbmc-session
echo     'do' >> /usr/local/bin/xbmc-session
echo     'xbmc' >> /usr/local/bin/xbmc-session
echo     'sleep 3' >> /usr/local/bin/xbmc-session
echo 'done' >> /usr/local/bin/xbmc-session

chmod +x /usr/local/bin/xbmc-session

echo xbmc-session > $usrhm/.config/openbox/autostart.sh
mkdir -p $usrhm/Media/Videos
mkdir -p $usrhm/Media/Movies
mkdir -p $usrhm/Media/Music
mkdir -p $usrhm/Media/Pictures

chown -R $usr:$usr $usrhm

    
#SYSTEM Reboot
#pkill X
sync
/sbin/reboot



- Txori82 - 2009-12-16

I've got problems with add-apt-repository ppa:team-xbmc and add-apt-repository ppa:nvidia-vdpau/ppa. It's says that can't find the order.


- harryzimm - 2009-12-16

Txori82 Wrote:I've got problems with add-apt-repository ppa:team-xbmc and add-apt-repository ppa:nvidia-vdpau/ppa. It's says that can't find the order.

You need to to run

Code:
sudo apt-get install python-software-properties

Then run the script.

cheers


- Txori82 - 2009-12-16

Ok thanks.

Why someone doesn't insert that on the script too? i don't know how to do it... For the future people who are going to use ir Smile


- Txori82 - 2009-12-16

Hi

running "sudo apt-get install python-software-properties" first the script works fine.

Thanks


- biptn - 2009-12-16

script updated. thanks harryzimm for the help.

Code:
#!/bin/bash
#------------------------------------------------------------------------------------------------------------
# setupXBMC Version 0.8e - 12/21/2009
# XBMC Installation script - by VirtualDanny.net
# Modified by BiptoN
# This script will provide an automatic installation of Xbox Media Center
#
# REQUIREMENTS:
# * Clean Ubuntu Jaunty/Intrepid/Hardy Installation (https://help.ubuntu.com/community/Installation/MinimalCD)
# * XBMC Compatible Hardware (http://wiki.xbmc.org/?title=XBMC_for_Linux_specific_FAQ)
# * Internet access
#
# TO-DO LIST:
# * Menu to choose from Stable Release or Bleeding Edge Release
# * Automatic adjustments of all volume channels in Alsamixer
# * Additional tweaks
# * Setup common folders and setup simple samba
# *  Give option for ATI/Nvidia Driver setup
#
# KNOWN BUGS:
# * Installation will fail if you uncomment SVN Repositories during first time installation.
#
# Remember to run this script with: sudo ./setupXBMC.sh
#------------------------------------------------------------------------------------------------------------

function sysup {
    apt-get update && apt-get upgrade -y
    }

if [ "$USER" != "root" ]; then
    echo "You must run this script as 'root'. Try using 'sudo'."
    exit 1
fi

## Upgrade or Install ##

clear
echo "(U)pgrade system"
echo "or"
echo "(I)nstall on a new system"
    read action
        case $action in
        "U" | "u" ) sysup ; exit 0
                ;;
        "I" | "i" ) echo "Alrighty then, installin' XBMC for ya"    ; clear
                ;;
        esac
        
## --[ Miscellaneous variables ]------------------------------------------------

RELEASE=`cat /etc/lsb-release | grep CODENAME | cut -d = -f2`
usr=`cat /etc/passwd | grep 1000 |cut -d : -f1`  ## Assuming the first account is the account your using ##
usrhm="/home/$usr"

cd /


##--[ ADDING REPOSITORIES TO SOURCE LIST ]-------------------------------------------------------------------
##    Repositories make it easier to download and stay up-to-date with current releases of Linux applications



if [ $RELEASE = karmic ]
    then
        psp=`aptitude search python-software-properties | cut -b 1`
        if [ $psp == i ]
        then
            clear
        else
            apt-get install python-software-properties -y
        fi
            add-apt-repository ppa:team-xbmc
    else    
        echo '#' XBMC Repositories >> /etc/apt/sources.list.d/xbmc.org.list
        echo '#' SVN builds are commented out. Remove comment '#' to enable.  >> /etc/apt/sources.list.d/xbmc.org.list
        echo '#' Please DO NOT use the SVN builds during first time installation  >> /etc/apt/sources.list.d/xbmc.org.list
        echo deb http://ppa.launchpad.net/team-xbmc/ppa/ubuntu/ $RELEASE main >> /etc/apt/sources.list.d/xbmc.org.list
        echo deb-src http://ppa.launchpad.net/team-xbmc/ppa/ubuntu/ $RELEASE main >> /etc/apt/sources.list.d/xbmc.org.list
        echo deb http://ppa.launchpad.net/xbmc-addons/ppa/ubuntu $RELEASE main >> /etc/apt/sources.list.d/xbmc.org.list
        echo '#'deb http://ppa.launchpad.net/team-xbmc-svn/ppa/ubuntu $RELEASE main >> /etc/apt/sources.list.d/xbmc.org.list
        echo '#'deb-src http://ppa.launchpad.net/team-xbmc-svn/ppa/ubuntu $RELEASE main >> /etc/apt/sources.list.d/xbmc.org.list
fi


##--[ ADDING NVIDIA REPOSITORIES TO SOURCE LIST ]------------------------------------------------------------

if [ $RELEASE = karmic ]
    then
        add-apt-repository ppa:nvidia-vdpau/ppa
    else
        echo   >> etc/apt/sources.list
        echo '#' NVIDIA Repositories >> etc/apt/sources.list
        echo deb http://ppa.launchpad.net/nvidia-vdpau/ppa/ubuntu $RELEASE main >> etc/apt/sources.list
        
fi


##--[ ADDING PGP KEYS TO VERFIY VALID SOURCES ]--------------------------------------------------------------

if [ $RELEASE = karmic ]
    then
        echo "We should have our keys already installed..rollin' on"
    else
        apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 318C7509 64234534 CEC06767 0x6D975C4791E7EE5E
fi


##--[ RUNNING A SYSTEM UPDATE ]------------------------------------------------------------------------------

apt-get update


##--[ INSTALL GENERIC NVIDIA GRAPHIC DRIVERS ]---------------------------------------------------------------

apt-get install linux-headers-generic nvidia-glx-195 -y



##--[ INSTALLS XBMC Media Center ]---------------------------------------------------------------------------

apt-get install xbmc -y
apt-get install xbmc-skin-* -y
apt-get install xbmc-eventclients-* -y
apt-get install xbmc-scripts-* -y



##--[ INSTALL XBMC SVN Repo Installer and Launcher]----------------------------------------------------------------------

apt-get install unzip -y
cd /
cd $usrhm/.xbmc/plugins/programs
wget http://xbmc-addons.googlecode.com/svn/packages/plugins/programs/SVN_Repo_Installer.zip
wget http://xbmc-launcher.googlecode.com/files/Launcher1.04.zip
unzip -o SVN_Repo_Installer.zip
unzip -o Launcher1.04.zip
rm SVN_Repo_Installer.zip
rm Launcher1.04.zip
chown -R $usr:$usr "SVN Repo Installer"
chown -R $usr:$usr Launcher




##--[ INSTALL Additional software ]--------------------------------------------------------------------------

apt-get install openbox xterm xinit x11-xserver-utils -y




## --[ INSTALL AND CONFIGURE ALSA SOUND ]--------------------------------------------------------------------

apt-get install linux-sound-base alsa-base alsa-utils -y
usermod -a -G audio $usr

echo
echo AlsaMixer will now start so that you can configre your volum levels.
echo
echo Press 'M' to activate/deactive, Arrows to adjust volume, and ESC to save/quit.
echo Press any Key to contiue, or wait 20 seconds to continue
read -n1 -t20 any_key

alsamixer
alsactl store 0



## --[ INSTALL XBMC Bootscreen ]-----------------------------------------------------------------------------

apt-get install usplash-theme-xbmc-* -y
update-alternatives --set usplash-artwork.so /usr/lib/usplash/xbmc-splash-spinner-black.so
echo xres=1024 >> /etc/usplash.conf
echo yres=768 >> /etc/usplash.conf

update-initramfs -u

## --[ FINAL SYSTEM UPGRADE ]--------------------------------------------------------------------------------

sysup

## --[ GENERATE XORG.CONF ]----------------------------------------------------------------------------------

nvidia-xconfig -s --no-logo --force-generate

## --[ ADDING HWcursor fix ]---------------------------------------------------------------------------------

sed -i '40i\    Option         "HWCursor" "False"' /etc/X11/xorg.conf



## --[ ENABLE 1080p 24Hz]------------------------------------------------------------------------------------

sed -i '50i\    Option         "DynamicTwinView" "False"' /etc/X11/xorg.conf


## --[ Disable Composite for better H264 acceleration ]------------------------------------------------------

sed -i '30i\Section "Extensions"' /etc/X11/xorg.conf
sed -i '31i\    Option         "Composite" "Disable"' /etc/X11/xorg.conf
sed -i '32i\EndSection' /etc/X11/xorg.conf


## --[ INSTALLING XBMC HELPERS ]-----------------------------------------------------------------------------
apt-get install xbmc-live python-apt -y

## --[ Setup autologin for user ]-----------------------------------------------------------------------------------

if [[ "$RELEASE" == "hardy" || "$RELEASE" == "intrepid" || "$RELEASE" == "jaunty" ]]
    then
        echo '# tty1 - getty' > /etc/event.d/tty1
        echo '#' >> /etc/event.d/tty1
        echo '# This service maintains a getty on tty1 from the point the system is' >> /etc/event.d/tty1
        echo '# started until it is shut down again.' >> /etc/event.d/tty1
        echo >> /etc/event.d/tty1
        echo 'start on stopped rc2' >> /etc/event.d/tty1
        echo 'start on stopped rc3' >> /etc/event.d/tty1
        echo 'start on stopped rc4' >> /etc/event.d/tty1
        echo 'start on stopped rc5' >> /etc/event.d/tty1
        echo >> /etc/event.d/tty1
        echo 'stop on runlevel 0' >> /etc/event.d/tty1
        echo 'stop on runlevel 1' >> /etc/event.d/tty1
        echo 'stop on runlevel 6' >> /etc/event.d/tty1
        echo >> /etc/event.d/tty1
        echo 'respawn' >> /etc/event.d/tty1
        echo 'exec /bin/login -f '$usr' </dev/tty1 > /dev/tty1 2>&1' >> /etc/event.d/tty1
elif [ "$RELEASE" == "karmic" ]
    then
        echo '# tty1 - getty' > /etc/init/tty1.conf
        echo '#' >> /etc/init/tty1.conf
        echo '# This service maintains a getty on tty1 from the point the system is' >> /etc/init/tty1.conf
        echo '# started until it is shut down again.' >> /etc/init/tty1.conf
        echo >> /etc/init/tty1.conf
        echo 'start on stopped rc RUNLEVEL=[2345]' >> /etc/init/tty1.conf
        echo 'stop on runlevel [!2345]' >> /etc/init/tty1.conf
        echo >> /etc/init/tty1.conf
        echo 'respawn' >> /etc/init/tty1.conf
        echo 'exec /bin/login -f '$usr' </dev/tty1 > /dev/tty1 2>&1' >> /etc/init/tty1.conf
fi

echo 'case "`tty`" in' > $usrhm/.bash_profile
echo '/dev/tty1) clear && startx &>/dev/null;;' >> $usrhm/.bash_profile
echo 'esac' >> $usrhm/.bash_profile

echo exec openbox-session > $usrhm/.xinitrc

mkdir -p $usrhm/.config/openbox

echo '#!/bin/bash' > /usr/local/bin/xbmc-session
echo >> /usr/local/bin/xbmc-session
echo 'trap "xbmc --standalone" SIGINT SIGHUP EXIT SIGTERM QUIT SIGSEGV' >> /usr/local/bin/xbmc-session
echo    'while true' >> /usr/local/bin/xbmc-session
echo     'do' >> /usr/local/bin/xbmc-session
echo     'xbmc' >> /usr/local/bin/xbmc-session
echo     'sleep 3' >> /usr/local/bin/xbmc-session
echo 'done' >> /usr/local/bin/xbmc-session

chmod +x /usr/local/bin/xbmc-session

echo xbmc-session > $usrhm/.config/openbox/autostart.sh
mkdir -p $usrhm/Media/Videos
mkdir -p $usrhm/Media/Movies
mkdir -p $usrhm/Media/Music
mkdir -p $usrhm/Media/Pictures

chown -R $usr:$usr $usrhm

    
#SYSTEM Reboot

sync
/sbin/reboot



- fishyguy - 2009-12-18

I ran this tonight and all went well except my usb hard drive does not show up. any ideasHuh


- biptn - 2009-12-19

i will look into that this evening, I have a Revo R3600 ready to be lit up.


- levster - 2009-12-22

This may be a rather naive question, but where do I download this script from the XBMC PC that I am setting up? In other words, what is the http link to the script? I saw a link to the original script, but this new one described in the last half of the thread appears different.

Thanks.


- mightydrake - 2009-12-22

I installed XBMC today using your script.

I can confirm that it's working on a Zotac Mag.
Thanks.