[LINUX]HOWTO: Barebones Debian 6.0 on AcerRevo w/ Dharma and latest nvidia drivers
#1
Star 
I'm posting this in the hope it may be useful to other Debian fans....

Guide is based on the following HTPC setup:
  • Acer Aspire Revo R3601 nettop with 1GB RAM / 160GB HDD
  • Western Digital Elements 1TB USB2.0 Ext. HDD
  • Samsung SE-S084 Slim 8x DVD±RW DL RAM USB
Revo is connected to TV via HDMI, audio is analogue via 3.5mm jack (hey, it works!) and LAN connectivity is via ethernet cable.

The Objective:
Perform a very minimal Debian Squeeze install, with only the absolute bare essentials necessary to get xbmc up and running (we're not even going to need a window manager). This leaves the Revo in fine shape to perform other hacking duties alongside the HTPC stuff. For example, I also use mine as an ADSL router (with the aid of a Draytek Vigor 120 and TRENDnet TU2 ET100).


GUIDE STARTS HERE


1). Perform a minimal network install of Debian Squeeze:
  • choose linux-image-2.6-686 for the kernel
  • when asked by the install wizard (tasksel) what software should be pre-installed, de-select EVERYTHING (including "Standard System Utilities"). Once installed, the base system should be using no more than 600MB or so of available disk space.
  • make sure to include the contrib and non-free apt sources in /etc/apt/sources.list
  • do not create a separate user in addition to the root account (we'll create an extra user account later in the guide)

For more info on performing a network install see http://www.debian.org/CD/netinst/ and http://unetbootin.sourceforge.net/ (if you want to install off a usb stick)


2). Using the Revo provided keyboard, log in locally as root and:
  • make any necessary changes to /etc/network/interfaces (e.g. give the Revo a static IP on your LAN).
  • create some basic iptables rules (if desired)
  • make any necessary changes to /etc/resolv.conf
  • check /etc/apt/sources.list is pointing to the right mirrors and has contrib and non-free sources
  • install ssh

For the remaining part of the guide, we'll do everything remotely over ssh as root


3). Install kernel headers, dev tools, Xorg and some useful helper programs:

Code:
# aptitude update
# aptitude install linux-headers-2.6-686 sysstat lsof ntp cmake gcc g++ bison make libncurses5-dev sqlite3 pciutils psmisc iptraf tcpdump htop fakeroot python openssl libssl-dev patch menu file perl ca-certificates sudo whois locales netcat screen locate xorg


4). Install latest nvidia binary drivers:

Code:
# vi /etc/default/grub [ change GRUB_CMDLINE_LINUX_DEFAULT="quiet" to GRUB_CMDLINE_LINUX_DEFAULT="quiet nomodeset" / this is done to disable the nouveau driver which conflicts with the nvidia binary driver ]
# update-grub
# shutdown -r now
# aptitude install module-assistant build-essential
# m-a update
# m-a prepare
# cd /usr/src
# wget http://uk.download.nvidia.com/XFree86/Linux-x86/275.21/NVIDIA-Linux-x86-275.21.run
# export CC=gcc-4.3
# sh NVIDIA-Linux-x86-275.21.run [ allow installer to update X config when prompted ]
# shutdown -r now
# aptitude install libvdpau1 libvdpau-dev [ IMPORTANT: you need these if you want XBMC to be able to make use of the GPU i.e. to get stutter free 1080p playback ]


5). Configure the audio:

We're going with ALSA as pulse audio is too bloated and not needed for analogue

Code:
# aptitude install linux-sound-base alsa-base alsa-utils
# alsactl init
# alsamixer [ set volume levels ]
# alsactl store 0


6). Compile and install the latest stable version of rtmpdump:

Code:
# cd /usr/src
# wget http://rtmpdump.mplayerhq.hu/download/rtmpdump-2.3.tgz
# tar zxvf rtmpdump-2.3.tgz
# cd rtmpdump-2.3
# make SYS=posix
# make install
# ln -s /usr/local/lib/librtmp.so /usr/lib/librtmp.so  [ done because on Debian Squeeze, `cc -print-search-dirs` does not include the /usr/local/lib path by default which results in xbmc configure throwing an "Unable to determine soname of librtmp library" error ]


7). Install the minimum third party libraries required to successfully compile xbmc:

Code:
# aptitude install quilt python-support cmake autotools-dev autoconf automake zip unzip libboost-dev libgl1-mesa-dev libgl-dev libglu-dev libglew-dev libmad0-dev libjpeg-dev libsamplerate-dev libogg-dev libvorbis-dev libvorbisenc2 libfreetype6-dev libfontconfig-dev libbz2-dev libfribidi-dev libsqlite3-dev libmysqlclient-dev libasound-dev libpng-dev libpcre3-dev liblzo2-dev libcdio-dev libsdl-dev libsdl-image1.2-dev libsdl-mixer1.2-dev libenca-dev libjasper-dev libxt-dev libxtst-dev libxmu-dev libxinerama-dev libcurl3 libcurl4-gnutls-dev libcurl-dev libdbus-1-dev libhal-storage-dev libhal-dev libpulse-dev libavahi-common-dev libavahi-client-dev libxrandr-dev libavfilter-dev libavdevice-dev libavcodec-dev libavformat-dev libavutil-dev libpostproc-dev libswscale-dev liba52-dev libdts-dev libfaad-dev libmpeg2-4-dev libass-dev libflac-dev libwavpack-dev python-dev gawk gperf nasm libcwiid1-dev libbluetooth-dev zlib1g-dev libmms-dev libsmbclient-dev libtiff4-dev libiso9660-dev libssl-dev libmicrohttpd-dev libmodplug-dev libssh-dev gettext cvs libtool



8). Configure, compile and install Dharma stable:

Code:
# cd /usr/src
# wget http://mirrors.xbmc.org/releases/source/xbmc-10.1.tar.gz
# tar zxvf xbmc-10.1.tar.gz
# cd xbmc-10.1
# ./bootstrap
# ./configure --disable-pulse --enable-external-libass --enable-external-python --enable-rtmp --enable-vdpau

You should get the following after configure has run:
------------------------
XBMC Configuration:
------------------------
Debugging: Yes
Profiling: No
Optimization: Yes
Crosscomp.: No
target ARCH: no
target CPU: no
OpenGL: Yes
VDPAU: Yes
VAAPI: No
CrystalHD: No
VDADecoder: No
OpenMax: No
Joystick: Yes
XRandR: Yes
GOOM: No
Bluray: No
MID Support: No
ccache: No
PulseAudio: No
HAL Support: Yes
FAAC: No
DVDCSS: Yes
Avahi: Yes
Non-free: Yes
ASAP Codec: No
Webserver: Yes
libRTMP support: Yes
Deprecated libdts: No
Deprecated liba52: No
External FFmpeg: No
External Python: Yes
prefix: /usr/local
------------------------

Then compile and install xbmc:

Code:
# make
# make install


9). Create an xbmc user (rather than running xbmc as root):

Code:
# groupadd xbmc
# useradd -d /home/xbmc -m -s /bin/bash -g xbmc -G audio xbmc
# passwd xbmc


10). Log-in as the new xbmc user and configure xinitrc so that xbmc automatically starts as soon as you type "startx" (negating the need for a window manager):

Code:
# echo "exec /usr/local/bin/xbmc" > ~/.xinitrc



That's it! You now have a bare bones Debian Squeeze install with only the absolute minimum software required to run XBMC. To start xbmc, login locally as the xbmc user and type "startx".
Reply
#2
Lightbulb 
Useful Optional Extras:

1). Add an entry to fstab to support a USB CD/DVD drive:

Code:
# vi /etc/fstab [ add: /dev/sr0       /mnt/cdrom0   udf,iso9660 user,noauto     0       0 ]
# mkdir /mnt/cdrom0
# mkdir /media
# ln -s /mnt/cdrom0 /media/cdrom


2). Install autofs and ntfs-3g if using an NTFS formatted external USB drive for media storage

Code:
# aptitude install autofs ntfs-3g
# mkdir /mnt/removable
# vi /etc/auto.master [ comment out +auto.master line if present and add: /mnt/removable    /etc/auto.removable    --timeout=1800 ]
# vi /etc/auto.removable [ add: usbdrive  -fstype=ntfs-3g,rw,sync,uid=1000,gid=1000,umask=002,locale=en_GB.UTF8       :/dev/sdb1 ] Note: uid should be the xbmc user, gid should be the xbmc group and locale should be whatever is appropriate for you
# /etc/init.d/autofs restart
# mkdir /media
# ln -s /mnt/removable/usbdrive /media/usbdrive
# ls -l /media/usbdrive


3). Install samba, samba-common and libcups2 to share the USB drive across the network (useful for exposing your media to other devices):

Code:
# aptitude install samba samba-common libcups2
# cp /etc/samba/smb.conf /etc/samba/smb.conf.bak
# nano /etc/samba/smb.conf [ see end of post for an example samba configuration ]
# smbpasswd -a xbmc
# /etc/init.d/samba restart


4). Install the BBC iplayer plugin for xbmc (only of interest if you are in the UK and want to access the BBC iplayer service via xbmc):

Code:
# cd /home/xbmc/.xbmc/addons/
# wget http://xbmc-iplayerv2.googlecode.com/files/iPlayer-v2.4.12.zip
# unzip iPlayer-v2.4.12.zip
# rm iPlayer-v2.4.12.zip


5). Install get_iplayer (again, this is only of interest if you are in the UK, use the BBC iplayer service and want to archive some programmes for personal use):

Code:
# cd /usr/src
# wget ftp://ftp.infradead.org/pub/get_iplayer/get_iplayer-2.79.tar.gz
# tar zxvf get_iplayer-2.79.tar.gz
# cp /usr/src/get_iplayer-2.79/get_iplayer /bin/
# cpan LWP [ allow perl to download and install whatever extra dependencies are required to satisfy LWP ]
# chmod 750 /bin/get_iplayer


6). Install youtube-dl (great for downloading youtube videos for later playback through xbmc):

Code:
# cd /usr/src
# wget https://github.com/rg3/youtube-dl/raw/2011.03.29/youtube-dl
# chmod 750 youtube-dl
# mv youtube-dl /usr/bin


Finally, here is an example /etc/samba/smb.conf for sharing a USB hard drive via eth0 (don't forget to open the necessary ports on the firewall):

[CODE]#======================= Global Settings =======================

[global]

## Browsing/Identification ###

workgroup = WORKGROUP
server string = %h server
dns proxy = no

#### Networking ####

interfaces = lo eth0
bind interfaces only = yes
hosts deny = all

# You may need to change the following line to correspond to your network address scheme
hosts allow = 127.0.0.1 192.168.2.0/255.255.255.0

#### Debugging/Accounting ####

log file = /var/log/samba/log.%m
max log size = 1000
syslog only = no
syslog = 0
#panic action = /usr/share/samba/panic-action %d

####### Authentication #######

security = user
encrypt passwords = true
passdb backend = tdbsam
obey pam restrictions = yes
unix password sync = yes
passwd program = /usr/bin/passwd %u
passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* .
pam password change = yes

############ Misc ############

read size = 65536
read prediction = true
socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192
winbind enum groups = yes
winbind enum users = yes
printcap name = /etc/printcap
load printers = no
printing = cups
printcap name = /dev/null
disable spoolss = yes
dos charset = CP850
unix charset = UTF-8
display charset = UTF-8

#======================= Share Definitions =======================

[xbmc_mediadir]
comment = XBMC Media Directory
browseable = yes
read only = no
create mask = 0750
directory mask = 0750
valid users = xbmc
# This is the path to the root folder of your media storage on the external hard drive (note: folder should be read and writable by the xbmc user)
path = /media/usbdrive/xbmc_media

[cdrom]
comment = XBMC CD Drive
read only = yes
locking = no
path = /media/cdrom
guest ok = yes
preexec = /bin/mount /media/cdrom
postexec = /bin/umount /media/cdrom
Reply

Logout Mark Read Team Forum Stats Members Help
[LINUX]HOWTO: Barebones Debian 6.0 on AcerRevo w/ Dharma and latest nvidia drivers0