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.
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
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
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
make [PLATFORM=(...)][DISTRO_TAR_URL=http://.../Archive.tar.gz] linux (tar)
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
diskutil unmountDisk /dev/diskX sudo dd bs=1m if=sdcard.img of=/dev/rdiskX