aboutsummaryrefslogtreecommitdiff
path: root/resources/scripts
diff options
context:
space:
mode:
authorFrancis Rowe <info@gluglug.org.uk>2015-02-15 06:44:12 +0000
committerFrancis Rowe <info@gluglug.org.uk>2015-02-15 06:44:12 +0000
commit9e625cd3ee2a1b26e41ef5a635817b2cd1a0a886 (patch)
tree716752a227c80ccac089d4d4fbdde059343750b5 /resources/scripts
parent489603d6d95ee41309bae07ba68d92386c6ac8a3 (diff)
downloadlibrebootfr-9e625cd3ee2a1b26e41ef5a635817b2cd1a0a886.tar.gz
librebootfr-9e625cd3ee2a1b26e41ef5a635817b2cd1a0a886.zip
Moved ich9macchange to resources/scripts/misc/ich9macchange
Diffstat (limited to 'resources/scripts')
-rwxr-xr-xresources/scripts/helpers/build/release/archives2
-rwxr-xr-xresources/scripts/misc/ich9macchange63
2 files changed, 64 insertions, 1 deletions
diff --git a/resources/scripts/helpers/build/release/archives b/resources/scripts/helpers/build/release/archives
index 87406fb9..21372759 100755
--- a/resources/scripts/helpers/build/release/archives
+++ b/resources/scripts/helpers/build/release/archives
@@ -326,7 +326,7 @@ cp coreboot/src/mainboard/lenovo/x200/cmos.layout libreboot_util/cmoslayouts/x20
cp flash libreboot_util/
# ich9macchange script (change MAC address on X200 ROMs, using ich9gen)
-cp ich9macchange libreboot_util/
+cp resources/scripts/misc/ich9macchange libreboot_util/
# for changing the GRUB background
cp resources/scripts/misc/grub-background libreboot_util/
diff --git a/resources/scripts/misc/ich9macchange b/resources/scripts/misc/ich9macchange
new file mode 100755
index 00000000..353ab5f7
--- /dev/null
+++ b/resources/scripts/misc/ich9macchange
@@ -0,0 +1,63 @@
+#!/bin/bash
+
+# ich9macchange script: uses ich9gen to change the MAC address on GM45/GS45 machines.
+#
+# Copyright (C) 2014, 2015 Francis Rowe <info@gluglug.org.uk>
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+
+set -u -e -v
+
+arch="unknown"
+if [ $(uname -i) = "i686" ] || [ $(uname -m) = "i686" ]; then
+ arch="i686"
+elif [ $(uname -i) = "x86_64" ] || [ $(uname -m) = "x86_64" ]; then
+ arch="x86_64"
+elif [ $(uname -i) = "armv7l" ] || [ $(uname -m) = "armv7l" ]; then
+ arch="armv7l"
+else
+ echo "This script must be run on an i686, x86_64 or armv7l host."
+ exit 1
+fi
+
+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
+
+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
+
+./ich9deblob/$arch/ich9gen --macaddress $macaddress
+
+dd if=ich9fdgbe_"$romsize"m.bin of="$rompath" bs=1 count=12k conv=notrunc
+
+rm -f ich9fdgbe_4m.bin
+rm -f ich9fdgbe_8m.bin
+rm -f mkgbe.c
+rm -f mkgbe.h