aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--docs/hcl/gm45_remove_me.html21
-rwxr-xr-xich9macchange37
2 files changed, 28 insertions, 30 deletions
diff --git a/docs/hcl/gm45_remove_me.html b/docs/hcl/gm45_remove_me.html
index eff0eac5..47a60f88 100644
--- a/docs/hcl/gm45_remove_me.html
+++ b/docs/hcl/gm45_remove_me.html
@@ -67,6 +67,14 @@
</p>
<p>
+ Two new files will be created:
+ </p>
+ <ul>
+ <li><b>ich9fdgbe_4m.bin</b>: this is for GM45 laptops with the 4MB flash chip.</li>
+ <li><b>ich9fdgbe_8m.bin</b>: this is for GM45 laptops with the 8MB flash chip.</li>
+ </ul>
+
+ <p>
You can find out your MAC address from <b>ip addr</b> or <b>ifconfig</b> in GNU/Linux.
Alternatively, if you are running libreboot already (with the correct MAC address in your
ROM), dump it (flashrom -r) and read the first 6 bytes from position 0x1000 (or 0x2000) in a hex editor
@@ -81,18 +89,11 @@
</p>
<p>
- A bash script is also included in libreboot which will change the mac address (using ich9gen)
+ A bash script is also included in libreboot_util which will change the mac address (using ich9gen)
on all GM45 ROM images. For instance:<br/>
- $ <b>./ich9macchange XX:XX:XX:XX:XX:XX</b>
+ $ <b>./ich9macchange path/to/libreboot.rom XX:XX:XX:XX:XX:XX romsize</b><br/>
+ <b>romsize</b> should be 4 or 8, depending on whether the ROM image is for a 4MiB or 8MiB flash chip.
</p>
-
- <p>
- Two new files will be created:
- </p>
- <ul>
- <li><b>ich9fdgbe_4m.bin</b>: this is for GM45 laptops with the 4MB flash chip.</li>
- <li><b>ich9fdgbe_8m.bin</b>: this is for GM45 laptops with the 8MB flash chip.</li>
- </ul>
<p>
ich9gen executables can be found under ./ich9deblob/ statically compiled in
diff --git a/ich9macchange b/ich9macchange
index 683fb627..353ab5f7 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