aboutsummaryrefslogtreecommitdiff
path: root/flash
diff options
context:
space:
mode:
authorFrancis Rowe <info@gluglug.org.uk>2014-11-28 05:31:01 +0000
committerFrancis Rowe <info@gluglug.org.uk>2014-11-28 05:31:01 +0000
commitfcfbe065403118aaf058c6239995b765760f62ed (patch)
tree6bbba6050baba9f0e2c801b2f75d0039e0dfb0b5 /flash
parentf659e04322d3631031e88909671b552286bebf6f (diff)
downloadlibrebootfr-fcfbe065403118aaf058c6239995b765760f62ed.tar.gz
librebootfr-fcfbe065403118aaf058c6239995b765760f62ed.zip
flash: add comments
Diffstat (limited to 'flash')
-rwxr-xr-xflash9
1 files changed, 6 insertions, 3 deletions
diff --git a/flash b/flash
index 2c6e8006..98605f78 100755
--- a/flash
+++ b/flash
@@ -22,6 +22,7 @@
# set -u -e -v
set -v
+# These are the tested platforms
if [ $(uname -i) = "i686" ] || [ $(uname -m) = "i686" ]
then
echo "Running on i686. ok."
@@ -35,25 +36,27 @@ else
exit 1
fi
+# the user must be root to use flashrom
if [[ $EUID -ne 0 ]]; then
echo "This script must be run as root"
exit 1
fi
-# USE ROOT OR SUDO WHEN EXECUTING THIS
-# uses flashrom to flash the rom
-
+# check that the user supplied a path to a ROM image:
if (( $# != 1 )); then
echo "Usage: ./lenovobios_firstflash yourrom.rom"
echo "usage: ./lenovobios_firstflash path/to/yourrom.rom"
echo "You need to specify exactly 1 file"
exit 1
fi
+# if the user did supply a path, check that it exists:
if [ ! -f $1 ]; then
echo "File not found!"
exit 1
fi
+# Use flashrom to flash the ROM image:
+
if [ -f "DEBLOB" ]; then
# Means we are in src archive or git
./flashrom/flashrom -p internal -w $1