#!/bin/bash gpioset `gpiofind GPIO24`=1 sleep 1 gpioset `gpiofind GPIO24`=0 tr '\0' '\377' < /dev/zero | dd bs=1M count=4 of=image iflag=fullblock dd if=${1} conv=notrunc of=image flashrom -p linux_spi:dev=/dev/spidev0.0,spispeed=20000 -w image #workaround first time fails after initial programming flashrom -p linux_spi:dev=/dev/spidev0.0,spispeed=20000 -w image gpioset `gpiofind GPIO24`=1 sleep 1 gpioget `gpiofind GPIO24` gpioget `gpiofind GPIO25`