diff options
author | lcapriotti <lcapriotti@svn> | 2010-08-23 13:52:51 +0000 |
---|---|---|
committer | lcapriotti <lcapriotti@svn> | 2010-08-23 13:52:51 +0000 |
commit | 4499512a4b4c1ac7d816840d25139e43c8e2ce5e (patch) | |
tree | 91c59a151b97f2b45895b98e1e5056a0b688802e /tools | |
parent | e1ad427892ba112cd2b58ff82509797b6d79a658 (diff) |
post-install customizations: setup XBMC sources, advanced settings for NVIDIA cards
git-svn-id: https://xbmc.svn.sourceforge.net/svnroot/xbmc/trunk@33067 568bbfeb-2a22-0410-94d2-cc84cf5bfa90
Diffstat (limited to 'tools')
-rw-r--r-- | tools/XBMCLive/SDK/buildLive/Files/binary_local-includes/Hooks/hwSetup_NVIDIA.sh | 23 | ||||
-rw-r--r-- | tools/XBMCLive/SDK/buildLive/Files/binary_local-includes/Hooks/setupSources.sh | 62 |
2 files changed, 85 insertions, 0 deletions
diff --git a/tools/XBMCLive/SDK/buildLive/Files/binary_local-includes/Hooks/hwSetup_NVIDIA.sh b/tools/XBMCLive/SDK/buildLive/Files/binary_local-includes/Hooks/hwSetup_NVIDIA.sh new file mode 100644 index 0000000000..36ae5f8e4b --- /dev/null +++ b/tools/XBMCLive/SDK/buildLive/Files/binary_local-includes/Hooks/hwSetup_NVIDIA.sh @@ -0,0 +1,23 @@ +#!/bin/bash + + +#check Nvidia GPU +nvidiaGpuType=lspci -nn | grep '03:00.0' | grep 'nVidia Corporation' +if [ ! -n "$nvidiaGpuType" ] ; then + exit 0 +fi + +xbmcUser=$(getent passwd 1000 | sed -e 's/\:.*//') + +mkdir -p /home/$xbmcUser/.xbmc/userdata + +if ! -f /home/$xbmcUser/.xbmc/userdata/advancedsettings.xml ; then + cat > /home/$xbmcUser/.xbmc/userdata/advancedsettings.xml << EOF +<advancedsettings> + <gputempcommand>echo "$(nvclock -T | sed -ne "s/=> GPU temp.*: \([0-9]\+\).*/\1/p") C"</gputempcommand> + <useddsfanart>true</useddsfanart> +</advancedsettings> +EOF +fi + +chown -R $xbmcUser:$xbmcUser /home/$xbmcUser/.xbmc
\ No newline at end of file diff --git a/tools/XBMCLive/SDK/buildLive/Files/binary_local-includes/Hooks/setupSources.sh b/tools/XBMCLive/SDK/buildLive/Files/binary_local-includes/Hooks/setupSources.sh new file mode 100644 index 0000000000..b2519f87ba --- /dev/null +++ b/tools/XBMCLive/SDK/buildLive/Files/binary_local-includes/Hooks/setupSources.sh @@ -0,0 +1,62 @@ +#!/bin/sh + +xbmcUser=$(getent passwd 1000 | sed -e 's/\:.*//') + +# +# Create directories for XBMC sources +# + +if [ ! -d "/home/$xbmcUser/Music" ]; then + mkdir /home/$xbmcUser/Music + chmod 755 /home/$xbmcUser/Music +fi + +if [ ! -d "/home/$xbmcUser/Pictures" ]; then + mkdir /home/$xbmcUser/Pictures + chmod 755 /home/$xbmcUser/Pictures +fi + +if [ ! -d "/home/$xbmcUser/TV Shows" ]; then + mkdir "/home/$xbmcUser/TV Shows" + chmod 755 "/home/$xbmcUser/TV Shows" +fi + +if [ ! -d "/home/$xbmcUser/Videos" ]; then + mkdir /home/$xbmcUser/Videos + chmod 755 /home/$xbmcUser/Videos +fi + +mkdir -p /home/$xbmcUser/.xbmc/userdata + +if [ ! -f /home/$xbmcUser/.xbmc/userdata/sources.xml ] ; then + cat > /home/$xbmcUser/.xbmc/userdata/sources.xml << 'EOF' +<sources> + <video> + <default pathversion="1"></default> + <source> + <name>Videos</name> + <path pathversion="1">/home/xbmc/Videos/</path> + </source> + <source> + <name>TV Shows</name> + <path pathversion="1">/home/xbmc/TV Shows/</path> + </source> + </video> + <music> + <default pathversion="1"></default> + <source> + <name>Music</name> + <path pathversion="1">/home/xbmc/Music/</path> + </source> + </music> + <pictures> + <default pathversion="1"></default> + <source> + <name>Music</name> + <path pathversion="1">/home/xbmc/Pictures/</path> + </source> + </pictures> +</sources> +EOF + +chown -R $xbmcUser:$xbmcUser /home/$xbmcUser/.xbmc |