diff options
author | 4 of 7 (Leah Rowe) info@minifree.org <info@minifree.org> | 2017-01-21 18:14:33 +0000 |
---|---|---|
committer | 4 of 7 (Leah Rowe) info@minifree.org <info@minifree.org> | 2017-01-21 18:18:20 +0000 |
commit | 4b0752e1c264c4ba2a354507ca97bb2e039dda1a (patch) | |
tree | dca24f3d11087443aa9c8b2d823ed1d5b8dad001 /resources/scripts/helpers/download | |
parent | 3c17e8d80e5bacacddb8be37b598cd91cf543539 (diff) | |
download | librebootfr-4b0752e1c264c4ba2a354507ca97bb2e039dda1a.tar.gz librebootfr-4b0752e1c264c4ba2a354507ca97bb2e039dda1a.zip |
re-add old build system (for x86 boards/utils)
Everything will be migrated over to the new build system after release.
Diffstat (limited to 'resources/scripts/helpers/download')
-rwxr-xr-x | resources/scripts/helpers/download/bucts | 59 | ||||
-rwxr-xr-x | resources/scripts/helpers/download/coreboot | 153 | ||||
-rwxr-xr-x | resources/scripts/helpers/download/crossgcc | 55 | ||||
-rwxr-xr-x | resources/scripts/helpers/download/depthcharge | 75 | ||||
-rwxr-xr-x | resources/scripts/helpers/download/flashrom | 65 | ||||
-rwxr-xr-x | resources/scripts/helpers/download/grub | 71 | ||||
-rwxr-xr-x | resources/scripts/helpers/download/memtest86plus | 71 | ||||
-rwxr-xr-x | resources/scripts/helpers/download/seabios | 50 |
8 files changed, 599 insertions, 0 deletions
diff --git a/resources/scripts/helpers/download/bucts b/resources/scripts/helpers/download/bucts new file mode 100755 index 00000000..e516ade8 --- /dev/null +++ b/resources/scripts/helpers/download/bucts @@ -0,0 +1,59 @@ +#!/bin/bash + +# helper script: downloads bucts and patches it +# +# Copyright (C) 2014, 2015 Leah Rowe <info@minifree.org> +# +# 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/>. +# + +# This script assumes that the working directory is the +# root of libreboot_src or libreboot git. + +[ "x${DEBUG+set}" = 'xset' ] && set -v +set -u -e + +# Get bucts and checkout last revision used + +# Remove the old version that may exist +# ------------------------------------------------------------------------------ + +printf "Downloading bucts\n" + +rm -Rf "bucts/" + +# Get bucts +# ------------------------------------------------------------------------------ + +# download it using git +git clone git://git.stuge.se/bucts.git + +# modifications are required +cd "bucts/" + +# Reset to the last commit that was tested +# ------------------------------------------------------------------------------ + +printf "Patching bucts to not require git for building\n" +git reset --hard dc27919d7a66a6e8685ce07c71aefa4f03ef7c07 + +# Apply patches +# ------------------------------------------------------------------------------ + +git am "../resources/bucts/patch/0001-Makefile-don-t-use-git.patch" + +# we're done +cd "../" + +printf "\n\n" diff --git a/resources/scripts/helpers/download/coreboot b/resources/scripts/helpers/download/coreboot new file mode 100755 index 00000000..daa3b649 --- /dev/null +++ b/resources/scripts/helpers/download/coreboot @@ -0,0 +1,153 @@ +#!/bin/bash + +# helper script: downloads coreboot and patches/deblobs it +# +# Copyright (C) 2014, 2015, 2016 Leah Rowe <info@minifree.org> +# Copyright (C) 2015 Paul Kocialkowski <contact@paulk.fr> +# +# 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/>. +# + +# This script assumes that the working directory is the +# root of libreboot_src or libreboot git. + +[ "x${DEBUG+set}" = 'xset' ] && set -v +set -u -e + +if [ -f "version" ]; then + # _src release archive is being used + version="libreboot-$(cat version)" +else + # git repo is being used + version="libreboot-$(git describe --tags HEAD)" +fi + +make_coreboot_src_directory() { + payload="${1}" + cbrevision="${2}" + vbootrevision="${3}" + firmwarepath="${4}" # libreboot_src/coreboot/ +( + cd "${firmwarepath}/" + # copy coreboot directory there + rm -Rf "${payload:?}/${cbrevision:?}/" + if [ ! -d "${payload}/" ]; then + mkdir -p "${payload}/" + fi + cp -R "coreboot/" "${payload}/${cbrevision}/" + + # We need to reset that revision of coreboot to the specified revision + cd "${payload}/${cbrevision}/" + git reset --hard ${cbrevision} + + if [ "${vbootrevision}" != "no_vboot_revision" ]; then + # reset vboot revision. in practise, we always use the same + # vboot revision on all boards that use a given coreboot revision + cd "3rdparty/vboot/" + git reset --hard ${vbootrevision} + fi +) +} + +printf "Downloading coreboot, patching coreboot and deblobbing coreboot\n" + +# This grabs current base used, and applies patches +# This is also used to run the deblob scripts. + +# Remove the old version that may exist +# ------------------------------------------------------------------------------ + +rm -Rf "coreboot/" + +mkdir "coreboot/" + +cd "coreboot/" + +# Get latest coreboot: +# ------------------------------------------------------------------------------ + +# download it using git +git clone https://review.coreboot.org/coreboot || git clone https://github.com/coreboot/coreboot.git + +# there are modifications required +cd "coreboot/" + +# Define a common version (based on the libreboot version) +# Most likely redundant, because the build system needs to update +# this every time when building a ROM image anyway +printf '%s\n' "${version}" >".coreboot-version" + +# vboot submodule is needed +# ------------------------------------------------------------------------------ + +git submodule update --init --checkout -- 3rdparty/vboot/ + +# Create branches, with patches in each branch +# Create separate coreboot source directories *for each board* +# ------------------------------------------------------------------------------ + +for payloads in ../../resources/libreboot/config/*; do + + if [ ! -d "${payloads}/" ]; then + continue + fi + + payload="${payloads##*/}" + + for boardconfig in ../../resources/libreboot/config/${payload}/*; do + + if [ ! -d "${boardconfig}/" ]; then + continue + fi + + cbrevision=$(cat "${boardconfig}/cbrevision") + vbootrevision=$(cat "${boardconfig}/vbootrevision") + + # the same vboot revision is always used for coreboot revision, + # so we don't need to wworry about checking for that here + + if [ -d "../${cbrevision}/${cbrevision}" ]; then + continue + # the directory already exists, no need to recreate it + fi + + make_coreboot_src_directory ${cbrevision} ${cbrevision} ${vbootrevision} .. + done +done + +# go back to _src/coreboot/ (containing all coreboot directories) +cd "../" +# delete the gitted one (not needed anymore) +rm -Rf "coreboot/" + +# Run coreboot-libre deblob scripts +# ------------------------------------------------------------------------------ + +printf "Deleting .git* in coreboot/ (history inside .git contains the blobs that were deleted)\n" +rm -Rf */*/.git* +rm -Rf */*/3rdparty/*/.git* + +# Delete crossgcc from non-crossgcc coreboot archives +# (the build system will create symlinks later when building the ROM images) +for payload in *; do + if [ "${payload##*/}" != "crossgcc" ]; then + rm -Rf ${payload:?}/*/util/crossgcc/ + fi +done +cd "../" + +printf "Deblobbing coreboot\n" +./resources/utilities/coreboot-libre/deblob + +printf "\n\n" diff --git a/resources/scripts/helpers/download/crossgcc b/resources/scripts/helpers/download/crossgcc new file mode 100755 index 00000000..6b77917c --- /dev/null +++ b/resources/scripts/helpers/download/crossgcc @@ -0,0 +1,55 @@ +#!/bin/bash + +# helper script: downloads crossgcc, for building coreboot +# +# Copyright (C) 2016 Leah Rowe <info@minifree.org> +# +# 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/>. +# + +# This script assumes that the working directory is the +# root of libreboot_src or libreboot git. + +[ "x${DEBUG+set}" = 'xset' ] && set -v +set -u -e + +if [ -f "version" ]; then + # _src release archive is being used + version="libreboot-$(cat version)" +else + # git repo is being used + version="libreboot-$(git describe --tags HEAD)" +fi + +# coreboot revisios used for crossgcc +crossgccrevision="00aa45391ddb22b5ac24151d54615ca1d89eb745" +vbootrevision="d187cd3fc792f8bcefbee4587c83eafbd08441fc" + +rm -Rf "crossgcc/" +( + git clone https://review.coreboot.org/coreboot crossgcc || git clone https://github.com/coreboot/coreboot.git crossgcc + cd "crossgcc/" + git reset --hard ${crossgccrevision} + git submodule update --init --checkout -- 3rdparty/vboot/ + ( + cd 3rdparty/vboot/ + git reset --hard ${vbootrevision} + ) + rm -Rf .git* */*/.git* +) + +printf "Deblobbing coreboot\n" +./resources/utilities/coreboot-libre/deblob + + diff --git a/resources/scripts/helpers/download/depthcharge b/resources/scripts/helpers/download/depthcharge new file mode 100755 index 00000000..9827a346 --- /dev/null +++ b/resources/scripts/helpers/download/depthcharge @@ -0,0 +1,75 @@ +#!/bin/bash + +# helper script: downloads depthcharge and patches it +# +# Copyright (C) 2015 Paul Kocialkowski <contact@paulk.fr> +# +# 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/>. +# + +# This script assumes that the working directory is the +# root of libreboot_src or libreboot git. + +[ "x${DEBUG+set}" = 'xset' ] && set -v +set -u -e + +# Get depthcharge and patch it + +printf "Downloading depthcharge\n" + +rm -Rf "depthcharge/" + +# Get depthcharge +# ------------------------------------------------------------------------------ + +# download depthcharge from git +git clone https://chromium.googlesource.com/chromiumos/platform/depthcharge + +# enter the tree to patch it +cd "depthcharge/" + +# reset to the latest previously tested revision +git reset --hard 065ba14bc56c9044247fef6337d8f9e9a3055820 + +# Patch depthcharge +# ------------------------------------------------------------------------------ + +printf "arm: armv7-a march abi flag for ARMv7 hardware\n" +git am "../resources/depthcharge/patch/0001-arm-armv7-a-march-abi-flag-for-ARMv7-hardware.patch" + +printf "Coreboot image integration removal\n" +git am "../resources/depthcharge/patch/0002-Coreboot-image-integration-removal.patch" + +printf "DOTCONFIG location correction\n" +git am "../resources/depthcharge/patch/0003-DOTCONFIG-location-correction.patch" + +printf "Adaptation for a read-only boot path when no vboot handoff data is found\n" +git am "../resources/depthcharge/patch/0004-Adaptation-for-a-read-only-boot-path-when-no-vboot-h.patch" + +printf "vboot: Only initialize cparams once\n" +git am "../resources/depthcharge/patch/0005-vboot-Only-initialize-cparams-once.patch" + +printf "Proper firmware index report for read-only boot path\n" +git am "../resources/depthcharge/patch/0006-Proper-firmware-index-report-for-read-only-boot-path.patch" + +printf "fdt: nonvolatile-context-storage report to mkbp for EC NV storage\n" +git am "../resources/depthcharge/patch/0007-fdt-nonvolatile-context-storage-report-to-mkbp-for-E.patch" + +printf "vboot: Display callbacks for developer and recovery mode screens\n" +git am "../resources/depthcharge/patch/0008-vboot-Display-callbacks-for-developer-and-recovery-m.patch" + +# leave the tree +cd "../" + +printf "\n\n" diff --git a/resources/scripts/helpers/download/flashrom b/resources/scripts/helpers/download/flashrom new file mode 100755 index 00000000..e7a58949 --- /dev/null +++ b/resources/scripts/helpers/download/flashrom @@ -0,0 +1,65 @@ +#!/bin/bash + +# helper script: downloads flashrom and patches it +# +# Copyright (C) 2014, 2015 Leah Rowe <info@minifree.org> +# +# 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/>. +# + +# This script assumes that the working directory is the +# root of libreboot_src or libreboot git. + +[ "x${DEBUG+set}" = 'xset' ] && set -v +set -u -e + +# Get flashrom at the last previously tested revision + +# Remove the old version that may still exist: +# ------------------------------------------------------------------------------ + +printf "Downloading flashrom\n" + +rm -Rf "flashrom/" + +# Get flashrom +# ------------------------------------------------------------------------------ + +# download it using git +git clone https://github.com/stefanct/flashrom.git + +( +cd "flashrom/" + +# reset to known revision +git checkout 0.9.9 +git reset --hard + +# Apply patches +# ------------------------------------------------------------------------------ + +printf "Enabling whitelist for X200S, X200 Tablet, T400, T500 and R400\n" +git am "../resources/flashrom/patch/0001-New-laptops-whitelisted-ThinkPad-R400-and-ThinkPad-T.patch" + +printf "Enabling whitelist for Libiquity Taurinus X200\n" +git am "../resources/flashrom/patch/0002-Add-whitelist-for-Taurinus-X200-laptop.patch" + +# Remove redundant definitions for the flash chips that +# supported libreboot systems use. This removes the need +# for the user to run with the "-c" argument on these systems +printf "Patching flashchips.c to remove the redundant entries\n" +git am "../resources/flashrom/patch/0003-purged-chips.patch" +) + +printf "\n\n" diff --git a/resources/scripts/helpers/download/grub b/resources/scripts/helpers/download/grub new file mode 100755 index 00000000..d0d42817 --- /dev/null +++ b/resources/scripts/helpers/download/grub @@ -0,0 +1,71 @@ +#!/bin/bash + +# helper script: Downloads GRUB and patches it. +# +# Copyright (C) 2014, 2015, 2016 Leah Rowe <info@minifree.org> +# +# 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/>. +# + +# This script assumes that the working directory is the +# root of libreboot_src or libreboot git. + +[ "x${DEBUG+set}" = 'xset' ] && set -v +set -u -e + +# Remove the old version that may still exist +# ------------------------------------------------------------------------------ + +printf "Downloading GRUB\n" + +rm -Rf "grub/" + +# Get latest GRUB +# ------------------------------------------------------------------------------ + +# download it using git +git clone git://git.savannah.gnu.org/grub.git || git clone http://git.savannah.gnu.org/r/grub.git + +# modifications are required +cd "grub/" + +# reset to known revision +git reset --hard 7f2a856faec951b7ab816880bd26e1e10b17a596 + +# Apply patches +# ------------------------------------------------------------------------------ + +# Replace "GNU GRUB version" in GRUB screen with "FREE AS IN FREEDOM" +git am "../resources/grub/patch/0001-grub-core-normal-main.c-Display-FREE-AS-IN-FREEDOM-n.patch" + +# GRUB enhancement patches from grub.johnlane.ie (rebased in libreboot's GRUB, unofficially, on 30 November 2015) +git am "../resources/grub/patch/grub.johnlane.ie/0001-Cryptomount-support-LUKS-detached-header.patch" +git am "../resources/grub/patch/grub.johnlane.ie/0002-Cryptomount-support-key-files.patch" +git am "../resources/grub/patch/grub.johnlane.ie/0003-Cryptomount-luks-allow-multiple-passphrase-attempts.patch" +git am "../resources/grub/patch/grub.johnlane.ie/0004-Cryptomount-support-plain-dm-crypt.patch" +git am "../resources/grub/patch/grub.johnlane.ie/0005-Cryptomount-support-for-hyphens-in-UUID.patch" +# hotfix from kl3 (merged from autoboot) (ditto) +git am "../resources/grub/patch/grub.johnlane.ie/0006-grub-core-disk-cryptodisk.c-Point-to-const-char.patch" + +# Needed for reproducible builds in GRUB +git am "../resources/grub/patch/reproducible/0001-mkstandalone-add-argument-fixed-time-to-override-mti.patch" +git am "../resources/grub/patch/reproducible/0002-mkrescue-add-argument-fixed-time-to-get-reproducible.patch" +git am "../resources/grub/patch/reproducible/0003-Makefile-use-FIXED_TIMESTAMP-for-mkstandalone-if-set.patch" + +cd "../" + +# Also download SeaBIOS, which we use with GRUB, to implement SeaGRUB +./download seabios + +printf "\n\n" diff --git a/resources/scripts/helpers/download/memtest86plus b/resources/scripts/helpers/download/memtest86plus new file mode 100755 index 00000000..920d16fd --- /dev/null +++ b/resources/scripts/helpers/download/memtest86plus @@ -0,0 +1,71 @@ +#!/bin/bash + +# helper script: Downloads MemTest86+ and patches it +# +# Copyright (C) 2014, 2015 Leah Rowe <info@minifree.org> +# Copyright (C) 2015 Joseph Michael Thompson <jmt@josepht.me> +# Copyright (C) 2015 Klemens Nanni <contact@autoboot.org> +# +# 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/>. +# + +# This script assumes that the working directory is the +# root of libreboot_src or libreboot git. + +[ "x${DEBUG+set}" = 'xset' ] && set -v +set -u -e + +# Get the last version of MemTest86+ used, apply patches, build it. + +# Remove the old version that may exist +# ------------------------------------------------------------------------------ + +printf "Downloading MemTest86+\n" + +rm -Rf "memtest86plus/" + +# Get latest memtest86+: +# ------------------------------------------------------------------------------ + +# download it using wget +wget http://www.memtest.org/download/5.01/memtest86+-5.01.tar.gz + +if [ "$(sha512sum memtest86+-5.01.tar.gz | cut -c1-128)" = "d872db35ef733ec8f49094251f2bf6b98cc80eb06d04044be3aecf28d534f24ba293a08b9979b112dbd07cf27368148939a33a32c7010fc9581a3a5b150c94d7" ]; then + printf "Valid checksum for memtest86plus\n" +else + rm -f "memtest86+-5.01.tar.gz" + printf "Invalid checksum for memtest86plus\n" + exit 1 +fi + +# extract it +tar -xzf "memtest86+-5.01.tar.gz" + +# delete the tar file (no longer needed) +rm -f "memtest86+-5.01.tar.gz" + +# make direcotory name consistent +mv "memtest86+-5.01/" "memtest86plus/" + +# Apply necessary patches +# ------------------------------------------------------------------------------ + +( +cd "memtest86plus/" +for patch in ../resources/memtest86plus/patch/*; do + patch < "${patch}" +done +) + +printf "\n\n" diff --git a/resources/scripts/helpers/download/seabios b/resources/scripts/helpers/download/seabios new file mode 100755 index 00000000..39036ebb --- /dev/null +++ b/resources/scripts/helpers/download/seabios @@ -0,0 +1,50 @@ +#!/bin/bash +# +# Copyright (C) 2015, 2016 Leah Rowe <info@minifree.org> +# +# 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/>. +# + +# This script assumes that the working directory is the +# root of libreboot_src or libreboot git. + +[ "x${DEBUG+set}" = 'xset' ] && set -v +set -u -e + +# Get SeaBIOS, revert to commit last used and apply patches. + +# Remove the old version that may still exist +# ------------------------------------------------------------------------------ + +printf "Downloading SeaBIOS\n" + +rm -rf "seabios/" + +# Get latest SeaBIOS +# ------------------------------------------------------------------------------ + +# download it using git +git clone git://git.seabios.org/seabios.git seabios + +( +# modifications are required +cd "seabios/" + +# Reset to the last commit that was tested (we use stable releases for seabios) +# ------------------------------------------------------------------------------ + +git reset --hard rel-1.9.1 +) + + |