summaryrefslogtreecommitdiffstats
path: root/ich9macchange
diff options
context:
space:
mode:
authorFrancis Rowe <info@gluglug.org.uk>2015-02-15 01:42:01 (EST)
committer Francis Rowe <info@gluglug.org.uk>2015-02-15 01:42:01 (EST)
commit489603d6d95ee41309bae07ba68d92386c6ac8a3 (patch)
tree7c2141cb18d4fe9e68dd41b8bfcddd7bb4e9db90 /ich9macchange
parentd705a0fdf5a4ebd961c831ffbf39a5fd46a80fc4 (diff)
downloadlibreboot-489603d6d95ee41309bae07ba68d92386c6ac8a3.zip
libreboot-489603d6d95ee41309bae07ba68d92386c6ac8a3.tar.gz
libreboot-489603d6d95ee41309bae07ba68d92386c6ac8a3.tar.bz2
ich9macchange: assume that the script is being run from _util
Do not act on all ROM images, but instead take as input a path to a single ROM image.
Diffstat (limited to 'ich9macchange')
-rwxr-xr-xich9macchange37
1 files changed, 17 insertions, 20 deletions
diff --git a/ich9macchange b/ich9macchange
index 683fb62..353ab5f 100755
--- a/ich9macchange
+++ b/ich9macchange
@@ -32,33 +32,30 @@ else
exit 1
fi
-if (( $# != 1 )); then
- echo "Usage: ./ich9macchange XX:XX:XX:XX:XX:XX"
+if (( $# != 3 )); then
+ echo "Usage: ./ich9macchange path/to/ich9libreboot.rom XX:XX:XX:XX:XX:XX romsize"
+ echo "'romsize' is a number in MiB. Example: 8"
echo "(XX replaced with hex from your desired MAC address)"
exit 1
fi
+rompath=$1
+macaddress=$2
+romsize=$3
-path="unknown"
-if [ -f "DEBLOB" ]; then
- path="./resources/utilities/ich9deblob/ich9gen"
-else
- path="./ich9deblob/$arch/ich9gen"
+if [ ! -f "$rompath" ]; then
+ echo "ich9macchange: ROM image specified not found."
+ exit 1
+fi
+if [ "$romsize" != "8" ]; then
+ if [ "$3" != "4" ]; then
+ echo "Invalid ROM size specified. It must be 4 or 8."
+ exit 1
+ fi
fi
-$(echo $path) --macaddress $1
+./ich9deblob/$arch/ich9gen --macaddress $macaddress
-for board in "x200" "r400"
-do
- for size in "8m" "4m"
- do
- cd bin/"$board"_"$size"b/
- for rom in $(ls)
- do
- dd if=../../ich9fdgbe_"$size".bin of="$rom" bs=1 count=12k conv=notrunc
- done
- cd ../../
- done
-done
+dd if=ich9fdgbe_"$romsize"m.bin of="$rompath" bs=1 count=12k conv=notrunc
rm -f ich9fdgbe_4m.bin
rm -f ich9fdgbe_8m.bin