#!/bin/bash function die { echo "$1" > /dev/stderr exit 1 } function info { echo "$1" > /dev/stderr } function doinstall { # assumes osx [[ "$(uname -s)" != "Darwin" ]] && die "need osx" TARGET="/Volumes/boot" if [[ ! -e "$TARGET/LICENCE.broadcom" ]]; then die "cant find rpi boot dir" else info "rpi boot dir found at $TARGET" fi info "disabling partition resize" sed -i '' -e 's/init=[^[:space:]]*//' "$TARGET/cmdline.txt" info "copying setup files to disk" } doinstall