I’ve got a Powerbook G4 in my hands and I am tasked with turning it into a large digital photo frame for wall mount. Here goes the story on how it was done….
First, I know zero about a Mac. I’ve never touched one. From the start I had to have someone show me how to eject a damn CD. The only constraint I had with the laptop is that the owner wanted the data untouched. My immediate thought was to shrink the OS X partition and dual boot Linux on the laptop because:
- I am familiar with the OS
- It’s extremely flexible
- I knew of QIV which is perfect for a digital photo frame
- I knew I could script this to boot and run QIV with no user intervention
With that, I set out to install Linux (dual boot). What should have been a simple task turned out to be a pain in the ass. First, I was unable to run the live CD of Ubuntu. I kept getting an authorization failed error at the login screen. Huh?!?! After much searching it turned out to be an issue with PRAM (which I am still not clear on) on the Mac. Essentially the PRAM backup battery was dead and the RTC was filled with junk. It simply needed a valid date. To do this, I had to issue a goofy keystroke combination on boot (apple + option + O + F) which got me into a command prompt of ‘open firmware’. Huh?!?!?! Anyways, issuing the following command…
decimal dev rtc sec min hour day month year set-time
… reset the time (based on the arguments I supplied at the time). I then followed with a…
mac-boot
… which continued booting. Now, another trick was learning that I needed to hold down C during boot to get it to boot from the CD.
So, now I am up and running with the live CD and I run into my next problem. The installer will not let me shrink the existing hfs+ partition which consumes the entire physical drive. This took quite a while to figure out why. There were no clues at all. With a lot of rummaging through Ubuntu/Linux forum posts I finally produced the answer. OS X does something called journaling which I gather is used for a restore point (?? perhaps not ??). Regardless, this is interfering with the resize process. Now, disabling it was another pain in the ass. OS X provides something called disk utility. In this utility you can enable journaling, but you can’t disable it. Why?!?!? Well, indeed there is a way, through a terminal session. I had to execute…
diskutil disableJournaling /Volume/VolumeName
… and that seemed to do the trick. Finally, I was able to shrink the partition using parted run from the live CD.
With that out of the way it was time to get the slide show rolling. This required a simple apt-get from the repository… qiv is the application. Once installed I performed a quick test to get the options right. This was a breeze. Next, I needed to write a small little bash script. That went a little something like this…
#!/bin/sh
#Required sleep to get this to work at startup
sleep 10
#Formulate date for log entry
NOW=$(date +"%b-%d-%y %H:%M:%S")
#If USB drive mounted, use it for pictures and copy them locally
if grep '/media/8021-0434' /etc/mtab > /dev/null 2>&1 ; then
echo "$NOW Running from mounted USB drive" >> PictureFrame.log
qiv -feitsr -d 10 /media/8021-0434 &
cp -rvu /media/8021-0434/* /home/lbjoco/Pictures/ > /media/8021-0434/MediaTransfer.txt
#If no USB drive mounted, use local source
else
echo "$NOW Running from local source" >> PictureFrame.log
qiv -feitsr -d 10 /home/lbjoco/Pictures &
fi
Basically this script checks for the presence of a particular USB thumb drive. If it is present, the slide show starts using it as the source and copies any new items from it to the hard disk. If it is not present, then the slide show utilizes the files present on the hard disk. A log file is kept and the output from the copy command is redirected to a text file on the USB thumb drive so that it can be analyzed without having to access the picture frame.
So, that is it! Now that it functions like a digital photo frame the next step is to make it look like a digital photo frame.