'Flash' Alpine tarball release on mmc for RPiZero

2020-06-08

no one is responsible of any damage is made by running this script

#!/bin/sh
device='/dev/sdx'
part="${device}1"
tarball='alpine-rpi-3.12.0-armhf.tar.gz'
instdir='rpi'
parted -s $device mktable msdos
parted -s $device unit s -- mkpart primary fat32 2048 526335
parted -s $device unit s -- mkpart primary ext4 526336 -1
parted -s $device -- set 1 boot on
partprobe $device
mkfs.vfat $part
sync
rm -rf $instdir
mkdir $instdir
mount $part $instdir
tar xf $tarball --no-same-owner -C $instdir/
echo 'modules=loop,squashfs,sd-mod,usb-storage dwc_otg.lpm_enable=0 console=tty1 console=ttyAMA0,115200' > $instdir/cmdline.txt

cat > $instdir/usercfg.txt<<EOF
gpu_mem=16
dtparam=audio=off
dtoverlay=pi3-disable-bt
dtoverlay=w1-gpio
enable_uart=1
EOF

sync
umount $instdir
echo
echo "install completed."
exit 0

additional tasks when rpiz booted and setup-alpine finish

(not obligatory but could be helpfull)