Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Fixed broken script on OSX #11

Open
wants to merge 1 commit into from

1 participant

@beenje
  • Made dd argument platform independent: bs shall be 1m with default (BSD) dd on OSX but 1M with GNU dd (linux/OSX)
  • Chop 's' + minor number from partition name to get device name on OSX
beenje Fixed broken script on OSX
- Made dd argument platform independent:
bs shall be 1m with default (BSD) dd on OSX but 1M with GNU dd (linux/OSX)
- Chop 's' + minor number from partition name to get device name on OSX
91fb47b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jul 8, 2012
  1. Fixed broken script on OSX

    beenje authored
    - Made dd argument platform independent:
    bs shall be 1m with default (BSD) dd on OSX but 1M with GNU dd (linux/OSX)
    - Chop 's' + minor number from partition name to get device name on OSX
This page is out of date. Refresh to see the latest.
Showing with 8 additions and 2 deletions.
  1. +8 −2 raspiwrite.py
View
10 raspiwrite.py
@@ -172,7 +172,8 @@ 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)
+ # bs = 1048576 = 1024*1024 (1m on OSX / 1M on linux)
+ copyString = 'dd bs=1048576 if=%s of=%s' % (path,SDsnip)
print 'Running ' + copyString + '...'
print getoutput(copyString)
@@ -268,7 +269,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':
+ # Remove 'Y' from /dev/sdXY
+ SDsnip = SD.replace(' ', '')[:-1]
+ else:
+ # Remove 'sY' from /dev/diskXsY
+ 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.