Preparing Debian Base Install for MythTV
Introduction
For a more general introduction of what these instructions are and why I wrote them, head over to my main MythTV page.
These instructions - really, more like a cheat sheet - are written for jessie (8.4). I presume you have --with-recommends (the default in jessie) enabled for aptitude.
While there is a little bit of hand-holding here, these instructions are not geared toward beginners. You should have a pretty solid background with Debian and a good understanding of how MythTV works in order to understand these instructions. Again, this really is just my notes cleaned-up a little.
Conventions
Code run as root
# run as root
Code run as regular or administrative user
$ run as user
Placeholder for appropriate argument in command
<parameter>
e.g.
$ sudo splashy_config --set-theme <theme>
Insert argument from list of options
<option1|option2>
e.g.
$ sudo aptitude install mysql-<client|server>
Edit file as reflected
filename:
...
Look for a line like this and change it as shown // if not obvious, original will be presented
...
Install Debian jessie
This is pretty straightforward: install Debian jessie as you normally would. At the task selection menu, install just the base or standard system. Do not install the full desktop system - you will get much more than you need.
Support Packages
I install a few extras during my automated Debian install. If you are using the stock installer provided by Debian, install the following extra packages:
# aptitude install plymouth [plymouth-themes-all] v86d sudo ssh screen \
usbutils hwinfo xfsprogs
sudo
Set sudoers
# visudo
My standard installation has three users: root (obviously), a "standard" account with very specific execute permissions allowed via sudo, and an "administrative" user with full execute access via sudo. The remainder of the commands provided here are run under the administrative account via sudo.
SUDOERS:
...
# User alias specification
User_Alias ADMINS = <super user account>
User_Alias USERS = <regular user account>
...
# Command alias specification
Cmnd_Alias REBOOT = /sbin/reboot
Cmnd_Alias HALT = /sbin/halt
...
# User privilege specification
...
ADMINS ALL = NOPASSWD: ALL
USERS ALL = NOPASSWD: REBOOT, HALT
...
Modify Hostname
Set hostname as appropriate, if not already done during installation:
$ sudo nano /etc/hostname
$ sudo hostname --file /etc/hostname
$ sudo nano /etc/hosts
Time Synchronization: ntp or ntpdate
Install ntp (preferred) to maintain proper time:
$ sudo aptitude install ntp
Alternately, install ntpdate and run on regular basis (change "M" in the sample crontab to a different, random number, between 0 and 59 of course):
$ sudo aptitude install ntpdate
$ sudo crontab -e
CRONTAB:
# m h dom mon dow command
M * * * * ntpdate 0.pool.ntp.org
Database: mysql
Install mysql-server for master backend, mysql-client (only) for frontend or slave backend:
$ sudo aptitude install mysql-<server|client>
For "public" master backends, change mysql bindings (nota bene - configuring as shown will permit ANYONE with network access to your machine to be able to access your mysql databases; use at your discretion):
$ sudo nano /etc/mysql/my.cnf
my.cnf:
...
bind-address = 0.0.0.0 # you also could be more specific, e.g. 192.168.0.2-192.168.0.255
...
$ sudo /etc/init.d/mysql restart
Finally, check for timezone information and install if needed. See MySQL Time Zone Tables at the MythTV Wiki for more information.
$ mysql tzinfo_to_sql /usr/share/zoneinfo | mysql -u root mysql
Sound: ALSA
Install ALSA and test it:
$ sudo aptitude install alsa-utils
$ sudo amixer | less
Review amixer results to make sure ALSA recognized your card correctly. If not, run alsaconf; see below.
$ sudo alsamixer
Move Master, PCM, (perhaps) Headphone, and (perhaps) Front to an appropriate level (~90%). If you are using a digital output, make sure it is not muted. Test your audio:
$ sudo speaker-test -c2 (tests two channels)
$ sudo speaker-test -c6 (tests six channels, i.e. 5.1)
Note: HDMI audio with NVidia cards may not work from the console. Test from within X.
Capture Card Drivers
Install capture card drivers if necessary.
IVTV and CX18 (e.g. Hauppauge HVR-1600) firmware (needed in wheezy):
- Obtain firmware (www.ivtvdriver.org for IVTV; see MythTV wiki for CX18)
- Extract into /usr/lib/hotplug/firmware
Graphical Display: X (x.org)
Install X and test it:
$ sudo aptitude install xserver-xorg xbase-clients \
fonts-linuxlibertine ttf-mscorefonts-installer \
[iceweasel | chromium] [vnc4server] xvnc4viewer \
openbox libxml2-dev menu obconf python ttf-dejavu roxterm thunar
$ startx
I choose to install a lightweight window manager, openbox, plus a file manager, thunar. If you want a more complete desktop environment complete with graphical login, install gdm and lxde.
I included the installer for the Microsoft core web fonts, since some of the MythTV themes still require these fonts. Note that ttf-mscorefonts-installer requires the contrib repository.
Add appropriate users to video, staff (for access to /usr/local), and powerdev groups
$ sudo adduser <user> <audio|video|staff|powerdev>
Display Drivers and Configuration
nVidia GeForce
Install display drivers for nVidia video cards, if needed
Method 1
Add contrib and non-free apt sources if not already done so.
$ sudo aptitude install nvidia-driver nvidia-xconfig
Refer to documentation for information on creating an appropriate xorg.conf file. Simple version:
$ sudo touch /etc/X11/xorg.conf
$ sudo nvidia-xconfig
Method 2
Add contrib and non-free apt sources if not already done so.
$ sudo aptitude install nvidia-kernel-dkms
Refer to documentation for information on creating an appropriate xorg.conf file.
Method 3 (Not Recommended)
- Download current nVidia driver package
- Install module-assistant to get the prerequisites for compiling kernel modules
- Quit X if running
$ sudo aptitude install module-assistant
$ sudo m-a prepare
$ chmod a+x NV*.run
$ sudo ./NV*.run
ATI/AMD FireGL and Radeon
Install display drivers for ATI or AMD video cards, if needed. You will need to add the non-free repository.
$ sudo aptitude install fglrx-control fglrx-driver
$ sudo aticonfig --initial
Graphical Boot: plymouth
Modify appropriate boot files.
/etc/initramfs-tools/modules:
...
uvesafb mode_option=800x600-16 mtrr=3 scroll=ywrap
...
/etc/default/grub:
...
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash modeset video=uvesafb:mode_option=800x600-16,mtrr=3,scroll=ywrap"
...
GRUB_GFXMODE=800x600-16
...
/etc/initramfs-tools/conf.d/splash:
...
FRAMEBUFFER=y
...
/etc/modprobe.d/disable-nouveau.conf:
...
blacklist nouveau
options nouveau modeset=0
...
Configure plymouth:
$ sudo plymouth-set-default-theme --list # list available themes
$ sudo plymouth-set-default-theme <theme>
$ sudo update-grub
$ sudo update-initramfs -u
$ sudo reboot
Remote Controls: lirc
Install lirc:
$ sudo aptitude install lirc
Modify your lirc configuration files.
/etc/lirc/hardware.conf:
...
DRIVER=""
DEVICE=/dev/lirc0
MODULES=<lirc_module, e.g. lirc_usbmce2; only if needed>
...
Then restart lirc
$ sudo service lirc restart
Test lirc by running irw and pressing some buttons on the remote control:
$ irw
Finished
System is ready for mythTV packages. Proceed to Installing MythTV.