diff options
author | Francis Rowe <info@gluglug.org.uk> | 2014-11-28 05:31:01 +0000 |
---|---|---|
committer | Francis Rowe <info@gluglug.org.uk> | 2014-11-28 05:31:01 +0000 |
commit | fcfbe065403118aaf058c6239995b765760f62ed (patch) | |
tree | 6bbba6050baba9f0e2c801b2f75d0039e0dfb0b5 | |
parent | f659e04322d3631031e88909671b552286bebf6f (diff) | |
download | librebootfr-fcfbe065403118aaf058c6239995b765760f62ed.tar.gz librebootfr-fcfbe065403118aaf058c6239995b765760f62ed.zip |
flash: add comments
-rwxr-xr-x | flash | 9 |
1 files changed, 6 insertions, 3 deletions
@@ -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 |