Diskless MiniMyth Frontend



Update: much of this information is now out-of-date. Please see the official MiniMyth documentation for more recent instructions.

Introduction

The easiest way to get MythTV working on an Epia based system is to use the MiniMyth distro. This allows the frontend to boot over the network and straight into MythTV. The advantage of this is that very quiet, cheap and frugal thin client hardware can be used. The main restriction is that the box won't be of much use as anything other than a MythTV Frontend. It must also boot over a wired network using the onboard NIC - wireless is not an option.

Most of the work is on the system which will be used as the netboot server. I'll be using my MythTV backend running Ubuntu in this example, but any Linux box can be used.

One important consideration is that the netboot server will have to act as a DHCP server. In my home network, this used to be the job of my Netgear ADSL router, but this must be disabled for netbooting to work. It sounds scary, but is pretty easy to get working. I'll cover it all in the guide.

See here for details of the hardware I used.

Router Setup

As the backend must act as a DHCP server, I decided that it would be best if it provided DHCP services for my entire network. So, the first thing to do was disable DHCP in my router. This was a simple matter of unchecking a tick box on the web-based Netgear admin interface. Once this is done, you must change each of your systems to either have a static IP address or add it to the DHCP server configuration - which we'll cover later.

One thing you must do is set your DHCP server to have a fixed address. So, your /etc/network/interfaces file should have an entry such as:

auto eth0
iface eth0 inet static
  hostname ripley
  address 192.168.0.3
  netmask 255.255.255.0
  gateway 192.168.0.1

DHCP Server

A DHCP server assigns IP addresses to systems on the network which are configured to ask for an address at bootup. First of all, we'll install the server itself on our MythTV Backend system:

sudo apt-get update
sudo apt-get install dhcp

Here's my /etc/dhcpd.conf file. Each box is identified by its unique MAC address and is assigned an IP address. The MiniMyth system has its own section which specifies the TFTP server (the same box) and a file to supply to the netboot request coming from the Epia box.

option domain-name "local";
option domain-name-servers netgear;  # ADSL router
option subnet-mask 255.255.255.0;

allow bootp;
allow booting;

subnet 192.168.0.0 netmask 255.255.255.0 {
  option routers netgear;
  #range 192.168.0.1 192.168.0.100;

  # Normal systems
  group {
    host bane     {hardware ethernet 00:E0:4C:BB:51:25; fixed-address 192.168.0.2; }
    host hetfield {hardware ethernet 00:0B:CD:5A:4A:32; fixed-address 192.168.0.3; }
    host ipaq     {hardware ethernet 00:02:78:F0:AE:57; fixed-address 192.168.0.4; }
    host ferro    {hardware ethernet 00:0E:2E:84:87:28; fixed-address 192.168.0.5; }
  }

  # Diskless systems
  group {
    use-host-decl-names on;
    option ntp-servers ripley;
    host ferro {
      hardware ethernet 00:40:63:de:d1:5c;
      fixed-address 192.168.0.10;
      next-server ripley;            # IP address of your TFTP server
      filename "PXEClient/pxelinux.0";
    }
  }
}

Restart the DHCP daemon to pickup the changes:

sudo /etc/init.d/dhcp restart

TFTP Server

TFTP (Trivial File Transfer Protocol) is a simplified version of FTP. It requires very little resource and configuration, which makes it ideal for use by a thin client. We'll install the Advanced TFTP Daemon and the tftp-hpa client (used for testing).

sudo apt-get install tftp-hpa atftpd

sudo mkdir /tftpboot
sudo chmod a+rwx /tftpboot

Edit config to start as a daemon, /etc/default/atftpd

USE_INETD=false

Start the server:

sudo /etc/init.d/atftpd start

You can test the server by putting a file into /tftpboot and running the following command:

cd /tmp
tftp localhost -c get testfile

PXE Setup

PXE (Pre-Execution Environment) is a method of booting computers over the network. It basically requires certain files to be placed in certain places in your /tftpboot directory. Once this is done, your Epia box will be pointed to the structure by your DHCP server and should happily download the appropriate kernel and boot.

The first thing which is required is a PXE data file called pxelinux.0. This is availabe in the syslinux package. We'll install the package and copy the relevant file to the correct directory (note that pxeclient.cfg is a directory and not a file):

sudo apt-get install syslinux
dpkg -L syslinux | grep pxe

sudo mkdir /tftpboot/PXEClient
sudo cp /usr/lib/syslinux/pxelinux.0 /tftpboot/PXEClient

sudo mkdir /tftpboot/PXEClient/pxelinux.cfg

Download MiniMyth

The next thing to do is download MiniMyth and place it in the correct place in the PXE directory hierarchy. Assuming that your backend is running MythTV 0.19, the latest version of MiniMyth can be downloaded from here.

Copy the files into /tftpboot/PXEClient E.g.:

sudo cp kernel-minimyth-0.19-12 /tftpboot/PXEClient
sudo cp rootfs-minimyth-0.19-12 /tftpboot/PXEClient
sudo cp minimyth.conf /tftpboot/PXEClient/conf/default

Edit minimyth.conf

The MiniMyth config file contains all of the config for the distro. It is very well commented, so just follow the instructions and edit it to your requirements. For reference, here's what I changed (I'm using a monitor and not a TV):

MM_TZ='Europe/London'

MM_HARDWARE_MOTHERBOARD=VIA_EPIA_SP

MM_X_VGA_ENABLED=yes
MM_X_TV_ENABLED=no
MM_X_RESOLUTION_X=1024
MM_X_RESOLUTION_Y=768

MM_MYTH_SERVER=
MM_MYTH_DBUSERNAME='mythtv'
MM_MYTH_DBPASSWORD='mythtv'
MM_MYTH_DBNAME='mythconverg'

PXE Config

The final step is to configure PXE config with the name of your MiniMyth kernel. Create a file called /tftpboot/PXEClient/pxelinux.cfg/default and add the following:

  DEFAULT minimyth
  LABEL minimyth
    KERNEL kernel-minimyth-0.19-12
    APPEND ro root=/dev/ram0 initrd=rootfs-minimyth-0.19-12 ramdisk_blocksize=4096 ramdisk=640000x

All Files

Here's a full listing of my /tftpboot directory for reference:

/tftpboot/PXEClient/pxelinux.0
/tftpboot/PXEClient/kernel-minimyth-0.19-12
/tftpboot/PXEClient/rootfs-minimyth-0.19-12

/tftpboot/PXEClient/pxelinux.cfg/default

/tftpboot/PXEClient/conf/default/minimyth.conf

BOIS Setup

To tell the Epia box to boot from the network is a simple matter of changing come settings in the BOIS. Here's how I did it on my Epia SP:

Turn on the system and hit DEL while it's displaying the "Via Embedded Platform" logo to enter the Phoenix Award BIOS.

Change "Integrated Peripherals->Onboard Lan Boot ROM" to Enabled.

Save the settings and the system should reboot. During bootup, you should see the following message:

Press [Shift-Tab] key to display network boot option menu

Hit [Shift+Tab] quickly to catch this menu, then specify option 3 to try the network boot first.

With any luck, your shiny new MiniMyth system will bootup. If you have problems, check /var/log/daemon.log on your backend for DHCP errors.

Feel free to email if you have any questions.

References


Leave a comment.