diff options
author | Francis Rowe <info@gluglug.org.uk> | 2014-12-14 06:29:57 (EST) |
---|---|---|
committer | Francis Rowe <info@gluglug.org.uk> | 2014-12-14 06:29:57 (EST) |
commit | 27c283e796f660ecb8186632313b6d952a3043b5 (patch) | |
tree | 926c1b0b1944c2c7fe0ae9f5a56e68d1496b19f4 /builddeps-flashrom | |
parent | 10bdb08f5e2f0167ea7543c506abe048c7ade9c2 (diff) | |
download | libreboot-27c283e796f660ecb8186632313b6d952a3043b5.zip libreboot-27c283e796f660ecb8186632313b6d952a3043b5.tar.gz libreboot-27c283e796f660ecb8186632313b6d952a3043b5.tar.bz2 |
Update flashrom (again)
builddeps-flashrom updated to use diff's instead of whole copies
of flashchips.c, when building patched executables.
(this makes updating and maintaining flashrom easier)
Diffstat (limited to 'builddeps-flashrom')
-rwxr-xr-x | builddeps-flashrom | 30 |
1 files changed, 17 insertions, 13 deletions
diff --git a/builddeps-flashrom b/builddeps-flashrom index 4e973b1..1765e4b 100755 --- a/builddeps-flashrom +++ b/builddeps-flashrom @@ -27,22 +27,23 @@ set -u -e -v cd flashrom/ -# clean it first -make clean - -# default flashchips.c -mv flashchips.c flashchips.c_ - # 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" +for patchname in "normal" "lenovobios_macronix" "lenovobios_sst" do - cp ../resources/flashrom/patch/flashchips.c"$patchname" flashchips.c - rm -f flashrom"$patchname" + # first remove the existing build + make clean + rm -f flashrom_"$patchname" + + # backup the unpatched flashchips.c (it will be patched) + cp flashchips.c flashchips.c_ + # patch flashchips.c + patch flashchips.c < ../resources/flashrom/patch/flashchips.c.diff."$patchname" + if (( $# != 1 )); then # build it dynamically linked make @@ -50,14 +51,17 @@ do # build it statically linked make SHARED=0 CC='gcc -static' fi - mv flashrom flashrom"$patchname" + + # Rename the binary based on the patch name + mv flashrom flashrom_"$patchname" + + # restore unpatched flashchips.c rm -f flashchips.c + mv flashchips.c_ flashchips.c done +# flashrom normal should actually be considered the default mv flashrom_normal flashrom -# default flashchips.c -mv flashchips.c_ flashchips.c - cd ../ # ------------------- DONE ---------------------- |