HOWTO: Minimal Debian Lenny + Dharma + Latest nVidia drivers + no window manager

  Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
gpuk Offline
Junior Member
Posts: 7
Joined: Jun 2010
Reputation: 0
Lightbulb  [LINUX]HOWTO: Very minimal Debian 5.0 on AcerRevo w/ Dharma and latest nvidia drivers
Post: #1
I'm posting this in the hope it may be useful to other Debian aficionados (or curious Ubuntu users who want to get closer to the action)....

[ Guide is based on the following hardware ]
  • Acer Aspire Revo R3600 nettop with 1GB RAM / 160GB HDD
  • Western Digital Elements 1TB USB2.0 Ext. HDD
  • Samsung SE-S084 Slim 8x DVD±RW DL RAM USB
[INDENT][/INDENT]My setup: Revo is connected to TV via HDMI, audio is analogue via 3.5mm jack (don't laugh!) and LAN connectivity is via an ethernet cable.

[ Objective ]
Turn the Revo in to a lean, dedicated xbmc and media streaming/storage box. The key goals are no bloat and no fluff - just a stripped down install of Debian Lenny with only the bare essentials necessary to get xbmc running (we're not even going to use a window manager). The advantage of this approach is that you end up with a very clean install of Debian and xbmc, making it easy to use the Revo for other hacking duties alongside running xbmc.


GUIDE STARTS HERE


1). Perform a minimal network install of Debian Lenny (remember to de-select both "Standard System" and "Desktop System" during the install wizard). Once Debian is installed, the base system should be using no more than 700MB or so of total disk space (well, we did say no fluff!).

[ for more info on performing a network install, see: http://www.debian.org/CD/netinst/ ]


2). Using the Revo provided keyboard, log in locally and:
  • install ssh
  • create some basic iptables rules
  • make any necessary changes to /etc/network/interfaces (e.g. give the Revo a static IP on your LAN and get 'pre-up' to call your iptables script).
  • make any necessary changes to /etc/resolv.conf
  • add contrib and non-free repositories to /etc/apt/sources.list


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


3). Install the kernel headers, alsa sound drivers (we're shunning pulse audio - too bloated and not needed for analogue audio!) plus some useful helper programs:

Code:
# aptitude install linux-headers-2.6.26-2-686 pciutils xorg wget lsof iptraf htop nmap tcpdump linux-sound-base alsa-base alsa-utils psmisc


4). Configure the audio:

Code:
# alsamixer
# alsactl store 0


5). Install the latest nvidia binary drivers:

Code:
# cd /usr/src
# wget http://uk.download.nvidia.com/XFree86/Linux-x86/260.19.36/NVIDIA-Linux-x86-260.19.36.run
# export CC=/usr/bin/gcc-4.1
# sh NVIDIA-Linux-x86-260.19.36.run


6). Grab the libvdpau headers so that xbmc can offload video processing to the GPU and support full, stutter free 1080p playback (this is necessary because nvidia has stopped including vdpau header files with their latest binary drivers):

Code:
# cd /usr/src
# wget http://cgit.freedesktop.org/~aplattner/libvdpau/snapshot/libvdpau-0.4.1.tar.gz
# tar zxvf libvdpau-0.4.1.tar.gz
# cp libvdpau-0.4.1/include/vdpau/* /usr/include/vdpau/  [ done because on Debian Lenny, `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 cvs make g++ gcc autoconf gawk pmount libtool quilt python-support autotools-dev libgl1-mesa-dev libglew-dev libvorbisenc2 libmysqlclient-dev libcurl3 libcurl4-openssl-dev libavahi-common-dev libavahi-client-dev libavcodec-dev libavformat-dev libavutil-dev libpostproc-dev libswscale-dev libdts-dev libmpeg2-4-dev libflac-dev libwavpack-dev python-dev libcwiid1-dev libbluetooth-dev zlib1g-dev libtiff4-dev libmicrohttpd-dev libmodplug-dev nasm automake cmake gperf unzip bison libogg0 libflac8 libsdl-dev libsdl-image1.2-dev libsdl-gfx1.2-dev libsdl-mixer1.2-dev libsdl-sound1.2-dev libsdl-stretch-dev libfribidi-dev liblzo2-dev libfreetype6-dev libsqlite3-dev libogg-dev libasound-dev python-sqlite libglew-dev libcurl4-dev x11proto-xinerama-dev libxinerama-dev libxrandr-dev libxrender-dev libmad0-dev libogg-dev libvorbis-dev libmysqlclient15-dev libpcre3-dev libdbus-1-dev libhal-dev libhal-storage-dev libjasper-dev libfontconfig-dev libbz2-dev libboost-dev libenca-dev libxt-dev libxmu-dev libpng-dev libjpeg-dev libpulse-dev mesa-utils libcdio-dev libsamplerate0-dev libmms-dev libxtst-dev zip libssl-dev libfaad-dev libsmbclient-dev libiso9660-dev


8). I hate using backports but we need one package from here to satisfy the xbmc build process:

Add "deb http://www.backports.org/debian lenny-backports main contrib non-free" (without the quotes) to /etc/apt/sources.list

and run:
Code:
# aptitude install debian-backports-keyring
# aptitude install libass-dev


9). Install the latest 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 Lenny, `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 ]


10). Compile and install Dharma stable:

Code:
# cd /usr/src
# wget http://mirrors.xbmc.org/releases/source/xbmc-10.0.tar.gz
# tar zxvf xbmc-10.0.tar.gz
# cd xbmc-10.0
# ./bootstrap
# ./configure --disable-pulse --enable-external-libass --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: No
prefix: /usr/local
------------------------

Then compile and install xbmc:

Code:
# make
# make install


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

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


12). Log-in as the new xbmc user and configure xinitrc so that xbmc automatically starts as soon as you type "startx" (thus 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 Lenny install with only the absolute minimum software required to run XBMC. To start xbmc, login locally as the xbmc user and type "startx".
(This post was last modified: 2011-02-17 19:26 by gpuk.)
find quote
gpuk Offline
Junior Member
Posts: 7
Joined: Jun 2010
Reputation: 0
Lightbulb   
Post: #2
Useful Optional Extras:

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

Code:
# nano /etc/fstab [ add: /dev/scd0       /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 to support auto-mounting an NTFS formatted external USB drive for media storage:

Code:
# aptitude install autofs ntfs-3g
# mkdir /mnt/removable
# nano /etc/auto.master [ add line: /mnt/removable  /etc/auto.removable     --timeout=120 ]
# nano /etc/auto.removable [ add line: usbdrive  -fstype=ntfs-3g,rw,sync,uid=1001,gid=110,umask=002,locale=en_GB.UTF8       :/dev/sdb1 ] Note: uid should be the xbmc user and gid should be the xbmc group id and you may also want to change locale to something more appropriate.
# /etc/init.d/autofs restart
# mkdir /media
# cd /media
# ln -s /mnt/removable/usbdrive /media/usbdrive
# ls -l /media/usbdrive  [ should show you the contents of the drive ]


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

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 [url]http://xbmc-iplayerv2.googlecode.com/files/IPlayer-v2.3.2.zip[/url]
# unzip IPlayer-v2.3.1.zip
# mv IPlayer plugin.video.iplayer
# rm IPlayer-v2.3.1.zip


5). Install up-to-date ffmpeg (needed for archiving BBC iplayer shows via 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 [url]http://ffmpeg.org/releases/ffmpeg-0.6.1.tar.gz[/url]
# cd ffmpeg-0.6.1
# ./configure
# make
# make install


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

Code:
# cd /usr/src
# wget [url]https://github.com/rg3/youtube-dl/raw/2010.12.09/youtube-dl[/url]
# 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.1.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 ############

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

#======================= Some Example 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/media_store

[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
(This post was last modified: 2011-02-17 19:29 by gpuk.)
find quote
xbmcvis Offline
Junior Member
Posts: 9
Joined: Aug 2010
Reputation: 0
Post: #3
thanks! great howto!
find quote
nicx Offline
Junior Member
Posts: 4
Joined: Jan 2010
Reputation: 0
Post: #4
thank you, i use it for update camelot to dhama on Lenny

thank you
find quote
bas.t Offline
Senior Member
Posts: 111
Joined: Dec 2010
Reputation: 0
Location: Baflo, The Netherlands
Post: #5
Anyone got a remote working? Preferrably a mce_usb (former mce_usb2)

There are tons of 'guides', but I did not succeed.
I'm building a custom kernel on squeeze right now, but any help is welcome.

Bas.
find quote
gpuk Offline
Junior Member
Posts: 7
Joined: Jun 2010
Reputation: 0
Post: #6
Updated version of the guide (for Debian Squeeze) is here: http://forum.xbmc.org/showthread.php?tid=106811

bas.t: I have an MCE remote and that's next on my "todo" list... will post a guide if I get it working (plan is to use lirc).
find quote
rashmi Offline
Junior Member
Posts: 11
Joined: Jun 2012
Reputation: 0
Post: #7
Hi ,
Thanks for the Xcellent Guide it works.
I wanted to know How to configure XBMC without X11 and to use only FrameBufferDisplays , for set-up-box kind of Boxes.
Please let me know it will be of a Great Help!!
Thanks,
Rashmi
find quote
RockerC Offline
Fan
Posts: 318
Joined: May 2011
Reputation: 3
Post: #8
(2012-06-12 12:36)rashmi Wrote:  Hi ,
Thanks for the Xcellent Guide it works.
I wanted to know How to configure XBMC without X11 and to use only FrameBufferDisplays , for set-up-box kind of Boxes.
Please let me know it will be of a Great Help!!
Thanks,
Rashmi
There is no need to cross-post asking the same question in three different threads, and re-opening old threads at that will also annoy people.

Again see http://forum.xbmc.org/showthread.php?tid=133722 and avoid cross-posting in the future, or no one will answer you out of spite Angry
find quote