khagberg
Group: Members
Posts: 18
Joined: Dec. 2005 |
|
Posted: Jan. 11 2006,13:08 |
|
Below is what i did for a picture frame. I run zgv which does not require X. I had USB available to update the photos, you might try something similiar with cd. I power the machine down and it comes back fine.
I am not a linux guru and dont claim that everything in this document is the best way to do it, but it worked for me.
Installing Damn Small Linux (2.0) on a laptop as a Picture Frame
Do these steps prior to ripping apart the computer. It would suck to rip it apart and not be able to make it work.
Start the computer and get into the system bios and disable the power management options associated with the display.
Boot computer of from dsl cd and at the boot prompt type dsl 2. This will boot dsl into text mode so that we can configure the hard drive.
When booted, at the prompt type cfdisk and press enter to start the hard drive partition software. Start out by highlighting each partition on the drive and Delete them. Once that is done choose New/Primary/55/Beginning. Next select Bootable. Next move down to Free Space and choose New/Primary/10/Beginning, move down to Free Space and choose New/Primary/(remaining space)/Beginning. We have now created the partitions we need. To finish we need to choose Write and yes to write partition table to disk. (Note: you must spell out yes here.) Now you can select Quit.
Next type the following
Mke2fs /dev/hda1 enter Mke2fs /dev/hda2 enter Mke2fs /dev/hda3 enter
This will prep the partitions for use.
Type init 6 enter to reboot
Again, boot from the cd and at the boot prompt type install. This will boot dsl and bring you to a menu with install options. Select option 4. Frugal Grub Hard Drive Install. When prompted for a target partition, specify hda1, install from LiveCD, format target partition yes and yes to continue. This will copy DSL to the 55mb hda1 partiton we created. When this is done you can reboot by choosing option 8, but this time boot from the hard drive.
When you reboot you will see a menu prompting you to select a boot option. If your laptop screen supports 1024x768 choose DSL fb1024x768. If all goes well, you will boot into X windows.
Once it boots into X windows you will have a DSLpanel icon on the desktop, click once on it, then click on the Backup/Restore button and type hda2 in the box. Now click Backup and it will save all your current settings. This will also save your settings on shutdown and restore them on power up.
Press Alt-Ctl-Del and this will exit X windows.
Now we will modify the boot menu. Type mount /dev/hda1 enter. We will use nano which is a text editor for editing all files. Type sudo nano /mnt/hda1/boot/grub/menu.lst enter. The default setting is to select which menu option it will default to with 0 being the first option. If you choose DSL fb1024x768 and your system is running fine, set the default to 2. Set the timeout to be 3 Under the timeout option type hiddenmenu Go down to the line title DSL fb1024x768 On the next line that starts with kernel add write quiet to the end of the line. Type Ctrl-X and answer Y to save and enter.
If you are network attached: (If you’re not you’re screwed, sorry) Type sudo dpkg-restore enter Press enter when it finishes Next type apt-get install zgv enter This will go out and grab zgv which is the software we will use to display our pictures, as well as additional files needed to support it.
Now that we have installed the software we need to tell it to make sure we Backup and Restore the files.
Type the following:
Cd enter Nano .filetool.lst enter (note the period in front of filetool. This is a hidden file)
Add the following lines to the bottom of the file etc/zgv.conf etc/vga/libvga.config usr/bin/zgv usr/lib/libpng.so.2.1.0.12 usr/lib/libvga.so.1 usr/lib/libvga.so.1.4.3 usr/lib/libvgagl.so.1 usr/lib/libvgagl.so.1.4.3
(note all files listed above with version numbers are subject to change and may be different on your system. Please verify the files and versions and fix the names as needed)
Next we need to edit our config files. Type sudo nano /etc/zgv.conf enter Scroll down to the line viewer-start-mode and if you are running 1024x768 change the line to be viewer-start-mode 1024 768 24. Next scroll all the way to the bottom and add the following: Slideshow-delay 30 Slideshow-loop on
The slideshow-delay is how frequently you want your picture to change. Type Ctrl-X to Exit and save.
Next type sudo nano /etc/vga/libvga.config enter Scroll down until you come to the Mouse type: section. At the bottom of this section you will see mouse not configured, change it to say mouse PS2 or mouse none. Type Ctrl-X to Exit and save.
I use a USB memory stick to update my Picture Frame software. On my Windoze XP system I install the XP Power Toy Image resizer available here:
http://download.microsoft.com/downloa....tup.exe
Now on your USB memory stick create a folder called photos and copy the jpg files you want to upload to your picture frame to the folder. Once you have all the photos on the memory stick in explorer highlight all the files and right click on them and choose Resize pictures. I choose 1024x768 (because my laptop can display this), choose advanced and choose to Resize the original pictures. (NOTE make sure you are resizing the copies of the photos you put on the USB memory stick)
Next we need to create an autorun.sh file in the root of the USB memory card. Put the following in the file:
echo Found USB Memory sudo mount /dev/hda3 -o remount,rw cd /mnt/sda1/photos echo Removing old photos from picture frame rm /mnt/hda3/photos/*.jpg echo Uploading new photos from USB Memory cp *.jpg /mnt/hda3/photos/. sudo mount /dev/hda3 -o remount,ro cd /
save the file and unplug the USB memory.
Plug the USB memory into the picture frame
Now we need to configure the drive partition for our pictures. Type the following:
mount /dev/hda3 cd /mnt/hda3 sudo mkdir photos mount /dev/sda1 cp /mnt/sda1/photos/*.jpg /mnt/hda3/photos/. Umount /dev/sda1
Remove the USB memory
Now that we have configured the screenshow software and loaded some images it is time to test it.
Type zgv /mnt/hda3/photos/*.jpg enter
If everything is right your screenshow should start. If you see a blank screen or a screen that looks like a TV with vertical/horizontal hold problems, then we need to tweak the libvga.config file.
If you have an older laptop you might see a blank screen, in that case I modified the libvga.config file and found the line that says # chipset VESA and removed the # and tried the slideshow again.
On one machine that looked like the vertical hold was off, I had to adjust the HorizSync line to match my display.
That is about the extent of my knowledge on modifying that file.
OK, we are almost done.
Next we need to tell the system not to start X windows. Type cd enter Nano .bash_profile (Note the period in front of bash) Put a # in front of the line: if [ -z “$SSH” ]; then startx; fi Ctrl-X Save and Exit
You can always restart X windows by typing startx at the command line if you need to.
Now one last file: Sudo nano /opt/bootlocal.sh Add the following to the bottom of the file: Mount /dev/hda3 Sudo mount /dev/hda3 –o remount,ro
Mount /dev/sda1 /mnt/sda1/autorun.sh umount /dev/sda1
zgv /mnt/hda3/photos/*.jpg
Ctrl-X Save and Exit. At this point type sudo init 6 enter
This will backup the required files and reboot. If all goes well, your system will automatically start the slideshow on startup.
To Update Photos Update and resize the photos on the USB Memory card. Powerdown the Picture Frame, insert the USB memory and reboot. You will see a message during boot that it has Found USB Memory. This will delete all pictures currently on the Picture Frame and will upload all the pictures on the USB memory. Once it is done it will unmount the USB memory and start the slideshow with the new pictures. When the slideshow starts it is safe to remove the USB memory card.
When you have the software working, now is the time to go out and get your shadow box or frame and parts and rip the laptop apart.
|