Building a Linux-Driven Digital Picture Frame, Part 2

Date: Mar 25, 2005 By Seth Fogie.

In part 2 of his series on converting an old laptop into a digital picture frame, Seth Fogie loads Linux and assembles the finished product.

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 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. NOTE If you have the ability, create two partitions on the target computer prior to installation. One needs to be ext2 and the other should be Linux Swap (82). Generally, the swap space should be at least the size of your system's RAM. The cloning process includes the ability to create partitions, but it's easier to use a program such as Symantec's PartitionMagic.

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:
q q q q

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: 1. 2. 3. 4. Place all files into the c:\muLinux folder on the Windows computer. Unzip 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.

type shutdown -r now to reboot. Select /dev/fd0 (floppy drive) for the boot partition. used to keep Linux off the MBR). 9. 4. 6. You then need to type setup to load the muLinux setup program (see Figure 1). Confirm the swap-partition selection. Hit [y] for /usr partition configuration. b. 3. c. NS2. Continue through the package-installation routine until all add-on disks have been created. Select [y] for the SRV add-on and insert the SVR package disk. Installation Installing muLinux is accomplished via a process called cloning that transfers the OS files stored in memory to the hard drive for permanent storage. Once the installation program loads. This will put you at the command line. 10. Select the "lazy" model. Select the No option for the tour.) 7. Insert the boot disk for LILO (Linux Loader. Select [2] for filesystem type. From this screen. Select install partition (Linux Native). (Do this anytime you run setup or menu. For the most part. Type clone at the prompt. TEX. TCL. First. using X requires a mouse that's properly configured. As I learned. Hit [n] for repartition. 5. Enter the profile name. type root and press Enter. select option [1] to create a boot disk. a. 8. Configuring muLinux When the system reboots. Select [n] for the remainder of the package options: X11. Enter the swap size and confirm the configuration. (Use the spacebar to select and Enter to confirm. Hit [y] for swap space configuration. Once the setup was complete. and JVM. EMU. 7. Confirm the installation configuration settings and start the copy routine. Hit Enter "and give yourself a congratulatory pat on the back!!!" Type setup -s to save your settings. 7. Creating the clone (you can try to repartition at this time): 1. Configure the kernel options according to your laptop's specifications (default). 10. 8. the initial muLinux boot (loading muLinux into RAM): 1. Insert the boot floppy into the target computer and boot it up to the first configuration screen. Select [2] LILO for the boot loader. 9. the mouse can be removed. Following are the steps needed to complete the cloning. 6. 12. 2. NS1. Reinsert the startup floppy. 8. 5. muLinux must first be loaded into RAM with a few necessary components. 11.) At the /root prompt. it will prompt you for various configuration options. you can install all the necessary add-ons to turn your laptop into a . To do this. 3. Leave the newly created Install disk in the floppy drive and reboot the computer. The only exception in my case was the mouse. Execute makefi to create an installation disk. At the login. PERL. 6. 4. Select 1 to "choice a swap partition" [sic]. Login using the root account. VNC. GCC. 2. these options were set to the default.5. The easiest method was to keep a mouse connected during the initial setup of muLinux.

) You must save the configuration each time you change something. reboot the system. . Again. The top menu of Setup v14r0 lists the main packages you can add. configured. Bypass these and log back into root. save the settings using setup -s. Add-on SRV WKS X11 Description 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 VNC Loads the image-viewer program called xli (discussed later) Once you have all these add-ons installed. I learned that my display had the settings shown in the following table. The key to controlling resources on the DPF is to limit the number of programs running. make sure that you save the setup (Press the [s] key in the Setup program or type setup -s at the command line. which will prompt you again with several configuration options. To create a digital picture frame. it's not always easy to tell which add-on includes the program you need. You must have the corresponding add-on installed before you can use it. Before doing anything. Below that is a list of the programs and services that can be enabled. Once the save is complete. Figure 1 Setup v14r0 screen. you need to load the add-ons in the following table. Fortunately. I was able to learn that my laptop video chip was a Cirrus CL-GD7543. Setting Up X Setting up X to work on your laptop might be the most challenging aspect of this whole process. or disabled. Unfortunately. there's no need to load ssh or Samba. or you'll lose your changes when the computer is turned off. These programs just take up valuable RAM and can result in slower image-load times. you have to know the key specifications needed by the X program. Armed with this information.picture viewer. For example.

Figure 2 The Menu menu. I had two choices. 6.Setting Value Horizontal sync 31. except that the wizard provides more choices that can help get your X session up and running.175 8 or 16 With this information noted. Figure 3 The Configuration Wizards menu. 5. First. Both options perform the same actions. At X server menu. Arrow down to Configuration Wizards and press Enter (see Figure 2). 2. To set up X. follow these steps: 1. My second option was to use the "menu" program wizard included with muLinux to assist with the general configuration tasks. Once this info is complete. arrow down to Super-VGA cards. 4. Exit the menu and type startx to execute XWindows & Fvwm95. From the Setup Method menu. press the spacebar and then Enter (see Figure 4). I could run a program called xprobe to set up my X configuration file located in /etc/X11 and called XF86Config.5 kHz Vertical sync Dot-clock Bit-plane 50–70 kHz 25. Type menu at the command line and press Enter. . 3. select user defined or modeline probing and use your known settings to fill in the blanks. Arrow down to XWindow and Video Setup and press the spacebar followed by Enter (see Figure 3). you'll have a chance to confirm the settings (see Figure 5).

Now it's time to fix X. or perhaps a "hidden" image that shows up every 20 days. Take a look around and see how they work. you must test the xli program installed with the VNC add-on. For example. I had to alter the VertRefresh entry in the Monitor section from VertRefresh 70 to VertRefresh 50-70. The hard part is over. however. Figure 5 Confirming the detected/entered settings.. where everything was done via a text screen.on second thought. you should be rewarded with a basic GUI with several programs running on the desktop. xli is an image viewer based on . depending on the success of the wizard. and wq will write out (save) and then quit. Press x to delete a character and d to delete a line.log. and the basic system is working. To see this information. you might want to add a random-timing feature. If it fails. it might be too early to celebrate! The Picture Frame Code The following code is not secure. tweaking xli. Pressing Esc exits insert mode. The options are up to your imagination! xli Prior to doing anything. Press q to quit. there are many other ways to show or loop through pictures. All that's left is some custom scripting. and of course lots of testing. Once X loads with fvwm95 serving up the graphics. creating the frame. Shift-z-z to save and exit. 95% of what you'll need to do requires knowing only these few keystrokes: q q q q q q Move the cursor around the file using the arrow keys.. use the following command: cat /var/log/startx. you can troubleshoot using the information in /var/log/startx. because they won't be there for long! At this point you can take a break. Typing q! will quit without saving.Figure 4 Selecting SVGA support. To get X working correctly on my laptop. uploading the pictures. This small change made all the difference to X—as well as to my sanity. Please note that X may or may not load. vi does take some getting used to. Press i to start insert mode.log | more or open the log file in vi. where you can add and change existing characters. nor is it bulletproof. 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. as I spent a good hour troubleshooting this problem. In addition.

If you need to locate any other missing files. and a file manager. you must make sure that all the libraries are loaded. First. If you execute startx now. type xli at the command prompt. such as xterm. This isn't essential. Click the screen with your mouse and exit and more. focusing. press i (insert) followed by #. Click the screen for the fvwm95 menu and then exit the window manager.xloadimage that does much more than just show a picture. With the cursor set at the beginning of the line. which means that the startx file must be edited. add a # by using the insert command in front of the line to stop fvwm95 from loading the taskbar: #+ "I" Module FvwmTaskBar With all these steps complete. you should only see a cyan screen with a zooming. To do this. your DPF will include a GUI that can be used for games and other applications. change this line as follows to ensure that fvwm95 uses a black background: AddToFunc "InitFunction" "I" Exec xsetroot -solid black & Again.2 /usr/lib/libpng. save the file and execute startx again. However. Arrow down until you find the lines responsible for loading the extra programs. When startx is executed. xload.2 file.2 This step creates a shortcut to the missing library file that essentially tricks the OS into believing the missing file is now installed in /usr/lib. before using it. you need to create a link using the following command: ln /usr/vnc/lib/libpng. use this command: find / -print | grep <filename> Altering the Default fvwm95 Display In this project. To do this. type vi /usr/X11R6/bin/startx and open the startx script in vi (our editor). Save your changes and close vi by pressing Esc. with the exception of a small X in the center for the mouse cursor. arrow down through the lines until you come to this line: AddToFunc "InitFunction" "I" Exec xsetroot -solid cyan4 & First. it performs some checks and then attempts to load fvwm95. Included in this package is support for clipping. Then type the following to load the fvwm95s configuration file into vi: vi /usr/X11R6/lib/X11/fvwm95-2/fvwm95-2. we need to remove a few extra parts from fvwm95 to hide it from the user. This action tells the shell to ignore the line. If you get an error about a missing libpng. You should be rewarded with a blank black screen. muLinux is configured by default to open several programs in the GUI. We don't want these to load. by using fvwm95. background-color adjustments. fvwm95 loads according to a configuration file and then passes control back to the startx script for further processing. . and you could avoid a window manager altogether. However. we're using fvwm95 as our window manager. followed by Shift-z-z.

This is also done with splashpage image.The Picture Script The goal of this project was to make a user-friendly DPF. loading each for a predefined period of time. After a little thought. #Added a pause to allow X to start. for a complete listing.I keep it mounted in case I want to remove a file echo Copy complete.Assign badname with '/pics//pics:' (folder not a picture) while [ 0 -eq 0 ]. ################################################################## #Send message to screen prior to picture load. At this point. the splash image to load. I could manually tell my laptop to view a picture. xli had the power and options to help me.Continuous loop (0 will always equal 0) for i in $xlist .copy the jpgs to the /pics folder sleep 10 . and the user to insert #the image floppy echo MAKE SURE YOU SWAP THE FLOPPY!!!! echo Sleeping for a minute sleep 60 echo Mounting floppy and copying over new pictures umount /a .Assign xname with image path & name . type xli -help at the command prompt. you need to create an executable .xlirc echo path=/pics > /root/. I came to the conclusion that my script would have to prompt the owner for a floppy disk.I like to sleep a lot #umount /dev/fd0 . I needed some customized code that would automatically load and display pictures without interaction from a user. do .xlirc I'll include my picture script to give you a place to start. copy images from the floppy to the local drive.Assign $i with image name do xname=/pics/$i . #Start image load process xlist=$(xli -list) . Feel free to plagiarize this for your own purposes. Thankfully.xlirc file in the /root and / directories. Starting image cycle. This file needs one line to tell xli where to find your image store: path=/pics NOTE To create this file.jpg /pics . To complete the conversion from laptop to picture viewer. Included are comments explaining the purpose of each line.change directory to the floppy cp *.if the floppy is mounted.mount the floppy using vfat (Windows) format cd /a . but my in-laws wouldn't find this very amusing. NOTE To use the list or path flag. This entire file was saved as runpics in the /root directory. and cycle through the images.Get file listing from xli (also returns folder name) badname="/pics//pics:" . unmount it mount -t vfat /dev/fd0 /a . type the following: echo path=/pics > /.

I created a third script called go.5 minutes.jpg Go Script I next wanted to create a starting point from which everything could be executed. it creates a file called .sleep for 20 seconds and then repeat! done ################################################################# Once your script file is created. By removing this file. it's a good time to test the entire process to make sure that it works. In addition. The contents of this file are as follows (the & tells the command to execute in the background and allow the script to continue to the next line): rm /tmp/. a poweroff will leave this file in the /tmp directory.X0-lock startx & /root/runpics & /root/splash & NOTE When the X Window System is executed.if [ $xname != $badname ] . change the permissions on it to allow it to execute. As I discovered. Assuming that you have a splashpage. so I created a splash script with the following line: xli -onroot -display localhost:0 -center -border black /root/splashPage. This is meant to stop an additional X session from starting. This would allow me to execute go from any location on the computer. With all this work complete.jpg image in the /root directory.Test to see if xname = '/pics//pics:' then #Load the image according to my specification using xli xli -onroot -display localhost:0 -border black -center $xname fi sleep 20 done . but can cause problems if the system is not shut down properly. I wanted this part of the startup routine to be separate from the runpics script. After about 1. After a clean reboot. I decided to set up a splash page to provide a reminder. the splash page would be nicer to look at than a blank window or text as the runpics script took its naps. However. login to root and type go. thus halting the startx script from loading. the screen should change to your first image in the /pics folder. Getting It All Started . which I placed in the /usr/bin directory. you should be rewarded with a black screen that soon displays your splash image. As a result. by using the following command: chmod 755 <filename> SplashPage Script To make sure that the user doesn't forget to insert the image floppy.X0-lock in the /tmp directory. I clear the way for a proper execution of X.

All of the nylon screws were unused in my final prototype. 6. 4. Various Problems I faced many obstacles getting this DPF to work. Purchase nylon screws. and washers. but again. Locate screwdrivers. 7. And there were two issues that I couldn't properly handle.local file. The technical side of the picture frame was complete. My initial attempt was a little gaudy and equally as ugly. The extra length is needed to flip the display around onto the back of the computer (Figure 6 shows the disassembled laptop). Remove the hard drive for safekeeping. a paper shelf thing that fits the laptop. In the end. However. Creating the Case Creating the case proved to be fairly easy. The first was a display-timeout problem that turned off the screen after 10 minutes. but nothing worked. 3. TIP Try to place the LCD about one inch higher than the laptop chassis. 10. Velcro. 8. Apply Velcro to the bottom of the laptop and the back of the LCD and stick the Velcro pieces together. 14. Using Velcro. This usually involves removing bottom screws from the laptop and side screws for the attached monitor. sledgehammer. but this file failed to execute anything. I used a hair clip to just hold down a key and trick the laptop into believing that a user was . 11. etc. Remove the LCD display from the laptop. my second attempt resulted in a rather spiffy-looking DPF. apply the frame to the LCD. 13. Remove and discard the battery (they're usually dead in old laptops). pliers. although it took a couple of tries. I could have my in-laws log in and type go. Once the keyboard is off. locate and unplug the LCD display attachment. 9. drill. Disconnect and remove the LCD display. if I might say so myself! Following are the steps I took: 1. and paint. I changed the BIOS and looked for a software solution. blowtorch. Paint the top of the LCD display and let it dry overnight. I just decided to edit the /etc/rc/5 file and include an entry to execute go & (this worked beautifully). Look under rubber protection pads for hidden screws. Reconnect the LCD display to the laptop chassis. 12. Figure 6 Disassembled laptop. This helps when placing on the picture display. I first tried adding a reference to go in the rc. Instead of troubleshooting. brackets. that wasn't user-friendly. (Note: This will void your warranty. Remove extra parts that are normally used to mount the LCD onto the laptop chassis. 2. You may need to break off extra parts to allow easy mounting of the frame over the LCD. <g>) 5. nuts. Unravel the LCD-to-computer strip and extend it.The final step was to find a way to execute go during startup. Remove the top of the LCD display.

you're welcome to apply for a full refund of the money you paid me for it :-). InformIT. 800 East 96th Street Indianapolis. the homemade digital picture frame is a success. I spent hours trying to troubleshoot various problems.. ". Inc. All rights reserved. The second problem was trying to get rid of the little X cursor on the screen.. © 2005 Pearson Education. and a few offers to buy one. Indiana 46240 . Since a picture is supposedly worth 1. although it's annoying for the end user." Summary This project took a lot of time.000 words. but it was all worth it. However. Figure 8 Displaying images. My solution was to move it off into a corner using Shift+Ctrl+up arrow. After getting some very positive feedback. This worked. I'll let Figures 7 and 8 provide a closing for this article! Figure 7 Two finished digital picture frames. as it states on the initial boot screen.present.

Sign up to vote on this title
UsefulNot useful

Master Your Semester with Scribd & The New York Times

Special offer for students: Only $4.99/month.

Master Your Semester with a Special Offer from Scribd & The New York Times

Cancel anytime.