Skip to content

peel/arm-sdcard-builder

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ARM Linux Tar SD Card Generator

Why

Installing Linux from tar archives is cumbersome. Then also OSX does not support EXT filesystems. For that on OSX to flash an SD card for ArchLinuxARM, Alpine etc. a VM has to be started. To make things easier the Docker image does exactly that. Makes it easy, fast and reproducible to generate and flash image to sd card on Mac and Linux.

How

Mac OSX

From a repository clone:

make [DISTRO_TAR_URL=http://...] [PLATFORM=(rpi-2|rpi-3|odroid-c1|odroid-c2)] -e [download] mac [tar]

[PLATFORM] - sets image destitantion platform (default: rpi-3) [DISTRO_TAR_URL] - (NOT NEEDED WHEN USING ARCHlINUXARM) a fully qualified URL to your distro’s tar.gz (ie. http://archlinuxarm.org/os/ArchLinuxARM-odroid-c2-latest.tar.gz) (copy|tar) - whether an img or tar.gz copy shall be created; mandatory when using PLATFORM parameter

Or without cloning:

docker run --privileged -e PLATFORM=${PLATFORM} -v $(pwd):/backup -it peelsky/arm-sdcard-builder -e download copy

Raspberry Pi 3

RPi-3 is the default platform of choice, thus you can simply run:

docker run --privileged -v $(pwd):/backup -it peelsky/arm-sdcard-builder -e download copy

Problem solving

If docker says something’s wrong with /dev/loopX, most likely it’s due to device mounting, execute:

docker-machine ssh default -- "losetup -a | cut -c1-10 | xargs -i losetup -d {}" || true 
docker-machine ssh default -- "losetup -f" || true

Linux

make [PLATFORM=(...)][DISTRO_TAR_URL=http://.../Archive.tar.gz] linux (tar)

Examples:

To get an `.img` for flashing on an SD card execute: make PLATFORM=rp3 linux

To get an `.tgz` archive as a backup: make PLATFORM=oc2 TARGET=$(pwd) linux tar

Flashing

diskutil unmountDisk /dev/diskX
sudo dd bs=1m if=sdcard.img of=/dev/rdiskX