FAQ/Mac
From CHDK Wiki
Mac user seem to have a particularly frustrating time trying to figure out how to get CHDK onto an SD card as well as copying scripts correctly so they won't get parse and UNK errors with every one they try to run. Below are some tips and hints for Mac users.
Contents |
[edit] Getting CHDK onto an SD Card on Mac OS X 10.5 "Leopard"
[edit] Short Answer
The system Archive Utility by default does not make downloadable files executable as a security feature.
In order to get the CHDK firmware files on to an SD card from a Mac, either the files need to be decompressed with an application called The Unarchiver or Untar or StuffIt (commerical app with free unarchiver) and not the system Archive Utility, or you can make the files executable using the command line.
[edit] Long Answer
The system's Archive Utility adds a flag to the file. The files uncompressed from Archive Utility have an "@" at the end of the permissions string when viewed in Terminal via the command "ls -la". Here are the results I got, once I copied the files to the SD card:
From Archive Utility:
-rwxrwxrwx@ 1 <username> <username> 127664 10 Dec 02:17 DISKBOOT.BIN
-rwxrwxrwx@ 1 <username> <username> 128412 10 Dec 02:17 PS.FIR
The @ indicates an extended attribute. Using ls -la@ will show
-rwxrwxrwx@ 1 <username> <username> 127664 10 Dec 02:17 DISKBOOT.BIN com.apple.quarantine 38 -rwxrwxrwx@ 1 <username> <username> 128412 10 Dec 02:17 PS.FIR com.apple.quarantine 38
NOPE: Instructions don't work.
Attached my "supported' SD800IS via the cable to my Leopard/MacBook with the provided cable. Photo Download APP boots, but no reference to /Volumes/Canon of any kind.
What steps are missing in the instructions? With a BS in Comp Sci I can't figure it out. These instructions are simply broken. Don't bother.
Previous poster should understand that most Canon cameras don't mount themselves as USB mass storage devices, therefore when you connect the camera to a computer it will not show up as a drive. You need to connect the SD card to your computer using a card reader; the card will appear in your /Volumes and on the left side of Finders. The instructions DO work. Now back to the normal show...
The com.apple.quarantine flag indicates that Apples quarantine system is flagging this file as downloaded from the internet, which normally means it won't be executed unless the user specifically allows it, a security feature added in Mac OS X 10.5. I'm not quite sure how this is implemented, or why the camera respects this flag, but it appears to be the problem.
These flags can be removed by opening the Terminal (in your Applications > Utilities folder) and using the commands
cd /Volumes/CANON_DC
xattr -d com.apple.quarantine DISKBOOT.BIN PS.FIR
Note that if you have renamed your card from 'CANON_DC' you should make the obvious change above. :-)
Alternatively, use an unarchiver that does not flag the files as quarantined.
From The Unarchiver:
-rwxrwxrwx 1 <username> <username> 127664 10 Dec 02:17 DISKBOOT.BIN
-rwxrwxrwx 1 <username> <username> 128412 10 Dec 02:17 PS.FIR
Hypothetically any zip decompressing application that doesn't add the "@" flag, should be able to unzip it fine and work when coped to the SD. I should point out that Windows XP doesn't add the "@" flag either.
[edit] How to Copy Script Files Without Errors
This method uses the system text editor, TextEdit. The file has to be plain text and encoded as UTF-8 to work. Technically any editor can do it as long as it produces a plain text file with UTF-8 encoding, but the steps below use TextEdit.
- NOTE: a sure fire way to know you have errant characters in your file is that the camera will give you a "parse error" immediately when you try to run the script. Like if you forgot to format the file as "plain text" on a mac. Or used Linux and forgot that Linux uses a linefeed as an end of line character instead of a carriage return.
[edit] Steps
- Open TextEdit
- Format -> Make Plain Text
- Copy in code / Write your own code
- File -> Save As...
- Enter a name for the script with the ".bas" extension
- For Plain Text Encoding, select "Unicode (UTF-8)"
- Copy the saved script to the SD card
- Done!*
[edit] Terminal Method using Leopard
- Open terminal located in Applications > Utilities > Terminal
- Copy the version of allbest you wish to run onto your memory card "cp ~/Downloads/allbest-ixus70_sd1000-101b-50.zip /Volumes/CANON_DC" - change CANON_DC to whatever your memory card shows as on your desktop
- Change to the card directory "cd /Volumes/CANON_DC"
- Unzip the file "unzip allbest-ixus70_sd1000-101b-50.zip"
- Exit the terminal "exit"
- Note: If you see files entitled "._[Script Name].bas", be warned, they are NOT scripts! They are invisible files placed there by OS X, and nothing will happen if you try to run them as scripts. You might be able to delete them without adverse effects in the camera's file browser. The script you're looking for is below these files, in alphabetical order.
- NOTE2: Those are called resource forks and have existed on the Mac forever. They contain information that associates the file with applications, creator info, etc. On the mac they don't normally even show up, but beware since the camera has no idea what to do with them and you should ONLY copy the original file name, but leave the _(Script Name).bas there so that you can edit the file(s) later again on your mac.
