User:Esev/LinuxMCE Install Notes

From LinuxMCE
Jump to: navigation, search

Install Core/Hybrid

I think the kernel that ships with 0810 is too old for my hardware. Several devices need updated drivers. These drivers need to be placed onto a USB drive before beginning. You can view all the hardware for my setup on the LinuxMCE Setup page.

Boot the Snapshot DVD

These instructions were created for 0810 snapshot 23326. When booting from the DVD, change the kernel options to include "all_generic_ide" http://ubuntuforums.org/showpost.php?p=5436513&postcount=7

Create four partitions

  1. 500MB ext3 for /boot
  2. 4GB swap
  3. 200GB ext3 for /
  4. Rest of the drive XFS for /home

First Boot

Get the primary network card (eth0) working

 # Using a USB drive, copy the drivers for r8168, r8169, e1000, and hid to /root/drivers
 # extract, compile, and install the r8168 driver
 depmod -a /lib/modules/`uname -r`/kernel/drivers/net/r8168.ko
 rmmod r8169
 modprobe r8168
 /etc/init.d/networking restart

Install sshd so I can complete the installation from the comfort of my couch

 apt-get update
 apt-get install openssh-server

More driver installs

 # Replace the buggy r8169 module so it doesn't incorrectly auto detect my primary network card
   make
   cp r8169.ko /lib/modules/`uname -r`/kernel/drivers/net/
   depmod -a /lib/modules/`uname -r`/kernel/drivers/net/r8169.ko
 # Install the driver for the secondary network card (eth1) (e1000e driver)
   cd src && make install
   modprobe e1000e
 # Install the updated HID driver to support the Gyration_GYR4101US remote
   make
   cp hid.ko /lib/modules/`uname -r`/kernel/drivers/hid/
   depmod -a /lib/modules/`uname -r`/kernel/drivers/hid/hid.ko
 # Rebuild initramfs
   echo "r8168" >> /etc/initramfs-tools/modules
   update-initramfs -uvk `uname -r` | tee ~/updateinit.txt

Setup a RAID 1 across both drives

First install mdadm

 apt-get install mdadm

Then follow the directions here making the changes noted below.

 # /dev/md0 is sd[ab]1 - /boot
   mdadm -C /dev/md0 -n2 -l1 -e1 missing /dev/sdb1
   mke2fs -j -L boot /dev/md0 
 # /dev/md1 is sd[ab]5 - swap
   mdadm -C /dev/md1 -n2 -l1 -e1 missing /dev/sdb5
   mkswap -L swap /dev/md1
 # /dev/md2 is sd[ab]6 - /
   mdadm -C /dev/md2 -n2 -l1 -e1 missing /dev/sdb6
   mke2fs -j -L root /dev/md2
 # /dev/md3 is sd[ab]7 - /home
   mdadm -C /dev/md3 -n2 -l1 -e1 missing /dev/sdb7
   mkfs.xfs -f -l size=64m -d agcount=4 -i attr=2,maxpct=5 -L home /dev/md3

Inside the /dev/md2 chroot, replace /etc/fstab with

 LABEL=root /               ext3    relatime,errors=remount-ro 0       1
 LABEL=boot /boot           ext3    relatime                   0       2
 LABEL=home /home           xfs     relatime,allocsize=512m    0       2
 LABEL=swap none            swap    sw                         0       0

Use the LABEL=root in the grub kernel arguments too

 title           Ubuntu 8.10, kernel 2.6.27-17-generic - drive 1
 root            (hd0,0)
 kernel          /vmlinuz-2.6.27-17-generic root=LABEL=root ro quiet splash                               
 initrd          /initrd.img-2.6.27-17-generic
 quiet
 
 title           Ubuntu 8.10, kernel 2.6.27-17-generic - drive 2
 root            (hd1,0)
 kernel          /vmlinuz-2.6.27-17-generic root=LABEL=root ro quiet splash
 initrd          /initrd.img-2.6.27-17-generic
 quiet

Adding /dev/sda to the RAID array takes around three hours to complete on my 1TB drives

Temporarily disable the firewall

When LinuxMCE is installed, it firewalls connections coming from the primary interface (eth0). Before installing, add the following to /etc/rc.local

 /sbin/iptables -P INPUT ACCEPT

This will be removed later after things are installed and the firewall can be properly configured from the web interface

Install LinuxMCE

At this point, the 0810 Installation Instructions can be followed.

AV Setup Wizard

After rebooting, video display will be lost. See Section II of the AV Setup Instructions. In my case, I needed to press '3' for Component video.

Adjust the firewall rules

Add the firewall rules: Advanced>Network>Firewall rules

  • Allow ports 80, 3306, 5900, and 22.
  • Then remove the iptables line that was added to /etc/rc.local

Configure Misc Settings

Reconfigure the DNS Server

Add the following to /etc/bind/named.conf.forwarders

 forwarders {10.234.32.194;};
 forward only;

Boost MySQL's RAM

The core has lots of RAM. Give more to MySQL to make it run faster. Edit /etc/mysql/conf.d/lmce-my.cnf and add

 innodb_buffer_pool_size=256M

Add MySQL users

 USE mysql;
 GRANT ALL PRIVILEGES ON pluto_main.* TO 'HADesigner'@'10.234.32.XXX' IDENTIFIED BY 'password';
 GRANT ALL PRIVILEGES ON *.* TO 'eric'@'10.234.32.XXX' IDENTIFIED BY 'password';
 FLUSH PRIVILEGES;

Install x11vnc

apt-get install x11vnc to start: x11vnc -display :0

MythTV Setup

Tame LinuxMCE's MythTV auto configuration

LinuxMCE does not have information about the cable providers in my area, so I need to hand-modify a few parameters to get things working properly.

  • For each of the tuner cards, go to the Antenna port and set the source to 1. This sets the source to be the LMCE-Default source, the source that is normally used when LinuxMCE auto configures things.
  • Launch the MythTV setup and go into 3. Video sources. Down arrow and choose LMCE-Default. Set it up with my schedulesdirect account. Now the LMCE-Default source contains valid data and will be used with the Antenna ports of my cards.

Modify mythweb to work with proxy

I have a HTTPS proxy running on my external firewall. The proxy accepts only HTTPS connections, then forwards those connections to where ever they need to go. This breaks mythweb, as it believes it is running over HTTP. The fix is to modify /var/www/mythweb/includes/defines.php. Search for $_SERVER['HTTPS'] = 'on'. In that if statement, add

  || $_SERVER['REMOTE_ADDR'] == '<ip_of_proxy>'

Increase the analog MPEG video quality

In MythFrontend, selecting 'Recording Profiles' from the 'TV Settings' menu. Change the default and LiveTV profiles. Make the video bitrate 7000000 and the max bitrate 8500000.

Install Family Room MD

TODO: Insert notes on gpxe and emulating a ZIP partition layout on a bootable USB

Begin by following the Automatic diskless boot of media directors instructions. The MAC address for this media director is 00:01:2e:23:66:ca.

After the install image is generated, some drivers need updating. Find the media director's root filesystem in /usr/pluto/diskless and perform the following

 cd <md_fs_dir>
 cp /lib/modules/`uname -r`/kernel/drivers/net/r816[89].ko lib/modules/`uname -r`/kernel/drivers/net/
 cp /lib/modules/`uname -r`/kernel/drivers/hid/hid.ko lib/modules/`uname -r`/kernel/drivers/hid/
 mount -t proc proc proc
 chroot .
 # inside the chroot
 echo "r8168" >> /etc/initramfs-tools/modules
 depmod -a
 update-initramfs -uvk `uname -r` | tee ~/updateinit.txt
 exit
 # outside the chroot
 umount proc