Skip to content

Instantly share code, notes, and snippets.

@peel
Created March 25, 2016 17:46
Show Gist options
  • Save peel/1067f6545a322916af5f to your computer and use it in GitHub Desktop.
Save peel/1067f6545a322916af5f to your computer and use it in GitHub Desktop.
Making an ArchLinux ARM SD card with OSX with Vagrant
#!/bin/bash
# Step 0: Clone repository
# The repository contains a VM to flash your SD card with
git clone https://github.com/peel/rpi-sdcard-builder.git
cd rpi-sdcard-builder/vagrant
# Step 1: Find disk identifier
# This is extremely important to get it right as the process will destroy
# the contents of a given disk
# The disk identifier has a form of 'diskX', ie for the following output:
# /dev/disk2s1 233Gi 220Gi 12Gi 95% 57795408 3185810 95% /
# The disk identifier is disk2 (disk2s1 is a partition on disk2)
df -h
read -p "Enter disk identifier ie. disk2:" DISK_ID
# Step 2: Provision VM
# You will be asked for LOCAL (Macbook) sudo password
# Remove --with-image if you don't want an .img file copy
# The process might take quite some time complete depending on your network connection
vagrant --disk-id=${DISK_ID} --with-image -- up
# Step 3: Wait
echo "It's ready now!"
# Step 4: Destroy the VM
vagrant destroy || true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment