{"id":5049,"date":"2010-01-10T16:28:31","date_gmt":"2010-01-10T21:28:31","guid":{"rendered":"http:\/\/scruss.com\/blog\/?p=5049"},"modified":"2010-01-18T07:00:56","modified_gmt":"2010-01-18T12:00:56","slug":"perhaps-a-slightly-easier-way-to-make-sd-cards-bootable-for-chdk-under-os-x","status":"publish","type":"post","link":"https:\/\/scruss.com\/blog\/2010\/01\/10\/perhaps-a-slightly-easier-way-to-make-sd-cards-bootable-for-chdk-under-os-x\/","title":{"rendered":"perhaps a slightly easier way to make SD cards bootable for CHDK under OS X"},"content":{"rendered":"<p>Now that <a href=\"http:\/\/chdk.wikia.com\/\">CHDK<\/a> has a working beta in the source tree for my Canon PowerShot SD790is, I actually have to prepare SD cards for it. The <a href=\"http:\/\/chdk.wikia.com\/wiki\/Bootable_SD_card#Mac\">Bootable SD card &#8211; OS X<\/a> instructions seem a bit contrived, so I took a look at the linux instructions, and modified them accordingly. These instructions should work for FAT16-formatted SD cards of 2GB capacity and under. It will not work for SDHC cards, which are generally formatted to FAT32.<\/p>\n<p>This is all command-line only for here on in. It seems to work. Please note that you will be modifying raw file systems with root permissions here; there is no safety net. If you b0rk your main hard drive, don&#8217;t say I didn&#8217;t warn you.<\/p>\n<p>Firstly, you&#8217;re going to have to find out where the SD card in mounted. Do this with:<br \/>\n<code>df<\/code><br \/>\nI got:<\/p>\n<pre>Filesystem    512-blocks      Used Available Capacity  Mounted on\r\n\/dev\/disk0s2   487463200 318749896 168201304    66%    \/\r\ndevfs                222       222         0   100%    \/dev\r\nmap -hosts             0         0         0   100%    \/net\r\nmap auto_home          0         0         0   100%    \/home\r\n\/dev\/disk2s1     3969280      3328   3965952     1%    \/Volumes\/CANON_DC<\/pre>\n<p>There are three important concepts to note when looking at the mounted card:<\/p>\n<ol>\n<li>The <strong>mount point<\/strong> (or volume) &#8211; in this case <code>\/Volumes\/CANON_DC<\/code>. This is the location that you see in Finder when moving files around.<\/li>\n<li>The <strong>filesystem<\/strong> &#8211; here <code>\/dev\/disk2s1<\/code>. This is the partition on the disk, arranged according to a certain formatting scheme like MS-DOS FAT16.<\/li>\n<li>The <strong>disk device<\/strong> &#8211; which for me is <code>\/dev\/disk2<\/code>. This is the disk device itself, and it may contain several filesystems.<\/li>\n<\/ol>\n<p>Your locations for these three could well be different, so please substitute your values.<\/p>\n<p>You&#8217;ll need to unmount the device, as writing to a raw filesystem while the OS thinks it has control often results in hilariously unexpected results. I used the OS X-specific command<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">diskutil unmount \/Volumes\/CANON_DC<\/pre>\n<p>You should get a message like <code>Volume CANON_DC on disk2s1 unmounted<\/code>. Now you need to write the boot instruction:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">echo -n BOOTDISK | sudo dd bs=1 count=8 seek=64 of=\/dev\/disk2s1<\/pre>\n<p>This will prompt you for your password.<\/p>\n<p>If you need to, you can remount the filesystems on the card with<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">diskutil mountDisk \/dev\/disk2<\/pre>\n<p>(Note that we used the disk name here, not the filesystem. If there were several partitions on the disk, this command would mount all of them that it could. It&#8217;s also kinda handy for remounting USB devices that you&#8217;ve accidentally ejected from Finder.)<\/p>\n<p><strong>Update<\/strong>: Knowing a difficulty getting the firmware update method of getting CHDK to work on a Mac? Running a Leopard or newer machine? Then you need to learn all about Apple&#8217;s quarantine attribute and how to remove it with <code>xattr<\/code>: <a href=\"http:\/\/chdk.wikia.com\/wiki\/FAQ\/Mac#Still_Having_Trouble.3F\">FAQ\/Mac &#8211; Still having trouble?<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Now that CHDK has a working beta in the source tree for my Canon PowerShot SD790is, I actually have to prepare SD cards for it. The Bootable SD card &#8211; OS X instructions seem a bit contrived, so I took a look at the linux instructions, and modified them accordingly. These instructions should work for [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[7],"tags":[1477,29,31,1468,269,2056,1438,1372,1177,229],"class_list":["post-5049","post","type-post","status-publish","format-standard","hentry","category-computers-suck","tag-bash","tag-camera","tag-canon","tag-chdk","tag-mac","tag-remount","tag-sd790","tag-shell","tag-terminal","tag-usb"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/pQNZZ-1jr","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/scruss.com\/blog\/wp-json\/wp\/v2\/posts\/5049","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/scruss.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/scruss.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/scruss.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/scruss.com\/blog\/wp-json\/wp\/v2\/comments?post=5049"}],"version-history":[{"count":9,"href":"https:\/\/scruss.com\/blog\/wp-json\/wp\/v2\/posts\/5049\/revisions"}],"predecessor-version":[{"id":5078,"href":"https:\/\/scruss.com\/blog\/wp-json\/wp\/v2\/posts\/5049\/revisions\/5078"}],"wp:attachment":[{"href":"https:\/\/scruss.com\/blog\/wp-json\/wp\/v2\/media?parent=5049"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/scruss.com\/blog\/wp-json\/wp\/v2\/categories?post=5049"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/scruss.com\/blog\/wp-json\/wp\/v2\/tags?post=5049"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}