4. Configure XBMC

The final stage of the SlaXBMC HTPC platform setup involve configuring the newly installed XBMC application and Slackware OS so they provide the feeling would someone expect from a typical multimedia system like auto-load on restart, sound support and network sharing/browsing.
NOTE: For configuration of XBMC specific options i.e. re-mapping remote control keys, custom commands etc. please consult the XBMC Online Manual here.

The configuration instructions are shown below grouped by category type:
  1. System [Slackware]
    • Autostart X on reboot
      In console open file /etc/rc.d/rc.local for edit as follows
      DarkStar:~#joe /etc/rc.d/rc.local
      Type at the end of the file su - root -c startx & and then press Ctrl+K followed by X to exit Joe editor and save changes.

    • Autostart SSH server (optional)
      In console mode issue the following command:
      DarkStar:~#chmod 755 /etc/rc.d/rc.sshd
      ** NOTE: This configuration can prove useful in case we want to make modifications from a remote machine

  2. Fluxbox [X Windows]
    • Implement Fluxbox Auto-Load functionality
      In console open file ~/.fluxbox/init for edit as follows
      DarkStar:~#joe ~/.fluxbox/init
      Type at the end of the file session.screen0.rootCommand: sh ~/.fluxbox/autostart.sh and then press Ctrl+K followed by X to exit Joe editor and save changes.

    • XBMC Auto-Load Script
      In console mode open file ~/.fluxbox/autostart.sh for edit
      DarkStar:~#joe ~/.fluxbox/autostart.sh
      ,and type in the following code:
      #!/bin/bash
      while true ; do
      if [ "$(pidof xbmc.bin)" ] ; then
      sleep 3
      else
      /usr/lib/xbmc/xbmc.bin --standalone &
      fi
      if [ ! "$(pidof X)" ] ; then exit ; fi
      done
      Then save the file and exit by pressing Ctrl+K followed by X. Finally make the file executable by issuing the following command:
      DarkStar:~#chmod 755 ~/.fluxbox/autostart.sh

  3. Samba [Network Sharing] (optional)
    • Autostart SAMBA Services
      In console mode open file /etc/rc.d/rc.samba for edit
      DarkStar:~#joe /etc/rc.d/rc.samba
      ,and type in the following code:
      #!/bin/sh
      #
      # /etc/rc.d/rc.samba
      #
      # Start/stop/restart the Samba SMB file/print server.
      #
      # To make Samba start automatically at boot, make this
      # file executable: chmod 755 /etc/rc.d/rc.samba
      #

      samba_start() {
      if [ -x /usr/sbin/smbd -a -x /usr/sbin/nmbd -a -r /etc/samba/smb.conf ]; then
      echo "Starting Samba: /usr/sbin/smbd -D"
      /usr/sbin/smbd -D
      echo " /usr/sbin/nmbd -D"
      /usr/sbin/nmbd -D
      fi
      }

      samba_stop() {
      killall smbd nmbd
      }

      samba_restart() {
      samba_stop
      sleep 2
      samba_start
      }

      case "$1" in
      'start')
      samba_start
      ;;
      'stop')
      samba_stop
      ;;
      'restart')
      samba_restart
      ;;
      *)
      # Default is "start", for backwards compatibility with previous
      # Slackware versions. This may change to a 'usage' error someday.
      samba_start
      esac
      Then save the file and exit by pressing Ctrl+K followed by X. Finally make the file executable by issuing the following command:
      DarkStar:~#chmod 755 /etc/rc.d/rc.samba
      ** NOTE: This configuration file exist on every official Slackware released SAMBA package.
    (continued...)


« Previous12

No comments: