Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Fix DD Arguments and OS X name chopping #12

Merged
merged 2 commits into from

3 participants

@tech2077

Difference in BSD and GNU dd commands making the block size capitalization important. Also, I discovered that OS X uses the /dev/diskXsN naming convention as apposed to the Linux /dev/diskXN naming convention.

@exaviorn exaviorn merged commit 413db87 into from
@beenje

I think it would have been better to avoid the "m" and "M" and just use the value 1024*1024.
If you install GNU coreutils on OSX, this will break.
See the comments on 80887b0edc and my PR

This seems like a better idea

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
Showing with 10 additions and 2 deletions.
  1. +10 −2 raspiwrite.py
View
12 raspiwrite.py
@@ -172,7 +172,10 @@ class transferInBackground (threading.Thread): #Runs the dd command in a thread
def run ( self ):
global SDsnip
global path
- copyString = 'dd bs=1M if=%s of=%s' % (path,SDsnip)
+ if OS[0] != 'Darwin':
+ copyString = 'dd bs=1M if=%s of=%s' % (path,SDsnip)
+ else
+ copyString = 'dd bs=1m if=%s of=%s' % (path,SDsnip)
print 'Running ' + copyString + '...'
print getoutput(copyString)
@@ -268,7 +271,12 @@ def transfer(file,archiveType,obtain,SD,URL): #unzips the disk image
if (SD.find("/dev/mmcblk") + 1):
SDsnip = "/dev/mmcblk" + SD[11]
else:
- SDsnip = SD.replace(' ', '')[:-1]
+ if OS[0] != 'Darwin':
+ SDsnip = SD.replace(' ', '')[:-1]
+ else:
+ # remove weird partition notation in OS X partition names
+ SDsnip = SD.replace(' ', '')[:-2]
+
print path
print '\n\n###################################################################'
print 'About to start the transfer procedure, here is your setup:'
Something went wrong with that request. Please try again.