summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrancis Rowe <info@gluglug.org.uk>2014-11-26 04:53:33 +0000
committerFrancis Rowe <info@gluglug.org.uk>2014-11-26 04:54:50 +0000
commitf569f8af7adbcd444401902f5b6a87d710c286cc (patch)
treec45311916b1234a92ef1ec5903df82ef5a3aa0f9
parent7b7715d9ef147478ccea8ed1716b50438e5d0890 (diff)
builddeps-flashrom: reduce build commands to a single for loop
-rwxr-xr-xbuilddeps-flashrom71
-rw-r--r--resources/flashrom/patch/flashchips.c_normal (renamed from resources/flashrom/patch/flashchips.c)0
2 files changed, 25 insertions, 46 deletions
diff --git a/builddeps-flashrom b/builddeps-flashrom
index b54f1d7..250c393 100755
--- a/builddeps-flashrom
+++ b/builddeps-flashrom
@@ -18,66 +18,45 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
-# This script is used by the main "builddeps" script in libreboot src/meta archives.
-# The reason it is seperated here is so that flashrom can be built separately aswell.
-
-# To build flashrom, you will need the dependencies in "builddeb".
-# Run it, or adapt it if you do not use an "apt-get" distro.
+# To build flashrom, you will need the dependencies (se docs).
set -u -e -v
# Build "flashrom" (utility for flashing/dumping ROM's)
# --------------------------------------------------------------------
-cd flashrom
+cd flashrom/
# clean it first
make clean
-# remove modified binaries aswell
-rm -f flashrom_lenovobios_sst
-rm -f flashrom_lenovobios_macronix
-# patch flashchips.c to remove the useless Macronix entries (for X60/T60)
-# makes flashrom work without having to use "-c" switch
+# default flashchips.c
mv flashchips.c flashchips.c_
-cp ../resources/flashrom/patch/flashchips.c .
-# build flashrom
-if (( $# != 1 )); then
- make
-else
- make SHARED=0 CC='gcc -static'
-fi
-# restore default flashchips.c
-rm -f flashchips.c
-
-# backup those files
-mv flashrom flashrom_
-
-# build patched version for MX25L1605D flash chip on Lenovo BIOS X60/T60
-cp ../resources/flashrom/patch/flashchips.c_lenovobios_macronix flashchips.c
-if (( $# != 1 )); then
- make
-else
- make SHARED=0 CC='gcc -static'
-fi
-mv flashrom flashrom_lenovobios_macronix
-rm -f flashchips.c
-
-# build patched version for SST25VF016B flash chip on Lenovo BIOS X60/T60
-cp ../resources/flashrom/patch/flashchips.c_lenovobios_sst flashchips.c
-if (( $# != 1 )); then
- make
-else
- make SHARED=0 CC='gcc -static'
-fi
-mv flashrom flashrom_lenovobios_sst
-rm -f flashchips.c
-# restore default binary/source
+# build patched binary for libreboot X60/T60 (MX25L1605D chip)
+# - this patch removes redundant definitions from flashchips.c
+# - this patch removes the need to use the -c parameter in flashrom
+# build patched binaries for MX25L1605D and SST25VF016B flash chips
+# - these patches are needed for initial installation on an X60 or T60
+# - these patches are for people who have lenovo bios running
+for patchname in "_normal" "_lenovobios_macronix" "_lenovobios_sst"
+do
+ rm -f flashchips.c"$patchname"
+ cp ../resources/flashrom/patch/flashchips.c"$patchname" flashchips.c
+ rm -f flashrom"$patchname"
+ if (( $# != 1 )); then
+ make
+ else
+ make SHARED=0 CC='gcc -static'
+ fi
+ mv flashrom flashrom"$patchname"
+ rm -f flashchips.c
+done
+mv flashrom_normal flashrom
+
+# default flashchips.c
mv flashchips.c_ flashchips.c
-mv flashrom_ flashrom
-# done. go back to main directory
cd ../
# ------------------- DONE ----------------------
diff --git a/resources/flashrom/patch/flashchips.c b/resources/flashrom/patch/flashchips.c_normal
index 377232a..377232a 100644
--- a/resources/flashrom/patch/flashchips.c
+++ b/resources/flashrom/patch/flashchips.c_normal