heads/initrd/bin/flashrom-kgpe-d16.sh

32 lines
497 B
Bash
Raw Normal View History

2018-03-01 05:40:46 +00:00
#!/bin/sh
. /etc/functions
if [ "$1" = "-c" ]; then
CLEAN=1
ROM="$2"
else
CLEAN=0
ROM="$1"
fi
if [ ! -e "$ROM" ]; then
die "Usage: $0 [-c] /media/kgpe-d16.rom"
2018-03-01 05:40:46 +00:00
fi
cp "$ROM" /tmp/kgpe-d16.rom
sha256sum /tmp/kgpe-d16.rom
if [ "$CLEAN" -eq 0 ]; then
preserve_rom /tmp/kgpe-d16.rom \
|| die "$ROM: Config preservation failed"
fi
2018-03-01 05:40:46 +00:00
flashrom \
--force \
--noverify \
--programmer internal \
-w /tmp/kgpe-d16.rom \
|| die "$ROM: Flash failed"
warn "Reboot and hopefully it works..."
exit 0