From b840755acc24f5cebe561d5ecb3380e157de1583 Mon Sep 17 00:00:00 2001 From: Francis Rowe Date: Sat, 14 Feb 2015 20:14:27 -0500 Subject: Move all build scripts into a single generic script, with helpers All build scripts were moved to resources/scripts/helpers/ --- (limited to 'resources/scripts/helpers/build/module') diff --git a/resources/scripts/helpers/build/module/bucts b/resources/scripts/helpers/build/module/bucts new file mode 100755 index 0000000..f29d753 --- /dev/null +++ b/resources/scripts/helpers/build/module/bucts @@ -0,0 +1,52 @@ +#!/bin/bash + +# helper script: builds bucts source code +# +# Copyright (C) 2014, 2015 Francis Rowe +# +# 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 . +# + +# This script assumes that the working directory is the root +# of libreboot_src or git + +set -u -e -v + +# Build BUC.TS utility (needed for flashing ROM's on X60/T60 while Lenovo BIOS is running) +# -------------------------------------------------------------------- + +cd bucts/ + +buildtype="unknown" +if (( $# != 1 )); then + buildtype="dynamic" +else + buildtype="static" +fi + +if [ "$buildtype" = "static" ]; then + patch Makefile < ../resources/bucts/patch/staticlink.diff +fi + +make clean +make + +if [ "$buildtype" = "static" ]; then + patch Makefile -R < ../resources/bucts/patch/staticlink.diff +fi + +# done. go back to main directory +cd ../ + +# ------------------- DONE ---------------------- diff --git a/resources/scripts/helpers/build/module/coreboot b/resources/scripts/helpers/build/module/coreboot new file mode 100755 index 0000000..4ec2eac --- /dev/null +++ b/resources/scripts/helpers/build/module/coreboot @@ -0,0 +1,56 @@ +#!/bin/bash + +# helper script: builds the dependencies that coreboot needs before building a ROM image +# +# Copyright (C) 2014, 2015 Francis Rowe +# +# 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 . +# + +# This script assumes that the working directory is the root +# of libreboot_src or git + +set -u -e -v + +# Build utilities needed in coreboot directory +# -------------------------------------------------------------------- + +cd coreboot + +# ----------------------------------------- +# Build the utilities required by libreboot +# ----------------------------------------- + +# cbfstool +cd util/cbfstool/ +make +# nvramtool +cd ../nvramtool/ +make +# cbmem +cd ../cbmem/ +make + +# done. go back to coreboot dir +cd ../../ + +# ------------------------------------- +# build reference crossGCC for coreboot +# ------------------------------------- +make crossgcc-i386 + +# done. go back to main libreboot_src directory +cd ../ + +# ------------------- DONE ---------------------- diff --git a/resources/scripts/helpers/build/module/flashrom b/resources/scripts/helpers/build/module/flashrom new file mode 100755 index 0000000..7cd50cc --- /dev/null +++ b/resources/scripts/helpers/build/module/flashrom @@ -0,0 +1,81 @@ +#!/bin/bash + +# helper script: builds flashrom source code +# +# Copyright (C) 2014, 2015 Francis Rowe +# +# 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 . +# + +# This script assumes that the working directory is the root +# of libreboot_src or git + +set -u -e -v + +# Build "flashrom" (utility for flashing/dumping ROM's) +# -------------------------------------------------------------------- + +cd flashrom/ + +make clean +if (( $# != 1 )); then + make +else + if [ "$1" = "static" ]; then + make SHARED=0 CC='gcc -static' + else + make + fi +fi + +mv flashrom flashrom_normal + +# 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 "lenovobios_macronix" "lenovobios_sst" +do + # first remove the existing build + 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/"$patchname".diff + + make clean + if (( $# != 1 )); then + make + else + if [ "$1" = "static" ]; then + make SHARED=0 CC='gcc -static' + else + make + fi + fi + + # 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 + +mv flashrom_normal flashrom + +cd ../ + +# ------------------- DONE ---------------------- + diff --git a/resources/scripts/helpers/build/module/grub b/resources/scripts/helpers/build/module/grub new file mode 100755 index 0000000..1856c35 --- /dev/null +++ b/resources/scripts/helpers/build/module/grub @@ -0,0 +1,42 @@ +#!/bin/bash + +# helper script: builds GRUB source code +# +# Copyright (C) 2014, 2015 Francis Rowe +# +# 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 . +# + +# This script assumes that the working directory is the root +# of libreboot_src or git + +set -u -e -v + +# Build utilies needed for building GRUB payloads +# --------------------------------------------------------------------- + +cd grub/ + +# clean it first +[[ -f Makefile ]] && make clean + +# build grub +./autogen.sh +./configure --with-platform=coreboot +make + +# done. go back to main directory +cd ../ + +# ------------------- DONE ---------------------- diff --git a/resources/scripts/helpers/build/module/i945pwm b/resources/scripts/helpers/build/module/i945pwm new file mode 100755 index 0000000..81cef71 --- /dev/null +++ b/resources/scripts/helpers/build/module/i945pwm @@ -0,0 +1,38 @@ +#!/bin/bash + +# helper script: builds i945-pwm source code +# +# Copyright (C) 2014, 2015 Francis Rowe +# +# 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 . +# + +# This script assumes that the working directory is the root +# of libreboot_src or git + +set -u -e -v + +# Build i945-pwm utility +# -------------------------------------------------------------------- + +cd resources/utilities/i945-pwm/ + +make clean +# build it +make + +# done. go back to main directory +cd ../../../ + +# ------------------- DONE ---------------------- diff --git a/resources/scripts/helpers/build/module/ich9deblob b/resources/scripts/helpers/build/module/ich9deblob new file mode 100755 index 0000000..e77957c --- /dev/null +++ b/resources/scripts/helpers/build/module/ich9deblob @@ -0,0 +1,40 @@ +#!/bin/bash + +# helper script: builds ich9deblob source code +# +# Copyright (C) 2014, 2015 Francis Rowe +# +# 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 . +# + +# This script assumes that the working directory is the root +# of libreboot_src or git + +set -u -e -v + +# Build ich9deblob utility +# -------------------------------------------------------------------- + +cd resources/utilities/ich9deblob + +# clean it first +make clean + +# build ich9deblob +make + +# done. go back to main directory +cd ../../../ + +# ------------------- DONE ---------------------- diff --git a/resources/scripts/helpers/build/module/memtest86plus b/resources/scripts/helpers/build/module/memtest86plus new file mode 100755 index 0000000..f752080 --- /dev/null +++ b/resources/scripts/helpers/build/module/memtest86plus @@ -0,0 +1,40 @@ +#!/bin/bash + +# helper script: builds memtest86+ source code +# +# Copyright (C) 2014, 2015 Francis Rowe +# +# 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 . +# + +# This script assumes that the working directory is the root +# of libreboot_src or git + +set -u -e -v + +# Build MemTest86+ payload (for GRUB) +# -------------------------------------------------------------------- + +cd "memtest86+-5.01"/ + +# clean it first +make clean + +# build memtest86+ +make + +# done. go back to main directory +cd ../ + +# ------------------- DONE ---------------------- -- cgit v0.9.1