A quick-and dirty way to prepare an SD card on Mac OS X with Alpine Linux for a Raspberry Pi.
- Mac OS X with GNU
makeandrsyncinstalled, e.g. via homebrew. - An unused SD card. 2GB are sufficient.
make will format the SD card, install Alpine, and eject the card.
For finer-grained control, use a combination of targets:
format: Format the SD cardalpine: Download Alpine (see Configuration below)mmc: Copy Alpine on the card, download it if neededconfig: Include an existingrpi.apkovl.tar.gzconfiguration on the card. Only usefule if you have saved one previously.splash: Add a boot splash. Caveat: This will disable the console. The splash screen must be namedfbsplash.ppm.eject: Eject the carddiff: Show differences between the Alpine distribution and the card contentsclean: Remove the downloaded Alpine distribution.
See the Editable configuration section in the Makefile:
ARCH: Usearmhffor any Pi,aarch64for Pi 2 and 3.MAJOR_VERSION: Alpine release, e.g.3.9MINOR_VERSION: Point release, e.g.2for release3.9.2
Consider adding something like this to
clean-mmcas well:find /Volumes/ALPINE -type f -name '._*' -deleteI'm not totally sure where these files get created but they caused me great headache.