Building a Linux-Driven Digital Picture Frame, Part 2
- Installing muLinux
- The Picture Frame Code
- Creating the Case
- Various Problems
It's time to continue our project for turning an old laptop into a digital picture frame. In part 1 we determined system requirements and cost, decided to use Linux as the OS, and purchased the parts. This time we'll load Linux and put everything together.
Installing muLinux was not as easy as I would have hoped. On a scale of 1-10 for Linux installations, muLinux rates around a 5. However, most of the annoyances are by design. While it does support a permanent installation via a process called cloning, muLinux was initially created to be a temporary floppy/RAM-based OS. The following sections outline the steps required to install muLinux onto the hard drive.
The complete muLinux OS is downloadable as 13 separate packages, plus a DOSTOOLS file for Windows-based installations. All of these files should be placed into the c:\mulinux folder on a Windows-based computer with a floppy drive. Once all the files are downloaded, you can create the installation disks.
You'll need the following:
- Working Windows computer
- 13 blank 1.44MB floppies
- Target laptop
- BIOS for all involved computers configured to boot from floppy
Here's how you create the installation disks:
- Place all files into the c:\muLinux folder on the Windows computer.
- Unzip DOSTOOLS.zip into the c:\mulinux folder.
- Reboot into MS-DOS and change to the c:\mulinux folder.
- Execute unpack.bat to extract the core OS files from mulinux-13r2.tgz.
- Execute makefi to create an installation disk.
- Leave the newly created Install disk in the floppy drive and reboot the computer.
- Once the installation program loads, select option  to create a boot disk.
- Continue through the package-installation routine until all add-on disks have been created.
Installing muLinux is accomplished via a process called cloning that transfers the OS files stored in memory to the hard drive for permanent storage. To do this, muLinux must first be loaded into RAM with a few necessary components. Following are the steps needed to complete the cloning.
First, the initial muLinux boot (loading muLinux into RAM):
- Insert the boot floppy into the target computer and boot it up to the first configuration screen.
- Hit [y] for swap space configuration.
- Select 1 to "choice a swap partition" [sic].
- Confirm the swap-partition selection.
- Enter the swap size and confirm the configuration.
- Hit [y] for /usr partition configuration.
- Select [y] for the SRV add-on and insert the SVR package disk.
- Select [n] for the remainder of the package options: X11, NS1, NS2, GCC, TCL, VNC, TEX, PERL, EMU, and JVM.
- Select the "lazy" model. (Use the spacebar to select and Enter to confirm.)
- Reinsert the startup floppy.
- Enter the profile name.
- Select the No option for the tour.
- Login using the root account.
Creating the clone (you can try to repartition at this time):
- Type clone at the prompt.
- Select  for filesystem type.
- Hit [n] for repartition.
- Select install partition (Linux Native).
- Select  LILO for the boot loader.
- Select /dev/fd0 (floppy drive) for the boot partition.
- Confirm the installation configuration settings and start the copy routine.
- Configure the kernel options according to your laptop's specifications (default).
- Insert the boot disk for LILO (Linux Loader, used to keep Linux off the MBR).
- Hit Enter "and give yourself a congratulatory pat on the back!!!"
- Type setup -s to save your settings. (Do this anytime you run setup or menu.)
- At the /root prompt, type shutdown -r now to reboot.
When the system reboots, it will prompt you for various configuration options. For the most part, these options were set to the default. The only exception in my case was the mouse. As I learned, using X requires a mouse that's properly configured. The easiest method was to keep a mouse connected during the initial setup of muLinux. Once the setup was complete, the mouse can be removed.
At the login, type root and press Enter. This will put you at the command line. You then need to type setup to load the muLinux setup program (see Figure 1). From this screen, you can install all the necessary add-ons to turn your laptop into a picture viewer.
Figure 1 Setup v14r0 screen.
The top menu of Setup v14r0 lists the main packages you can add. Below that is a list of the programs and services that can be enabled, configured, or disabled. You must have the corresponding add-on installed before you can use it. Unfortunately, it's not always easy to tell which add-on includes the program you need.
The key to controlling resources on the DPF is to limit the number of programs running. For example, there's no need to load ssh or Samba. These programs just take up valuable RAM and can result in slower image-load times.
To create a digital picture frame, you need to load the add-ons in the following table.
Provides key files used to manage the system
Provides key files used to manage the system
Required for X Window System support
NS1 and NS2
Required for SVGA driver support
Loads the image-viewer program called xli (discussed later)
Once you have all these add-ons installed, make sure that you save the setup (Press the [s] key in the Setup program or type setup -s at the command line.) You must save the configuration each time you change something, or you'll lose your changes when the computer is turned off. Once the save is complete, reboot the system, which will prompt you again with several configuration options. Bypass these and log back into root. Again, save the settings using setup -s.
Setting Up X
Setting up X to work on your laptop might be the most challenging aspect of this whole process. Before doing anything, you have to know the key specifications needed by the X program. Fortunately, I was able to learn that my laptop video chip was a Cirrus CL-GD7543. Armed with this information, I learned that my display had the settings shown in the following table.
8 or 16
With this information noted, I had two choices. First, I could run a program called xprobe to set up my X configuration file located in /etc/X11 and called XF86Config. My second option was to use the "menu" program wizard included with muLinux to assist with the general configuration tasks. Both options perform the same actions, except that the wizard provides more choices that can help get your X session up and running.
To set up X, follow these steps:
- Type menu at the command line and press Enter.
- Arrow down to Configuration Wizards and press Enter (see Figure 2).
- Arrow down to XWindow and Video Setup and press the spacebar followed by Enter (see Figure 3).
- At X server menu, arrow down to Super-VGA cards; press the spacebar and then Enter (see Figure 4).
- From the Setup Method menu, select user defined or modeline probing and use your known settings to fill in the blanks. Once this info is complete, you'll have a chance to confirm the settings (see Figure 5).
- Exit the menu and type startx to execute XWindows & Fvwm95.
Figure 2 The Menu menu.
Figure 3 The Configuration Wizards menu.
Figure 4 Selecting SVGA support.
Figure 5 Confirming the detected/entered settings.
Now it's time to fix X. Please note that X may or may not load, depending on the success of the wizard. If it fails, you can troubleshoot using the information in /var/log/startx.log. To see this information, use the following command:
cat /var/log/startx.log | more
or open the log file in vi. To get X working correctly on my laptop, I had to alter the VertRefresh entry in the Monitor section from VertRefresh 70 to VertRefresh 50-70. This small change made all the difference to X—as well as to my sanity, as I spent a good hour troubleshooting this problem.
Note on vi: Linux/UNIX users must be familiar with the editing program called vi. This little tool is one of the icons of the older UNIX days, where everything was done via a text screen. vi does take some getting used to; however, 95% of what you'll need to do requires knowing only these few keystrokes:
- Move the cursor around the file using the arrow keys.
- Press x to delete a character and d to delete a line.
- Press i to start insert mode, where you can add and change existing characters.
- Pressing Esc exits insert mode.
- Press q to quit. Typing q! will quit without saving, and wq will write out (save) and then quit.
- Shift-z-z to save and exit.
Once X loads with fvwm95 serving up the graphics, you should be rewarded with a basic GUI with several programs running on the desktop. Take a look around and see how they work, because they won't be there for long! At this point you can take a break. The hard part is over, and the basic system is working. All that's left is some custom scripting, tweaking xli, creating the frame, uploading the pictures, and of course lots of testing...on second thought, it might be too early to celebrate!