2017-03-30 21:12:22 +00:00
|
|
|
#!/bin/sh
|
2017-04-12 10:50:18 +00:00
|
|
|
. /etc/functions
|
|
|
|
|
2018-04-22 00:21:37 +00:00
|
|
|
if [ "$1" = "-c" ]; then
|
|
|
|
CLEAN=1
|
|
|
|
ROM="$2"
|
|
|
|
else
|
|
|
|
CLEAN=0
|
|
|
|
ROM="$1"
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ ! -e "$ROM" ]; then
|
|
|
|
die "Usage: $0 [-c] /media/x230.rom"
|
2017-04-12 10:50:18 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
cp "$ROM" /tmp/x230.rom
|
|
|
|
sha256sum /tmp/x230.rom
|
2018-04-22 00:21:37 +00:00
|
|
|
if [ "$CLEAN" -eq 0 ]; then
|
|
|
|
preserve_rom /tmp/x230.rom \
|
|
|
|
|| die "$ROM: Config preservation failed"
|
|
|
|
fi
|
2017-03-30 21:12:22 +00:00
|
|
|
|
|
|
|
flashrom \
|
|
|
|
--force \
|
|
|
|
--noverify \
|
|
|
|
--programmer internal \
|
2018-04-30 21:16:06 +00:00
|
|
|
--ifd \
|
2017-03-30 21:12:22 +00:00
|
|
|
--image BIOS \
|
2017-04-12 10:50:18 +00:00
|
|
|
-w /tmp/x230.rom \
|
|
|
|
|| die "$ROM: Flash failed"
|
|
|
|
|
|
|
|
warn "Reboot and hopefully it works..."
|
|
|
|
exit 0
|