Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash -v
- #------------------------------------------------------------------------------------------------------------
- # setupXBMC Version 0.7a - 18/11/2009
- # XBMC Installation script - by VirtualDanny.net
- # This script will provide an automatic installation of Xbox Media Center
- #
- # REQUIREMENTS:
- # * Clean Ubuntu Jaunty Server Installation https://help.ubuntu.com/community/Installation/MinimalCD
- # * XBMC Compatible Hardware http://xbmc.org/wiki/?title=XBMC_for_Linux_specific_FAQ
- # * Internet access
- # * Username must be set to 'XBMC' under Ubuntu installation
- #
- # 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 smbd
- # * 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
- #------------------------------------------------------------------------------------------------------------
- ## --[ Miscellaneous variables ]------------------------------------------------
- RELEASE=`cat /etc/lsb-release | grep CODENAME | cut -d = -f2`
- cd /
- ##--[ ADDING REPOSITORIES TO SOURCE LIST ]-------------------------------------------------------------------
- ## Repositories make it easier to download and stay up-to-date with current releases of Linux applications
- 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 ### Test for Karmic, if so then comment out ###
- 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
- ##--[ ADDING NVIDIA REPOISOTIRES TO SOURCE LIST ]------------------------------------------------------------
- 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
- ##--[ ADDING PGP KEYS TO VERFIY VALID SOURCES ]--------------------------------------------------------------
- apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 318C7509 64234534 CEC06767 0x6D975C4791E7EE5E
- ##--[ RUNNING A SYSTEM UPDATE ]------------------------------------------------------------------------------
- apt-get update
- ##--[ INSTALL GENERIC NVIDIA GRAPHIC DRIVERS ]---------------------------------------------------------------
- apt-get install linux-headers-generic nvidia-glx-185 -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 ]----------------------------------------------------------------------
- apt-get install unzip -y
- cd /
- cd /home/xbmc/.xbmc/plugins/programs
- wget http://xbmc-addons.googlecode.com/svn/packages/plugins/programs/SVN_Repo_Installer.zip
- unzip -o SVN_Repo_Installer.zip
- rm SVN_Repo_Installer.zip
- chown -R xbmc:xbmc "SVN Repo Installer"
- ##--[ 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 xbmc
- 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
- ## --[ INSTALL Linux IR Remote Control Support]--------------------------------------------------------------
- #apt-get install lirc -y
- ## --[ FINAL SYSTEM UPGRADE ]--------------------------------------------------------------------------------
- apt-get update
- apt-get upgrade -y
- ## --[ 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 "xbmc" ]-----------------------------------------------------------------------------------
- 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 xbmc </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 xbmc </dev/tty1 > /dev/tty1 2>&1' >> /etc/init/tty1.conf
- fi
- echo 'case "`tty`" in' > /home/xbmc/.bash_profile
- echo '/dev/tty1) clear && startx &>/dev/null;;' >> /home/xbmc/.bash_profile
- echo 'esac' >> /home/xbmc/.bash_profile
- echo exec openbox-session > /home/xbmc/.xinitrc
- mkdir -p /home/xbmc/.config/openbox
- echo '#!/bin/bash' > /usr/local/bin/xbmc-session
- echo >> /usr/local/bin/xbmc-session
- echo 'until xbmc --standalone; do' >> /usr/local/bin/xbmc-session
- echo 'echo "uh oh xbmc crashed with code $?... restarting it" >$2' >> /usr/local/bin/xbmc-session
- echo 'sleep 5' >> /usr/local/bin/xbmc-session
- echo 'done' >> /usr/local/bin/xbmc-session
- chmod +x /usr/local/bin/xbmc-session
- echo xbmc-session > /home/xbmc/.config/openbox/autostart.sh
- chown -R xbmc:xbmc /home/xbmc
- #SYSTEM Reboot
- sync
- /sbin/reboot[/CODE]
- [B]NOTES[/B]
- I have tested this with Karmic minimal on an Acer Revo R1600. It needs to be tested with other versions, there are still some nice little options for ATI or NVIDIA, stable or bleeding edge also to do. I (or someone elase) has to add the extras repo back in for the supported versions.
- [B]ADDITIONS[/B]
- I've added autologin features, so once it reboots you'll be dropped right into XBMC, I would like to fix that part so if for some reason xbmc segfaults it will automatically be re-launched. The script now determines the version of ubuntu running and adds the correct repos.[CODE]#!/bin/bash -v
- #------------------------------------------------------------------------------------------------------------
- # setupXBMC Version 0.7a - 18/11/2009
- # XBMC Installation script - by VirtualDanny.net
- # This script will provide an automatic installation of Xbox Media Center
- #
- # REQUIREMENTS:
- # * Clean Ubuntu Jaunty Server Installation https://help.ubuntu.com/community/Installation/MinimalCD
- # * XBMC Compatible Hardware http://xbmc.org/wiki/?title=XBMC_for_Linux_specific_FAQ
- # * Internet access
- # * Username must be set to 'XBMC' under Ubuntu installation
- #
- # 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 smbd
- # * 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
- #------------------------------------------------------------------------------------------------------------
- ## --[ Miscellaneous variables ]------------------------------------------------
- RELEASE=`cat /etc/lsb-release | grep CODENAME | cut -d = -f2`
- cd /
- ##--[ ADDING REPOSITORIES TO SOURCE LIST ]-------------------------------------------------------------------
- ## Repositories make it easier to download and stay up-to-date with current releases of Linux applications
- 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 ### Test for Karmic, if so then comment out ###
- 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
- ##--[ ADDING NVIDIA REPOISOTIRES TO SOURCE LIST ]------------------------------------------------------------
- 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
- ##--[ ADDING PGP KEYS TO VERFIY VALID SOURCES ]--------------------------------------------------------------
- apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 318C7509 64234534 CEC06767 0x6D975C4791E7EE5E
- ##--[ RUNNING A SYSTEM UPDATE ]------------------------------------------------------------------------------
- apt-get update
- ##--[ INSTALL GENERIC NVIDIA GRAPHIC DRIVERS ]---------------------------------------------------------------
- apt-get install linux-headers-generic nvidia-glx-185 -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 ]----------------------------------------------------------------------
- apt-get install unzip -y
- cd /
- cd /home/xbmc/.xbmc/plugins/programs
- wget http://xbmc-addons.googlecode.com/svn/packages/plugins/programs/SVN_Repo_Installer.zip
- unzip -o SVN_Repo_Installer.zip
- rm SVN_Repo_Installer.zip
- chown -R xbmc:xbmc "SVN Repo Installer"
- ##--[ 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 xbmc
- 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
- ## --[ INSTALL Linux IR Remote Control Support]--------------------------------------------------------------
- #apt-get install lirc -y
- ## --[ FINAL SYSTEM UPGRADE ]--------------------------------------------------------------------------------
- apt-get update
- apt-get upgrade -y
- ## --[ 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 "xbmc" ]-----------------------------------------------------------------------------------
- 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 xbmc </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 xbmc </dev/tty1 > /dev/tty1 2>&1' >> /etc/init/tty1.conf
- fi
- echo 'case "`tty`" in' > /home/xbmc/.bash_profile
- echo '/dev/tty1) clear && startx &>/dev/null;;' >> /home/xbmc/.bash_profile
- echo 'esac' >> /home/xbmc/.bash_profile
- echo exec openbox-session > /home/xbmc/.xinitrc
- mkdir -p /home/xbmc/.config/openbox
- echo '#!/bin/bash' > /usr/local/bin/xbmc-session
- echo >> /usr/local/bin/xbmc-session
- echo 'until xbmc --standalone; do' >> /usr/local/bin/xbmc-session
- echo 'echo "uh oh xbmc crashed with code $?... restarting it" >$2' >> /usr/local/bin/xbmc-session
- echo 'sleep 5' >> /usr/local/bin/xbmc-session
- echo 'done' >> /usr/local/bin/xbmc-session
- chmod +x /usr/local/bin/xbmc-session
- echo xbmc-session > /home/xbmc/.config/openbox/autostart.sh
- chown -R xbmc:xbmc /home/xbmc
- #SYSTEM Reboot
- sync
- /sbin/reboot
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement