diff options
Diffstat (limited to 'i18n/fr_FR/resources/scripts')
49 files changed, 4098 insertions, 0 deletions
diff --git a/i18n/fr_FR/resources/scripts/helpers/build/clean/bucts b/i18n/fr_FR/resources/scripts/helpers/build/clean/bucts new file mode 100755 index 00000000..202b3bad --- /dev/null +++ b/i18n/fr_FR/resources/scripts/helpers/build/clean/bucts @@ -0,0 +1,38 @@ +#!/usr/bin/env bash + +# helper script: clean the dependencies that were built in bucts +# +# 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 current working directory is the root +# of libreboot_src or libreboot git + +[ "x${DEBUG+set}" = 'xset' ] && set -v +set -u -e + +# clean bucts +# -------------------------------------------------------- + +printf "Cleaning the previous build of bucts\n" + +cd "bucts/" +make clean + +printf "\n\n" + +# done. go back to main directory. +cd "../" diff --git a/i18n/fr_FR/resources/scripts/helpers/build/clean/coreboot b/i18n/fr_FR/resources/scripts/helpers/build/clean/coreboot new file mode 100755 index 00000000..b9580f4a --- /dev/null +++ b/i18n/fr_FR/resources/scripts/helpers/build/clean/coreboot @@ -0,0 +1,48 @@ +#!/usr/bin/env bash + +# helper script: clean the dependencies that were built in coreboot +# +# Copyright (C) 2014, 2015, 2016 Leah Rowe <info@minifree.org> +# 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 current working directory is the root + +[ "x${DEBUG+set}" = 'xset' ] && set -v +set -u -e + +# clean coreboot utilities (dependencies for 'build'): + +printf "Cleaning the previous build of coreboot and its utilities\n" + +# clean coreboot and crossgcc (source archives preserved) +for payload in coreboot/*; do + for board in "${payload}/"*; do + + # Clean coreboot, of course + make -C "${board}/" distclean + + # Clean its utilities as well + for util in {cbfs,ifd,nvram}tool cbmem; do + make -C "${board}/util/${util}/" clean + done + make -C "${board}/payloads/libpayload/" distclean + + rm -f "${board}/util/crossgcc" + done +done + +printf "\n\n" diff --git a/i18n/fr_FR/resources/scripts/helpers/build/clean/crossgcc b/i18n/fr_FR/resources/scripts/helpers/build/clean/crossgcc new file mode 100755 index 00000000..5e572a04 --- /dev/null +++ b/i18n/fr_FR/resources/scripts/helpers/build/clean/crossgcc @@ -0,0 +1,28 @@ +#!/usr/bin/env bash + +# helper script: clean the dependencies that were built in coreboot +# +# Copyright (C) 2014, 2015, 2016 Leah Rowe <info@minifree.org> +# 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 current working directory is the root + +[ "x${DEBUG+set}" = 'xset' ] && set -v +set -u -e + +make -C "crossgcc/" crossgcc-clean + diff --git a/i18n/fr_FR/resources/scripts/helpers/build/clean/flashrom b/i18n/fr_FR/resources/scripts/helpers/build/clean/flashrom new file mode 100755 index 00000000..a8f1fa34 --- /dev/null +++ b/i18n/fr_FR/resources/scripts/helpers/build/clean/flashrom @@ -0,0 +1,35 @@ +#!/usr/bin/env bash + +# helper script: clean the dependencies that were built in flashrom +# +# Copyright (C) 2014, 2015 Leah Rowe <info@minifree.org> +# 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 current working directory is the root +# of git or release archive + +[ "x${DEBUG+set}" = 'xset' ] && set -v +set -u -e + +printf "Cleaning the previous build of flashrom\n" + +# clean flashrom +make -C flashrom clean +rm -f "flashrom/flashrom_lenovobios_sst" +rm -f "flashrom/flashrom_lenovobios_macronix" + +printf "\n\n" diff --git a/i18n/fr_FR/resources/scripts/helpers/build/clean/grub b/i18n/fr_FR/resources/scripts/helpers/build/clean/grub new file mode 100755 index 00000000..a3d21d46 --- /dev/null +++ b/i18n/fr_FR/resources/scripts/helpers/build/clean/grub @@ -0,0 +1,35 @@ +#!/usr/bin/env bash + +# helper script: clean the dependencies that were built in GRUB +# +# Copyright (C) 2014, 2015, 2016 Leah Rowe <info@minifree.org> +# 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 current working directory is the root +# of git or release archive + +[ "x${DEBUG+set}" = 'xset' ] && set -v +set -u -e + +printf "Cleaning the previous build of GRUB\n" +# clean GURB +[ -d grub/Makefile ] && make -C grub distclean + +# Also clean SeaBIOS +./oldbuild clean seabios + +printf "\n\n" diff --git a/i18n/fr_FR/resources/scripts/helpers/build/clean/i945pwm b/i18n/fr_FR/resources/scripts/helpers/build/clean/i945pwm new file mode 100755 index 00000000..b746d279 --- /dev/null +++ b/i18n/fr_FR/resources/scripts/helpers/build/clean/i945pwm @@ -0,0 +1,34 @@ +#!/usr/bin/env bash + +# helper script: clean the dependencies that were built in i945pwm +# +# 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 current working directory is the root +# of libreboot_src or libreboot git + +[ "x${DEBUG+set}" = 'xset' ] && set -v +set -u -e + +# clean i945-pwm utility +# -------------------------------------------------------------------- + +printf "Cleaning the previous build of i945-pwm\n" +cd "resources/utilities/i945-pwm/" +make clean +cd "../../../" +printf "\n\n" diff --git a/i18n/fr_FR/resources/scripts/helpers/build/clean/ich9deblob b/i18n/fr_FR/resources/scripts/helpers/build/clean/ich9deblob new file mode 100755 index 00000000..6d3687ac --- /dev/null +++ b/i18n/fr_FR/resources/scripts/helpers/build/clean/ich9deblob @@ -0,0 +1,34 @@ +#!/usr/bin/env bash + +# helper script: clean the dependencies that were built in ich9deblob +# +# 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 current working directory is the root +# of libreboot_src or libreboot git + +[ "x${DEBUG+set}" = 'xset' ] && set -v +set -u -e + +# clean ich9deblob utility +# -------------------------------------------------------------------- + +printf "Cleaning the previous build of ich9deblob\n" +cd "resources/utilities/ich9deblob/" +make clean +cd "../../../" +printf "\n\n" diff --git a/i18n/fr_FR/resources/scripts/helpers/build/clean/memtest86plus b/i18n/fr_FR/resources/scripts/helpers/build/clean/memtest86plus new file mode 100755 index 00000000..271a46ea --- /dev/null +++ b/i18n/fr_FR/resources/scripts/helpers/build/clean/memtest86plus @@ -0,0 +1,33 @@ +#!/usr/bin/env bash + +# helper script: clean the dependencies that were built in memtest86+ +# +# Copyright (C) 2014, 2015 Leah Rowe <info@minifree.org> +# 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 current working directory is the root +# of git or release archive + +[ "x${DEBUG+set}" = 'xset' ] && set -v +set -u -e + +printf "Cleaning the previous build of MemTest86+\n" + +# clean MemTest86+ +make -C memtest86plus clean + +printf "\n\n" diff --git a/i18n/fr_FR/resources/scripts/helpers/build/clean/rom_images b/i18n/fr_FR/resources/scripts/helpers/build/clean/rom_images new file mode 100755 index 00000000..cac69226 --- /dev/null +++ b/i18n/fr_FR/resources/scripts/helpers/build/clean/rom_images @@ -0,0 +1,31 @@ +#!/usr/bin/env bash + +# helper script: delete the ROM images +# +# Copyright (C) 2014, 2015 Leah Rowe <info@minifree.org> +# 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 current working directory is the root +# of git or release archive + +[ "x${DEBUG+set}" = 'xset' ] && set -v +set -u -e + +# Delete the ROM images +rm -Rf "bin/" + +printf "Deleted the bin/ directory containing the ROM images.\n\n" diff --git a/i18n/fr_FR/resources/scripts/helpers/build/clean/seabios b/i18n/fr_FR/resources/scripts/helpers/build/clean/seabios new file mode 100755 index 00000000..168c7874 --- /dev/null +++ b/i18n/fr_FR/resources/scripts/helpers/build/clean/seabios @@ -0,0 +1,37 @@ +#!/usr/bin/env bash + +# helper script: clean the dependencies that were built in seabios +# +# Copyright (C) 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 current working directory is the root +# of libreboot_src or libreboot git + +[ "x${DEBUG+set}" = 'xset' ] && set -v +set -u -e + +# clean bucts +# -------------------------------------------------------- + +printf "Cleaning the previous build of seabios\n" + +( +cd "seabios/" +rm -f "out/bios.bin.vga.elf" +make distclean +) + diff --git a/i18n/fr_FR/resources/scripts/helpers/build/config/grubmodify b/i18n/fr_FR/resources/scripts/helpers/build/config/grubmodify new file mode 100755 index 00000000..606cc1ad --- /dev/null +++ b/i18n/fr_FR/resources/scripts/helpers/build/config/grubmodify @@ -0,0 +1,72 @@ +#!/usr/bin/env bash + +# +# helper script: run "make menuconfig" on config(s) to modify them +# +# 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 git + +[ "x${DEBUG+set}" = 'xset' ] && set -v +set -u -e + +payload="grub" +configpath="resources/libreboot/config/${payload}" + +hackconfig () { + board="${1}" + cbrevision="$(cat ${configpath}/${board}/cbrevision)" + vbootrevision="$(cat ${configpath}/${board}/vbootrevision)" +( + cd "coreboot/${cbrevision}/${cbrevision}/" + git checkout ${payload}_${board} + ( + cd "3rdparty/vboot/" + git checkout ${payload}_${board} + ) + + printf "Modifying config for %s (%s payload)\n" "${board}" "${payload}" + sleep 2 + + if [ ! -d "../../../${configpath}/${board}/" ]; then + printf "build/config/grubmodify WARNING: config '%s' does not exist. Skipping.\n" "${board}" + git checkout master + ( + cd "3rdparty/vboot/" + git checkout master + ) + return + fi + + mv "../../../${configpath}/${board}/config" ".config" + make menuconfig + mv ".config" "../../../${configpath}/${board}/config" + + git checkout master + ( + cd "3rdparty/vboot/" + git checkout master + ) +) +} + +if [ $# -lt 1 ]; then + for config in ${configpath}/*; do hackconfig "${config##*/}"; done +else + for config in "${@}"; do hackconfig "${config}"; done +fi diff --git a/i18n/fr_FR/resources/scripts/helpers/build/config/grubreplace b/i18n/fr_FR/resources/scripts/helpers/build/config/grubreplace new file mode 100755 index 00000000..b3a57ae3 --- /dev/null +++ b/i18n/fr_FR/resources/scripts/helpers/build/config/grubreplace @@ -0,0 +1,63 @@ +#!/usr/bin/env bash + +# +# helper script: run "make menuconfig" on config(s) to replace them +# +# 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 git + +[ "x${DEBUG+set}" = 'xset' ] && set -v +set -u -e + +payload="grub" +configpath="resources/libreboot/config/${payload}" + +hackconfig () { + board="${1}" + cbrevision="$(cat ${configpath}/${board}/cbrevision)" + vbootrevision="$(cat ${configpath}/${board}/vbootrevision)" +( + cd "coreboot/${cbrevision}/${cbrevision}/" + git checkout ${payload}_${board} + ( + cd "3rdparty/vboot/" + git checkout ${payload}_${board} + ) + + printf "Replacing or creating new config for %s (%s payload)\n" "${board}" "${payload}" + sleep 2 + + make menuconfig + + [ ! -d "../../../${configpath}/${board}/" ] && mkdir -p "../../../${configpath}/${board}/" + mv ".config" "../../../${configpath}/${board}/config" + + git checkout master + ( + cd "3rdparty/vboot/" + git checkout master + ) +) +} + +if [ $# -lt 1 ]; then + for config in ${configpath}/*; do hackconfig "${config##*/}"; done +else + for config in "${@}"; do hackconfig "${config}"; done +fi diff --git a/i18n/fr_FR/resources/scripts/helpers/build/config/grubupdate b/i18n/fr_FR/resources/scripts/helpers/build/config/grubupdate new file mode 100755 index 00000000..72269213 --- /dev/null +++ b/i18n/fr_FR/resources/scripts/helpers/build/config/grubupdate @@ -0,0 +1,72 @@ +#!/usr/bin/env bash + +# +# helper script: run "make oldconfig" on all coreboot config files +# +# 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 git + +[ "x${DEBUG+set}" = 'xset' ] && set -v +set -u -e + +payload="grub" +configpath="resources/libreboot/config/${payload}" + +hackconfig () { + board="${1}" + cbrevision="$(cat ${configpath}/${board}/cbrevision)" + vbootrevision="$(cat ${configpath}/${board}/vbootrevision)" +( + cd "coreboot/${cbrevision}/${cbrevision}/" + git checkout ${payload}_${board} + ( + cd "3rdparty/vboot/" + git checkout ${payload}_${board} + ) + + printf "Updating config for %s (%s payload)\n" "${board}" "${payload}" + sleep 2 + + if [ ! -d "../../../${configpath}/${board}/" ]; then + printf "build/config/grubupdate WARNING: config '%s' does not exist. Skipping.\n" "${board}" + git checkout master + ( + cd "3rdparty/vboot/" + git checkout master + ) + return + fi + + mv "../../../${configpath}/${board}/config" ".config" + make oldconfig + mv ".config" "../../../${configpath}/${board}/config" + + git checkout master + ( + cd "3rdparty/vboot/" + git checkout master + ) +) +} + +if [ $# -lt 1 ]; then + for config in ${configpath}/*; do hackconfig "${config##*/}"; done +else + for config in "${@}"; do hackconfig "${config}"; done +fi diff --git a/i18n/fr_FR/resources/scripts/helpers/build/config/seabiosmodify b/i18n/fr_FR/resources/scripts/helpers/build/config/seabiosmodify new file mode 100755 index 00000000..72d1cbc0 --- /dev/null +++ b/i18n/fr_FR/resources/scripts/helpers/build/config/seabiosmodify @@ -0,0 +1,45 @@ +#!/usr/bin/env bash + +# +# helper script: update the seabios config +# +# 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 git + +[ "x${DEBUG+set}" = 'xset' ] && set -v +set -u -e + +( +cd "seabios/" + +for cfgtype in config config_vga; do + + printf "doing config %s\n" "${cfgtype}" + sleep 2 + + if [ -f "../resources/seabios/config/${cfgtype}" ]; then + cp "../resources/seabios/config/${cfgtype}" ".config" + fi + + make menuconfig + + mv ".config" "../resources/seabios/config/${cfgtype}" + +done +) diff --git a/i18n/fr_FR/resources/scripts/helpers/build/config/seabiosrommodify b/i18n/fr_FR/resources/scripts/helpers/build/config/seabiosrommodify new file mode 100755 index 00000000..a25ae441 --- /dev/null +++ b/i18n/fr_FR/resources/scripts/helpers/build/config/seabiosrommodify @@ -0,0 +1,72 @@ +#!/usr/bin/env bash + +# +# helper script: run "make menuconfig" on config(s) to modify them +# +# 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 git + +[ "x${DEBUG+set}" = 'xset' ] && set -v +set -u -e + +payload="seabios" +configpath="resources/libreboot/config/${payload}" + +hackconfig () { + board="${1}" + cbrevision="$(cat ${configpath}/${board}/cbrevision)" + vbootrevision="$(cat ${configpath}/${board}/vbootrevision)" +( + cd "coreboot/${cbrevision}/${cbrevision}/" + git checkout ${payload}_${board} + ( + cd "3rdparty/vboot/" + git checkout ${payload}_${board} + ) + + printf "Modifying config for %s (%s payload)\n" "${board}" "${payload}" + sleep 2 + + if [ ! -d "../../../${configpath}/${board}/" ]; then + printf "build/config/seabiosmodify WARNING: config '%s' does not exist. Skipping.\n" "${board}" + git checkout master + ( + cd "3rdparty/vboot/" + git checkout master + ) + return + fi + + mv "../../../${configpath}/${board}/config" ".config" + make menuconfig + mv ".config" "../../../${configpath}/${board}/config" + + git checkout master + ( + cd "3rdparty/vboot/" + git checkout master + ) +) +} + +if [ $# -lt 1 ]; then + for config in ${configpath}/*; do hackconfig "${config##*/}"; done +else + for config in "${@}"; do hackconfig "${config}"; done +fi diff --git a/i18n/fr_FR/resources/scripts/helpers/build/config/seabiosromreplace b/i18n/fr_FR/resources/scripts/helpers/build/config/seabiosromreplace new file mode 100755 index 00000000..f172d193 --- /dev/null +++ b/i18n/fr_FR/resources/scripts/helpers/build/config/seabiosromreplace @@ -0,0 +1,63 @@ +#!/usr/bin/env bash + +# +# helper script: run "make menuconfig" on config(s) to replace them +# +# 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 git + +[ "x${DEBUG+set}" = 'xset' ] && set -v +set -u -e + +payload="seabios" +configpath="resources/libreboot/config/${payload}" + +hackconfig () { + board="${1}" + cbrevision="$(cat ${configpath}/${board}/cbrevision)" + vbootrevision="$(cat ${configpath}/${board}/vbootrevision)" +( + cd "coreboot/${cbrevision}/${cbrevision}/" + git checkout ${payload}_${board} + ( + cd "3rdparty/vboot/" + git checkout ${payload}_${board} + ) + + printf "Replacing or creating new config for %s (%s payload)\n" "${board}" "${payload}" + sleep 2 + + make menuconfig + + [ ! -d "../../../${configpath}/${board}/" ] && mkdir -p "../../../${configpath}/${board}/" + mv ".config" "../../../${configpath}/${board}/config" + + git checkout master + ( + cd "3rdparty/vboot/" + git checkout master + ) +) +} + +if [ $# -lt 1 ]; then + for config in ${configpath}/*; do hackconfig "${config##*/}"; done +else + for config in "${@}"; do hackconfig "${config}"; done +fi diff --git a/i18n/fr_FR/resources/scripts/helpers/build/config/seabiosromupdate b/i18n/fr_FR/resources/scripts/helpers/build/config/seabiosromupdate new file mode 100755 index 00000000..8e9f29af --- /dev/null +++ b/i18n/fr_FR/resources/scripts/helpers/build/config/seabiosromupdate @@ -0,0 +1,72 @@ +#!/usr/bin/env bash + +# +# helper script: run "make oldconfig" on all coreboot config files +# +# 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 git + +[ "x${DEBUG+set}" = 'xset' ] && set -v +set -u -e + +payload="seabios" +configpath="resources/libreboot/config/${payload}" + +hackconfig () { + board="${1}" + cbrevision="$(cat ${configpath}/${board}/cbrevision)" + vbootrevision="$(cat ${configpath}/${board}/vbootrevision)" +( + cd "coreboot/${cbrevision}/${cbrevision}/" + git checkout ${payload}_${board} + ( + cd "3rdparty/vboot/" + git checkout ${payload}_${board} + ) + + printf "Updating config for %s (%s payload)\n" "${board}" "${payload}" + sleep 2 + + if [ ! -d "../../../${configpath}/${board}/" ]; then + printf "build/config/seabiosupdate WARNING: config '%s' does not exist. Skipping.\n" "${board}" + git checkout master + ( + cd "3rdparty/vboot/" + git checkout master + ) + return + fi + + mv "../../../${configpath}/${board}/config" ".config" + make oldconfig + mv ".config" "../../../${configpath}/${board}/config" + + git checkout master + ( + cd "3rdparty/vboot/" + git checkout master + ) +) +} + +if [ $# -lt 1 ]; then + for config in ${configpath}/*; do hackconfig "${config##*/}"; done +else + for config in "${@}"; do hackconfig "${config}"; done +fi diff --git a/i18n/fr_FR/resources/scripts/helpers/build/config/seabiosupdate b/i18n/fr_FR/resources/scripts/helpers/build/config/seabiosupdate new file mode 100755 index 00000000..be25b55c --- /dev/null +++ b/i18n/fr_FR/resources/scripts/helpers/build/config/seabiosupdate @@ -0,0 +1,43 @@ +#!/usr/bin/env bash + +# +# helper script: update the seabios config +# +# 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 git + +[ "x${DEBUG+set}" = 'xset' ] && set -v +set -u -e + +( +cd seabios/ + +for cfgtype in config config_vga; do + + printf "doing config %s\n" "${cfgtype}" + sleep 2 + + if [ -f ../resources/seabios/config/${cfgtype} ]; then + cp ../resources/seabios/config/${cfgtype} .config + make oldconfig + mv .config ../resources/seabios/config/${cfgtype} + fi + +done +) diff --git a/i18n/fr_FR/resources/scripts/helpers/build/dependencies/parabola b/i18n/fr_FR/resources/scripts/helpers/build/dependencies/parabola new file mode 100755 index 00000000..86f1f341 --- /dev/null +++ b/i18n/fr_FR/resources/scripts/helpers/build/dependencies/parabola @@ -0,0 +1,110 @@ +#!/usr/bin/env bash + +# helper script: installs build dependencies for Parabola + +# this script is based on the script for Trisquel 7 +# +# Copyright (C) 2014, 2015 Leah Rowe <info@minifree.org> +# Copyright (C) 2015 Klemens Nanni <klemens@posteo.de> +# +# 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/>. +# + +[ "x${DEBUG+set}" = 'xset' ] && set -v +set -u -e + +if [ $EUID -ne 0 ]; then + printf "This script must be run as root\n" + exit 1 +fi + +# Duplications are intentional. Please do not re-factor. +# +# This is so that they can moved to separate scripts. +# + +pacman -S --needed wget + +# For downloading source code +# ------------------------------------------------------------ + +printf "Source Code: In order to download the it, git is needed\n" +pacman -S --needed git + +# For building the documentation +# ------------------------------------------------------------ + +pacman -S --needed pandoc texi2html + +# For building source code: +# ------------------------------------------------------------ + +printf "Building Source Code: development packages\n" +pacman -S --needed base-devel libstdc++5 + +pacman -S arm-none-eabi-gcc + +pacman -S --needed libpciaccess + +[ "$(uname -i)" = x86_64 ] || [ "$(uname -m)" = x86_64 ] +arch=${?} + +# For cross-compiling i686 target on x86_64 host. +if [ "${arch}" -eq 0 ]; then + printf "Cross-Compiling: You are running on 64-bit architecture, however 32-bit libraries are needed\n" + pacman -Sl multilib &>/dev/null || (printf "You must enable the multilib repository in /etc/pacman.conf first\n"; exit 1) + pacman -S --needed gcc-multilib gcc-libs-multilib lib32-libltdl lib32-libpciaccess lib32-libstdc++5 lib32-glibc lib32-fakeroot +fi + +# Memtest86+ build dependencies +# ------------------------------------------------------------ + +# pacman -S --needed base-devel + +# i945-pwm build dependencies +# ------------------------------------------------------------ + +# pacman -S base-devel + +# Coreboot build dependencies (also requires build-essential and git) +# ------------------------------------------------------------ + +printf "Coreboot: Ncurses for menuconfig and a few other tools\n" +pacman -S ncurses doxygen iasl gdb flex bison +# pacman -S git base-devel + +# For cross-compiling i686 target on x86_64 host. +if [ "${arch}" -eq 0 ]; then + printf "Cross-Compiling: You are running on 64-bit architecture, however 32-bit libraries are needed\n" + pacman -S --needed lib32-ncurses +fi + +# GRUB2 build dependencies (also requires build-essential, bison and flex) +# pacman -S --needed base-devel bison flex + +printf "GRUB: Fonts, (crypto) filesystem support, automake, etc.\n" +pacman -S --needed autogen m4 autoconf help2man freetype2 automake fuse fuse-exfat xz gawk device-mapper libtool python +pacman -S --needed bdf-unifont # trying this, otherwise there was an error. I'll try AUR if this won't work. + +# BucTS build dependencies (external script) +# ------------------------------------------------------------ + +# pacman -S --needed base-devel + +# Flashrom build dependencies (also requires build-essential) +# ------------------------------------------------------------ + +printf "Flashrom: Your external programmer will be most probably using PCI bus, FTDI chips need additional libraries\n" +pacman -S --needed pciutils zlib libftdi libftdi-compat +# pacman -S --needed base-devel diff --git a/i18n/fr_FR/resources/scripts/helpers/build/dependencies/trisquel7 b/i18n/fr_FR/resources/scripts/helpers/build/dependencies/trisquel7 new file mode 100755 index 00000000..10142758 --- /dev/null +++ b/i18n/fr_FR/resources/scripts/helpers/build/dependencies/trisquel7 @@ -0,0 +1,99 @@ +#!/usr/bin/env bash + +# for_trisquel7 script: installs build dependencies for Trisquel 7 +# +# 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/>. +# + +[ "x${DEBUG+set}" = 'xset' ] && set -v +set -u -e + +if [ $EUID -ne 0 ]; then + printf "This script must be run as root\n" + exit 1 +fi + +# Duplications are intentional. Please do not re-factor. +# +# This is so that they can moved to separate scripts. +# + +apt-get -y install wget + +# For downloading source code +# ------------------------------------------------------------ + +apt-get -y install git + +# For building the documentation +# ------------------------------------------------------------ + +apt-get -y install pandoc texi2html texinfo texlive + +# For building source code: +# ------------------------------------------------------------ + +apt-get -y install build-essential + +# for cross-compiling ARM binaries +apt-get -y install gcc-arm-linux-gnueabi || printf "debian stretch ftw\n" + +[ "$(uname -i)" = x86_64 ] || [ "$(uname -m)" = x86_64 ] +arch=${?} + +# For cross-compiling i686 target on x86_64 host. +if [ "${arch}" -eq 0 ]; then + apt-get -y install gcc-multilib libc6-i386 libc6-dev-i386 + apt-get -y install lib32stdc++6 g++-multilib dh-autoreconf + # recommended, but not sure what for: + apt-get -y install lib32tinfo-dev texi2html +fi + +# Memtest86+ build dependencies +# ------------------------------------------------------------ + +apt-get -y install build-essential + +# i945-pwm build dependencies +# ------------------------------------------------------------ + +apt-get -y install build-essential + +# Coreboot build dependencies (also requires build-essential and git) +# ------------------------------------------------------------ + +apt-get -y install libncurses5-dev doxygen iasl gdb flex bison build-essential git libssl-dev + +# For cross-compiling i686 target on x86_64 host. +[ "${arch}" -eq 0 ] && apt-get -y install lib32ncurses5-dev + +# GRUB build dependencies (also requires build-essential, bison and flex) +# ------------------------------------------------------------ + +apt-get -y install ttf-unifont libopts25 libselinux1-dev autogen m4 autoconf help2man libopts25-dev libfont-freetype-perl automake autotools-dev build-essential bison flex libfuse-dev liblzma-dev gawk libdevmapper-dev libtool libfreetype6-dev + +# BucTS build dependencies (external script) +# ------------------------------------------------------------ + +apt-get -y install build-essential + +# Flashrom build dependencies (also requires build-essential) +# ------------------------------------------------------------ + +apt-get -y install libpci-dev pciutils zlib1g-dev libftdi-dev build-essential libusb-1.0-0-dev libusb-1.0 + +# For cross-compiling i686 target on x86_64 host. +[ "${arch}" -eq 0 ] && apt-get -y install lib32z1-dev diff --git a/i18n/fr_FR/resources/scripts/helpers/build/module/bucts b/i18n/fr_FR/resources/scripts/helpers/build/module/bucts new file mode 100755 index 00000000..108a6eca --- /dev/null +++ b/i18n/fr_FR/resources/scripts/helpers/build/module/bucts @@ -0,0 +1,67 @@ +#!/usr/bin/env bash + +# helper script: builds bucts source code +# +# Copyright (C) 2014, 2015 Leah Rowe <info@minifree.org> +# 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 git + +[ "x${DEBUG+set}" = 'xset' ] && set -v +set -u -e +if [ -z ${NPROC+x} ]; then + cores="$(nproc)" +else + case ${NPROC} in + ''|*[!0-9]*) + printf "value '%s' for NPROC is invalid. non-numeric. Exiting.\n" "${NPROC}" + exit 1 + ;; + esac + cores="${NPROC}" +fi + +# Build BUC.TS utility (needed for flashing ROM images on X60/T60 while Lenovo BIOS is running) +# -------------------------------------------------------------------- + +printf "Building bucts\n" + +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 -j${cores} + +if [ "${buildtype}" = "static" ]; then + patch "Makefile" -R < "../resources/bucts/patch/staticlink.diff" +fi + +# done. go back to main directory +cd "../" + +printf "\n\n" diff --git a/i18n/fr_FR/resources/scripts/helpers/build/module/coreboot b/i18n/fr_FR/resources/scripts/helpers/build/module/coreboot new file mode 100755 index 00000000..e87642df --- /dev/null +++ b/i18n/fr_FR/resources/scripts/helpers/build/module/coreboot @@ -0,0 +1,207 @@ +#!/usr/bin/env bash + +# helper script: builds the dependencies that coreboot needs before building a ROM image +# +# Copyright (C) 2014, 2015, 2016 Leah Rowe <info@minifree.org> +# 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 git or release archive + +[ "x${DEBUG+set}" = 'xset' ] && set -v +set -u -e +HOMEDIR=$(pwd) + +# Build utilities needed in coreboot directory +# -------------------------------------------------------------------- + +printf "Building the utilities in coreboot\n" + +# build coreboot utilities (in each revision) and +# create symlinks to the crossgcc archive +for payload in $HOMEDIR/coreboot/*; do + for board in "${payload}/"*; do + + # cbfstool, cbmem, nvramtool + for util in {cbfs,nvram}tool cbmem; do + if [ "${util}" = "cbfstool" ]; then + sed -i '/.*fmd_scanner.o.*-Wno-unused-function$/ s/$/ -Wno-sign-compare/' "${board}"/util/cbfstool/Makefile.inc + fi + make -BC "${board}/util/${util}" + done + # create symlink to crossgcc + ( + + ln -fs $HOMEDIR/crossgcc/util/crossgcc/ ${board}/util/crossgcc + ) + + done +done + +for payloads in $HOMEDIR/resources/libreboot/config/*; do + + if [ ! -d "${payloads}/" ]; then + continue + fi + + payload="${payloads##*/}" + + for boardconfig in $HOMEDIR/resources/libreboot/config/${payload}/*; do + + if [ ! -d "${boardconfig}/" ]; then + continue + fi + + boardname="${boardconfig##*/}" + cbrevision=$(cat "${boardconfig}/cbrevision") + vbootrevision=$(cat "${boardconfig}/vbootrevision") + + reused_coreboot_patches="$HOMEDIR/resources/libreboot/patch/coreboot/${cbrevision}/${payload}/${boardname}/reused.list" + reused_vboot_patches="$HOMEDIR/resources/libreboot/patch/vboot/${vbootrevision}/${payload}/${boardname}/reused.list" + for reused_patches in "${reused_coreboot_patches}" "${reused_vboot_patches}"; do + if [ -f "${reused_patches}" ]; then + for patch in $(cat "${reused_patches}"); do + if [ ! -f "./${patch}" ]; then + printf "%s listed in %s does not exist\n" "${patch}" "${reused_patches}" + exit 1 + fi + done + fi + done + + done +done + +# sanity check (check for invalid paths in the reused.list patch lists before proceeding) +# in ascending filename order, apply patches from a directory +apply_patches_from_directory() { + patch_directory="${1}" # directory containing the patch files + + if [ -d "${patch_directory}" ]; then + for patch in ${patch_directory}/*.patch; do + + if [ "${patch##*/}" = "*.patch" ]; then # oh so ugly + continue # ugly ugly ugly ugly ugly + fi # most hideous thing you've ever seen + + git am "${patch}" || continue + done + fi +} +# files listed in the file (if found) are absolute paths, relative to the root of the libreboot src directory +# the file lists patches patches that should be applied +apply_patches_from_file() { + patch_list="${1}" # file listing the paths to all the patches + libreboot_src_root="${2}" # path to the root of the libreboot_src directory + + if [ -f "${patch_list}" ]; then + for patchname in $(cat "${patch_list}"); do + git am "${libreboot_src_root}/${patchname}" || continue + done + fi +} + +create_branch() { + branchname="${1}" + git branch ${branchname} + git checkout ${branchname} + git checkout master +} + +# use git-init on everything +# this is so that we can then apply patche +# for these revisions of vboot and coreboot +for i in $HOMEDIR/coreboot/*; do + if [ ! -d "${i}/" ]; then + continue + fi + for revision in ${i}/*; do + if [ ! -d "${revision}/" ]; then + continue + fi + ( + cd "${revision}/" + rm -rf .git + git init + git add -A . + git commit -m "coreboot revision ${revision##*/}" + cd "3rdparty/vboot/" + rm -rf .git + git init + git add -A . + git commit -m "coreboot revision ${revision##*/}" + ) + done +done + +for payloads in $HOMEDIR/resources/libreboot/config/*; do + + if [ ! -d "${payloads}/" ]; then + continue + fi + + payload="${payloads##*/}" + + for boardconfig in $HOMEDIR/resources/libreboot/config/${payload}/*; do + + if [ ! -d "${boardconfig}/" ]; then + continue + fi + + boardname="${boardconfig##*/}" + cbrevision=$(cat "${boardconfig}/cbrevision") + vbootrevision=$(cat "${boardconfig}/vbootrevision") + branchname="${payload}_${boardname}" + + # the same vboot revision is always used for coreboot revision, + # so we don't need to wworry about checking for that here + + # patch that version + ( + + cd "$HOMEDIR/coreboot/${cbrevision}/${cbrevision}/" + create_branch ${branchname} + + git checkout ${branchname} + + # apply patches (coreboot, common to all systems using this revision) + apply_patches_from_directory "$HOMEDIR/resources/libreboot/patch/common/coreboot/${cbrevision}" + # apply patches re-used from other boards, before applying main patches (common patches for similar boards) + apply_patches_from_file "$HOMEDIR/resources/libreboot/patch/coreboot/${cbrevision}/${payload}/${boardname}/reused.list" ../../.. + # apply patches (coreboot, machine-specific for this revision) + apply_patches_from_directory "$HOMEDIR/resources/libreboot/patch/coreboot/${cbrevision}/${payload}/${boardname}" + + git checkout master + + cd "3rdparty/vboot/" + # reset to known revision (vboot) + create_branch ${branchname} + + git checkout ${branchname} + + # apply patches (vboot, common to all systems using this revision) + apply_patches_from_directory "$HOMEDIR/resources/libreboot/patch/common/vboot/${vbootrevision}" + # apply patches re-used from other boards, before applying main patches (common patches for similar boards) + apply_patches_from_file "$HOMEDIR/resources/libreboot/patch/vboot/${vbootrevision}/${payload}/${boardname}/reused.list" ../../../../.. + # apply patches (vboot, machine-specific for this revision) + apply_patches_from_directory "$HOMEDIR/resources/libreboot/patch/vboot/${vbootrevision}/${payload}/${boardname}" + + git checkout master + + ) + done +done diff --git a/i18n/fr_FR/resources/scripts/helpers/build/module/crossgcc b/i18n/fr_FR/resources/scripts/helpers/build/module/crossgcc new file mode 100755 index 00000000..0631758b --- /dev/null +++ b/i18n/fr_FR/resources/scripts/helpers/build/module/crossgcc @@ -0,0 +1,45 @@ +#!/usr/bin/env bash + +# helper script: builds crossgcc, needed by coreboot's build system +# +# 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 git or release archive + +[ "x${DEBUG+set}" = 'xset' ] && set -v +set -u -e + +if [ -z ${NPROC+x} ]; then + cores="$(nproc)" +else + case ${NPROC} in + ''|*[!0-9]*) + printf "value '%s' for NPROC is invalid. non-numeric. Exiting.\n" "${NPROC}" + exit 1 + ;; + esac + cores="${NPROC}" +fi + +( +cd "crossgcc/" +for architecture in i386 arm; do + make crossgcc-${architecture} CPUS=${cores} +done +) + diff --git a/i18n/fr_FR/resources/scripts/helpers/build/module/flashrom b/i18n/fr_FR/resources/scripts/helpers/build/module/flashrom new file mode 100755 index 00000000..4e887a8d --- /dev/null +++ b/i18n/fr_FR/resources/scripts/helpers/build/module/flashrom @@ -0,0 +1,93 @@ +#!/usr/bin/env bash + +# helper script: builds flashrom source code +# +# Copyright (C) 2014, 2015 Leah Rowe <info@minifree.org> +# 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 git or release archive + +[ "x${DEBUG+set}" = 'xset' ] && set -v +set -u -e +if [ -z ${NPROC+x} ]; then + cores="$(nproc)" +else + case ${NPROC} in + ''|*[!0-9]*) + printf "value '%s' for NPROC is invalid. non-numeric. Exiting.\n" "${NPROC}" + exit 1 + ;; + esac + cores="${NPROC}" +fi + +# Build "flashrom" (utility for flashing/dumping ROMs) +# -------------------------------------------------------------------- + +printf "Building flashrom\n" + +cd "flashrom/" + +make clean +if (( $# != 1 )); then + make -j${cores} +else + if [ "${1}" = "static" ]; then + make SHARED=0 CC='gcc -static' -j${cores} CONFIG_ENABLE_LIBUSB1_PROGRAMMERS=no + else + make -j${cores} CONFIG_ENABLE_LIBUSB1_PROGRAMMERS=no + 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 -j${cores} CONFIG_ENABLE_LIBUSB1_PROGRAMMERS=no + else + if [ "${1}" = "static" ]; then + make SHARED=0 CC='gcc -static' -j${cores} CONFIG_ENABLE_LIBUSB1_PROGRAMMERS=no + else + make -j${cores} CONFIG_ENABLE_LIBUSB1_PROGRAMMERS=no + 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 "../" diff --git a/i18n/fr_FR/resources/scripts/helpers/build/module/grub b/i18n/fr_FR/resources/scripts/helpers/build/module/grub new file mode 100755 index 00000000..e036b148 --- /dev/null +++ b/i18n/fr_FR/resources/scripts/helpers/build/module/grub @@ -0,0 +1,57 @@ +#!/usr/bin/env bash + +# helper script: builds GRUB2 source code +# +# Copyright (C) 2014, 2015 Leah Rowe <info@minifree.org> +# Copyright (C) 2015, 2016 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 git or release archive + +[ "x${DEBUG+set}" = 'xset' ] && set -v +set -u -e +if [ -z ${NPROC+x} ]; then + cores="$(nproc)" +else + case ${NPROC} in + ''|*[!0-9]*) + printf "value '%s' for NPROC is invalid. non-numeric. Exiting.\n" "${NPROC}" + exit 1 + ;; + esac + cores="${NPROC}" +fi + +# Build GRUB2 as coreboot payload + +printf "Building GRUB\n" + +# use a subshell to not end up in grub/ in case of build issues +( +cd grub/ + +# clean up first +[ -d Makefile ] && make distclean + +# build +./autogen.sh +./configure --with-platform=coreboot +make -j${cores} +) + +# Also build SeaBIOS, which we use with GRUB to make SeaGRUB +./oldbuild module seabios diff --git a/i18n/fr_FR/resources/scripts/helpers/build/module/i945pwm b/i18n/fr_FR/resources/scripts/helpers/build/module/i945pwm new file mode 100755 index 00000000..55e6f8e0 --- /dev/null +++ b/i18n/fr_FR/resources/scripts/helpers/build/module/i945pwm @@ -0,0 +1,42 @@ +#!/usr/bin/env bash + +# helper script: builds i945-pwm source code +# +# Copyright (C) 2014, 2015 Leah Rowe <info@minifree.org> +# 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 git + +[ "x${DEBUG+set}" = 'xset' ] && set -v +set -u -e + +# Build i945-pwm utility +# -------------------------------------------------------------------- + +printf "Building i945-pwm\n" + +cd "resources/utilities/i945-pwm/" + +make clean +# build it +make + +# done. go back to main directory +cd "../../../" + +printf "\n\n" diff --git a/i18n/fr_FR/resources/scripts/helpers/build/module/ich9deblob b/i18n/fr_FR/resources/scripts/helpers/build/module/ich9deblob new file mode 100755 index 00000000..963d7a0d --- /dev/null +++ b/i18n/fr_FR/resources/scripts/helpers/build/module/ich9deblob @@ -0,0 +1,44 @@ +#!/usr/bin/env bash + +# helper script: builds ich9deblob source code +# +# Copyright (C) 2014, 2015 Leah Rowe <info@minifree.org> +# 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 git + +[ "x${DEBUG+set}" = 'xset' ] && set -v +set -u -e + +# Build ich9deblob utility +# -------------------------------------------------------------------- + +printf "Building ich9deblob\n" + +cd "resources/utilities/ich9deblob/" + +# clean it first +make clean + +# build ich9deblob +make + +# done. go back to main directory +cd "../../../" + +printf "\n\n" diff --git a/i18n/fr_FR/resources/scripts/helpers/build/module/memtest86plus b/i18n/fr_FR/resources/scripts/helpers/build/module/memtest86plus new file mode 100755 index 00000000..08c36c50 --- /dev/null +++ b/i18n/fr_FR/resources/scripts/helpers/build/module/memtest86plus @@ -0,0 +1,33 @@ +#!/usr/bin/env bash + +# helper script: builds memtest86+ source code +# +# Copyright (C) 2014, 2015 Leah Rowe <info@minifree.org> +# 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 git or release archive + +[ "x${DEBUG+set}" = 'xset' ] && set -v +set -u -e + +# Build MemTest86+ payload +# -------------------------------------------------------------------- + +printf "Building MemTest86+\n" + +make -BC memtest86plus diff --git a/i18n/fr_FR/resources/scripts/helpers/build/module/seabios b/i18n/fr_FR/resources/scripts/helpers/build/module/seabios new file mode 100755 index 00000000..46c1594c --- /dev/null +++ b/i18n/fr_FR/resources/scripts/helpers/build/module/seabios @@ -0,0 +1,61 @@ +#!/usr/bin/env bash + +# helper script: builds SeaBIOS source code +# +# Copyright (C) 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 git + +[ "x${DEBUG+set}" = 'xset' ] && set -v +set -u -e + +# Build SeaBIOS +# --------------------------------------------------------------------- + +printf "Building SeaBIOS\n" + +cd seabios/ + +cp ../resources/seabios/config/config .config + +# clean it first +[[ -f Makefile ]] && make clean + +# build SeaBIOS +make + +mv "out/bios.bin.elf" ../ + +printf "\n\n" + +rm -f .config + +make distclean + +cp ../resources/seabios/config/config_vga .config + +make +rm -f .config + +mv out/bios.bin.elf out/bios.bin.vga.elf +mv ../bios.bin.elf out/ + +# done. go back to main directory +cd ../ + +# ------------------- DONE ---------------------- diff --git a/i18n/fr_FR/resources/scripts/helpers/build/release/roms b/i18n/fr_FR/resources/scripts/helpers/build/release/roms new file mode 100755 index 00000000..b3cd4977 --- /dev/null +++ b/i18n/fr_FR/resources/scripts/helpers/build/release/roms @@ -0,0 +1,105 @@ +#!/usr/bin/env bash + +# +# helper script: generate the ROM image release archives +# +# Copyright (C) 2015 Leah Rowe <info@minifree.org> +# Copyright (C) 2015 Patrick "P. J." McDermott <pj@pehjota.net> +# +# 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/>. +# + +[ "x${DEBUG+set}" = 'xset' ] && set -v +set -u -e + +if [ ! -d bin/ ]; then + printf "build/release/roms: no bin/ directory exists. (you haven't built any images)\n" + exit 1 +fi + +if [ -f "version" ]; then + # _src release archive is being used + version="$(cat version)" + versiondate="$(cat versiondate)" +else + # git repo is being used + version="$(git describe --tags HEAD)" + versiondate="$(git show -s --format=%ct)" +fi +versiondir="release/oldbuildsystem/${version}" +romdir="${versiondir}/rom" +distname="libreboot_${version}" + +printf 'Building ROM image release archives for...\n' + +cd "bin/" + +for payload in *; do + + [ ! -d "../${romdir}/${payload}/" ] && mkdir -p "../${romdir}/${payload}/" + + cd "${payload}/" + + for board in *; do + + archivename="${distname}_${payload}_${board}" + + printf '...%s' "${payload}/${board}" + + # Delete the old archive + rm -f "../../${romdir}/${payload}/${distname}_${board}.tar.xz" + + cp -R "${board}/" "${archivename}/" + + # this has to be done before generating + # the "version" file + if [ ! -f "version" ]; then + # generate ChangeLog and NEWS files + rm -f "ChangeLog" "NEWS" + git log > "${archivename}/ChangeLog" + cp "${archivename}/ChangeLog" "${archivename}/NEWS" + else + # building from release archive + cp "ChangeLog" "${archivename}/" + cp "NEWS" "${archivename}/" + fi + + if [ -f "../../RELEASE" ]; then + rm -f "${archivename}/ChangeLog" + rm -f "${archivename}/NEWS" + cp "../../RELEASE" "${archivename}/ChangeLog" + cp "../../RELEASE" "${archivename}/NEWS" + fi + + # Put the version string in the archive. + printf '%s\n' "${version}" >"${archivename}/version" + # Put the version date string in the archive + printf '%s\n' "${versiondate}" >"${archivename}/versiondate" + + # Create the compressed archive. + tar -c "${archivename}/" | xz -9e >"../../${romdir}/${payload}/${archivename}.tar.xz" + + rm -Rf "${archivename:?}/" + + printf ' OK\n' + + done + + cd "../" + +done + +cd "../" + +printf 'ROM image release archives are stored in %s/\n' "${romdir}" diff --git a/i18n/fr_FR/resources/scripts/helpers/build/release/sha512sums b/i18n/fr_FR/resources/scripts/helpers/build/release/sha512sums new file mode 100755 index 00000000..78e9eec1 --- /dev/null +++ b/i18n/fr_FR/resources/scripts/helpers/build/release/sha512sums @@ -0,0 +1,53 @@ +#!/usr/bin/env bash + +# +# helper script: create sha512sum file for the current snapshot +# +# Copyright (C) 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/>. +# + +[ "x${DEBUG+set}" = 'xset' ] && set -v +set -u -e + +if [ -f "version" ]; then + # _src release archive is being used + version="$(cat version)" + versiondate="$(cat versiondate)" +else + # git repo is being used + version="$(git describe --tags HEAD)" + versiondate="$(git show -s --format=%ct)" +fi +versiondir="release/oldbuildsystem/${version}" +sha512filename="SHA512SUMS" +sha512filepath="${versiondir}/${sha512filename}" + +if [ ! -d "${versiondir}/" ]; then + + printf "build/release/sha512sums: directory %s/ does not exist. You haven't generated any archives yet.\n" "${versiondir}" + exit 1 + +fi + +# delete the old file +rm -f "${sha512filepath}" + +# create sha512sum file +printf "Creating list of SHA512 sums in %s...\n" "${sha512filepath}" +(cd "${versiondir}/" && for file in $(find -type f); do sha512sum "${file}" >> "${sha512filename}"; done) +printf "...done.\n" + +printf "\n" diff --git a/i18n/fr_FR/resources/scripts/helpers/build/release/src b/i18n/fr_FR/resources/scripts/helpers/build/release/src new file mode 100755 index 00000000..89cd1e2c --- /dev/null +++ b/i18n/fr_FR/resources/scripts/helpers/build/release/src @@ -0,0 +1,130 @@ +#!/usr/bin/env bash + +# +# helper script: generate the source release archive +# +# Copyright (C) 2014, 2015 Leah Rowe <info@minifree.org> +# Copyright (C) 2015 Patrick "P. J." McDermott <pj@pehjota.net> +# +# 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/>. +# + +[ "x${DEBUG+set}" = 'xset' ] && set -v +set -u -e + +printf 'Building the source release archive\n' + +if [ -f "version" ]; then + # _src release archive is being used + version="$(cat version)" + versiondate="$(cat versiondate)" +else + # git repo is being used + version="$(git describe --tags HEAD)" + versiondate="$(git show -s --format=%ct)" +fi +versiondir="release/oldbuildsystem/${version}" +distname="libreboot_${version}_src" +distdir="${versiondir}/${distname}" + +printf 'Deleting old source release archives\n' +rm -f "${distdir}.tar.xz" +rm -Rf "${distdir:?}/" + +mkdir -p "${distdir}/" + +printf 'Copying sources to %s/\n' "${distdir}" +for resource in *; do + if [ "${resource}" = "release" ]; then + continue + fi + cp -R "${resource}" "${distdir}/" +done + +# this has to be done before generating +# the "version" file +if [ ! -f "version" ]; then + # generate ChangeLog and NEWS files + rm -f "ChangeLog" "NEWS" + git log > "${distdir}/ChangeLog" + cp "${distdir}/ChangeLog" "${distdir}/NEWS" +else + # building from release archive + cp "ChangeLog" "${distdir}/" + cp "NEWS" "${distdir}/" +fi + +if [ -f "RELEASE" ]; then + rm -f "${distdir}/ChangeLog" + rm -f "${distdir}/NEWS" + cp "RELEASE" "${distdir}/ChangeLog" + cp "RELEASE" "${distdir}/NEWS" +fi + +# include version information +printf '%s\n' "${version}" >"${distdir}/version" +# include version date information +printf '%s\n' "${versiondate}" >"${distdir}/versiondate" + +printf 'Cleaning files in %s/\n' "${distdir}" + +# Clean old builds. +(cd "${distdir}/" && ./oldbuild clean all) +printf '\n' + +# Delete Git repositories and properties and Subversion administrative +# directories and properties. +rm -Rf "${distdir}/bucts/".git* +rm -Rf "${distdir}/flashrom/".git* +rm -Rf "${distdir}/grub/".git* +rm -Rf "${distdir}/seabios/".git* + +rm -f "${distdir}"/*.vim + +# Delete useless files. +rm -Rf "${distdir}/TODO/" +rm -f "${distdir}/push" + +# Delete the deblob scripts. +# Since the source archive doesn't distribute the download scripts and already +# comes with a deblobbed coreboot, the deblobbing scripts aren't needed at all. +rm -Rf "${distdir}/resources/utilities/coreboot-libre/" + +# Download scripts not needed, because the modules already exist +# in the src release archive +rm -f "${distdir}/download" +rm -Rf "${distdir}/resources/scripts/helpers/download/" + +rm -Rf "${distdir}/resources/grub/patch/" +rm -Rf "${distdir}/resources/memtest86plus/patch/" + +# ich9deblob: There are certain files in there that the user most likely does +# not want to share. +rm -f "${distdir}/resources/utilities/ich9deblob/"*.bin +rm -f "${distdir}/resources/utilities/ich9deblob/"*.rom +rm -f "${distdir}/resources/utilities/ich9deblob/mk"*.[ch] +rm -f "${distdir}/mk"*.[ch] +rm -f "${distdir}/"*.bin +rm -f "${distdir}/"*.rom + +# Remove any GRUB payload ELF executables that may exist +rm -f "${distdir}/resources/utilities/grub-assemble/grub_txtmode.elf" +rm -f "${distdir}/resources/utilities/grub-assemble/grub_vesafb.elf" + +printf 'Creating %s.tar.xz\n' "${distdir}" +(cd "${versiondir}/" && tar -c "${distname}/" | xz -9e >"${distname}.tar.xz") + +rm -Rf "${distdir:?}/" + +printf 'Source release archive is stored in %s/\n' "${versiondir}" diff --git a/i18n/fr_FR/resources/scripts/helpers/build/release/tobuild b/i18n/fr_FR/resources/scripts/helpers/build/release/tobuild new file mode 100755 index 00000000..459ab6fe --- /dev/null +++ b/i18n/fr_FR/resources/scripts/helpers/build/release/tobuild @@ -0,0 +1,109 @@ +#!/usr/bin/env bash + +# helper: prepare a small source archive for those utils +# that don't easily cross-compile. Then the tarball can be extracted +# on those systems with the target architecture, and compiled. +# +# 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/>. +# + +[ "x${DEBUG+set}" = 'xset' ] && set -v +set -u -e + +if [ -f "version" ]; then + # _src release archive is being used + version="$(cat version)" + versiondate="$(cat versiondate)" +else + # git repo is being used + version="$(git describe --tags HEAD)" + versiondate="$(git show -s --format=%ct)" +fi +versiondir="release/oldbuildsystem/${version}" +distname="libreboot_${version}_tobuild" +distdir="${versiondir}/${distname}" + +printf "Creating source archive for flashrom and bucts\n" + +# delete the old data +rm -Rf "${distdir:?}/" +rm -f "${distdir}.tar.xz" + +# this is where they will go +mkdir -p "${distdir}/" + +# flashrom +cp -R "flashrom/" "${distdir}/" +rm -f "${distdir}/flashrom/flashrom_lenovobios_sst" +rm -f "${distdir}/flashrom/flashrom_lenovobios_macronix" +(cd "${distdir}/flashrom/" && make clean) +mkdir -p "${distdir}/resources/flashrom/" +cp -R "resources/flashrom/patch/" "${distdir}/resources/flashrom/" + +# bucts +cp -R "bucts/" "${distdir}/" +(cd "${distdir}/bucts/" && make clean) +mkdir -p "${distdir}/resources/bucts/" +cp -R "resources/bucts/patch/" "${distdir}/resources/bucts/" + +# the build script will be needed +cp build "${distdir}/" +# needed build scripts (helpers) +mkdir -p "${distdir}/resources/scripts/helpers/build/" +mkdir -p "${distdir}/resources/scripts/helpers/build/module/" +mkdir -p "${distdir}/resources/scripts/helpers/build/clean/" +cp "resources/scripts/helpers/build/clean/bucts" "${distdir}/resources/scripts/helpers/build/clean/" +cp "resources/scripts/helpers/build/clean/flashrom" "${distdir}/resources/scripts/helpers/build/clean/" +cp "resources/scripts/helpers/build/module/bucts" "${distdir}/resources/scripts/helpers/build/module/" +cp "resources/scripts/helpers/build/module/flashrom" "${distdir}/resources/scripts/helpers/build/module/" +cp "resources/scripts/misc/powertop.trisquel7" "${distdir}/" + +# this has to be done before generating +# the "version" file +if [ ! -f "version" ]; then + # generate ChangeLog and NEWS files + rm -f "ChangeLog" "NEWS" + git log > "${distdir}/ChangeLog" + cp "${distdir}/ChangeLog" "${distdir}/NEWS" +else + # building from release archive + cp "ChangeLog" "${distdir}/" + cp "NEWS" "${distdir}/" +fi + +if [ -f "RELEASE" ]; then + rm -f "${distdir}/ChangeLog" + rm -f "${distdir}/NEWS" + cp "RELEASE" "${distdir}/ChangeLog" + cp "RELEASE" "${distdir}/NEWS" +fi + +# include version information +printf '%s\n' "${version}" >"${distdir}/version" +# include version date information +printf '%s\n' "${versiondate}" >"${distdir}/versiondate" + +# that is all. now tar it up +(cd "${versiondir}/" && tar -c "${distname}/" | xz -9e >"${distname}.tar.xz") + +# and delete the directory +rm -Rf "${distdir:?}/" + +printf "\n" +printf "Tar archive created: %s\n" "${distdir}.tar.xz" +printf "NOTE: don't forget to add ARM binaries for flashrom.\n" +printf "NOTE: don't forget to add i386 binaries for flashrom/bucts.\n" +printf "The archive %s.tar.xz has been created with everything needed to build these utilities.\n\n" "${distname}" diff --git a/i18n/fr_FR/resources/scripts/helpers/build/release/util b/i18n/fr_FR/resources/scripts/helpers/build/release/util new file mode 100755 index 00000000..a3224504 --- /dev/null +++ b/i18n/fr_FR/resources/scripts/helpers/build/release/util @@ -0,0 +1,253 @@ +#!/usr/bin/env bash + +# +# helper script: generate the release archives +# +# 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 current working directory when running +# it is the root directory of the libreboot git repository clone. + +[ "x${DEBUG+set}" = 'xset' ] && set -v +set -u -e + +arch="unknown" +if [ "$(uname -i)" = "i686" ] || [ "$(uname -m)" = "i686" ] + then + arch="i686" + echo "Running on i686. ok." + sleep 2 +elif [ "$(uname -i)" = "x86_64" ] || [ "$(uname -m)" = "x86_64" ] + then + arch="x86_64" + echo "Running on x86_64. ok." + sleep 2 +else + echo "This script must be run on an i686 or x86_64 host. x86_64 is recommended." + exit 1 +fi + +if [ -f "version" ]; then + # _src release archive is being used + version="$(cat version)" + versiondate="$(cat versiondate)" +else + # git repo is being used + version="$(git describe --tags HEAD)" + versiondate="$(git show -s --format=%ct)" +fi +versiondir="release/oldbuildsystem/${version}" +distname="libreboot_${version}_util" +distdir="${versiondir}/${distname}" + +printf "Creating utility archive (static executables)\n" + +# delete the old data +rm -Rf "${distdir:?}/" +rm -f "${distdir}.tar.xz" + +# this is where they will go +mkdir -p "${distdir}/" + +# this has to be done before generating +# the "version" file +if [ ! -f "version" ]; then + # generate ChangeLog and NEWS files + rm -f "ChangeLog" "NEWS" + git log > "${distdir}/ChangeLog" + cp "${distdir}/ChangeLog" "${distdir}/NEWS" +else + # building from release archive + cp "ChangeLog" "${distdir}/" + cp "NEWS" "${distdir}/" +fi + +if [ -f "RELEASE" ]; then + rm -f "${distdir}/ChangeLog" + rm -f "${distdir}/NEWS" + cp "RELEASE" "${distdir}/ChangeLog" + cp "RELEASE" "${distdir}/NEWS" +fi + +# include version information +printf '%s\n' "${version}" >"${distdir}/version" +# include version date information +printf '%s\n' "${versiondate}" >"${distdir}/versiondate" + +# -------------- +# BUC.TS related +# -------------- +# X60/T60: BUC.TS utility is needed to flash libreboot while Lenovo BIOS is running +# Include it statically compiled +cp -R "bucts" "bucts_/" +# make it statically compile +./oldbuild module bucts static +mkdir -p "${distdir}/bucts/${arch}/" +mv "bucts/bucts" "${distdir}/bucts/${arch}/" +rm -Rf "bucts/" +mv "bucts_/" "bucts/" + +# ---------------- +# Flashrom related +# ---------------- +# Flashrom is used to install libreboot on supported targets +# Include it statically compiled +cp -R "flashrom/" "flashrom_/" +# make it statically compile +./oldbuild module flashrom static +mkdir -p "${distdir}/flashrom/${arch}/" +mv "flashrom/flashrom" "${distdir}/flashrom/${arch}/" +mv "flashrom/flashrom_lenovobios_sst" "${distdir}/flashrom/${arch}/" +mv "flashrom/flashrom_lenovobios_macronix" "${distdir}/flashrom/${arch}/" +rm -Rf "flashrom/" +mv "flashrom_/" "flashrom/" + + # ---------------- +# cbfstool related +# ---------------- +# build cbfstool, compiled (statically linked) and include the binary + +mkdir -p "${distdir}/cbfstool/${arch}/" + +cd "crossgcc/util/" +cp -R "cbfstool" "cbfstool_/" +cd "cbfstool/" +sed -i '/.*fmd_scanner.o.*-Wno-unused-function$/ s/$/ -Wno-sign-compare/' Makefile.inc # build fix for latest flex version +make clean +make SHARED=0 CC='gcc -static' + +mv "cbfstool" "../../../${distdir}/cbfstool/${arch}/" + +if [ "${arch}" = "x86_64" ] + then + # Now build 32-bit binaries + make clean + make SHARED=0 CC='gcc -static -m32' + mkdir "../../../${distdir}/cbfstool/i686" + mv "cbfstool" "../../../${distdir}/cbfstool/i686/" +fi + +# cross-compile for ARM +make clean +make SHARED=0 CC='arm-linux-gnueabi-gcc -static' +mkdir "../../../${distdir}/cbfstool/armv7l/" +mv "cbfstool" "../../../${distdir}/cbfstool/armv7l/" + +cd ../ +rm -Rf "cbfstool/" +mv "cbfstool_/" "cbfstool/" +cd ../../ + + +# ---------------- +# ich9deblob related +# ---------------- +# build ich9deblob, compiled (statically linked) and include the binary + +mkdir -p "${distdir}/ich9deblob/${arch}" + +cd "resources/utilities/" +cp -R "ich9deblob" "ich9deblob_/" +cd "ich9deblob/" +make clean +make SHARED=0 CC='gcc -static' + +mv "ich9deblob" "../../../${distdir}/ich9deblob/${arch}/" +mv "ich9gen" "../../../${distdir}/ich9deblob/${arch}/" +mv "demefactory" "../../../${distdir}/ich9deblob/${arch}/" + +if [ "${arch}" = "x86_64" ] + then + # Now build 32-bit binaries + make clean + make SHARED=0 CC='gcc -static -m32' + mkdir "../../../${distdir}/ich9deblob/i686/" + mv "ich9deblob" "../../../${distdir}/ich9deblob/i686/" + mv "ich9gen" "../../../${distdir}/ich9deblob/i686/" + mv "demefactory" "../../../${distdir}/ich9deblob/i686/" +fi + +# cross-compile for ARM +make clean +make SHARED=0 CC='arm-linux-gnueabi-gcc -static' +mkdir "../../../${distdir}/ich9deblob/armv7l" +mv "ich9deblob" "../../../${distdir}/ich9deblob/armv7l/" +mv "ich9gen" "../../../${distdir}/ich9deblob/armv7l/" +mv "demefactory" "../../../${distdir}/ich9deblob/armv7l/" + +cd "../" +rm -Rf "ich9deblob/" +mv "ich9deblob_/" "ich9deblob/" +cd "../../" + +# ----------------- +# nvramtool related +# ----------------- +# build nvramtool, compiled (statically linked) and include the binary +cd "crossgcc/util/" +cp -R "nvramtool/" "nvramtool_/" +cd "nvramtool/" +make clean +make SHARED=0 CC='gcc -static' + +mkdir -p "../../../${distdir}/nvramtool/${arch}/" + +mv "nvramtool" "../../../${distdir}/nvramtool/${arch}/" + +if [ "${arch}" = "x86_64" ] + then + # Now build 32-bit binaries + make clean + make SHARED=0 CC='gcc -static -m32' + mkdir "../../../${distdir}/nvramtool/i686/" + mv "nvramtool" "../../../${distdir}/nvramtool/i686/" +fi + +cd "../" +rm -Rf "nvramtool/" +mv "nvramtool_/" "nvramtool/" +cd "../../" + +# ------------- +# Miscellaneous +# ------------- + +# Flashing script +cp "flash" "${distdir}/" + +# powertop script +cp "resources/scripts/misc/powertop.trisquel7" "${distdir}/" + +# grubeditor.sh script +cp "resources/scripts/misc/grubeditor.sh" "${distdir}/" + +printf "\n\n" + +# ### Create the release tarballs +# ---------------------------------------------------------------------------------------------------------------------------- + +printf "Compressing %s/ into %s.tar.xz\n" "${distdir}" "${distdir}.tar.xz" +# create lzma compressed util archive +(cd "${versiondir}/" && tar -c "${distname}/" | xz -9e >"${distname}.tar.xz") + +printf "done\n\n" + +# ### Delete the uncompressed release directories +# ---------------------------------------------------------------------------------------------------------------------------- + +# The uncompressed archives are no longer needed +rm -Rf "${distdir:?}/" diff --git a/i18n/fr_FR/resources/scripts/helpers/build/roms/withgrub b/i18n/fr_FR/resources/scripts/helpers/build/roms/withgrub new file mode 100755 index 00000000..4b812bfe --- /dev/null +++ b/i18n/fr_FR/resources/scripts/helpers/build/roms/withgrub @@ -0,0 +1,125 @@ +#!/usr/bin/env bash + +# +# helper script: build ROM images with SeaGRUB and put them in ./bin/ +# +# Copyright (C) 2014, 2015, 2016 Leah Rowe <info@minifree.org> +# 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 git or release archive + +[ "x${DEBUG+set}" = 'xset' ] && set -v +set -u -e + +printf "Building ROM images with the GRUB payload\n" + +# The GRUB files should be deleted first +rm -f "coreboot/grub"*.{elf,cfg} +rm -f "coreboot/"*/*/grub*.{elf,cfg} + +[ -d bin ] || mkdir "bin/" + +# Put GRUB payloads and config files +# in the coreboot directory, ready for next step +( +cd "coreboot/" +for romtype in txtmode vesafb; do + cd ../resources/utilities/grub-assemble + ./gen.sh ${romtype} + rm -f "../../../coreboot/grub_${romtype}.elf" + mv "grub_${romtype}.elf" "../../../coreboot/" + cd "../../../coreboot" + + # GRUB configuration files + for keylayout in ../resources/utilities/grub-assemble/keymap/original/*; do + keymap="${keylayout##*/}" + cat ../resources/grub/config/extra/{common,"${romtype}"}.cfg > "grub_${keymap}_${romtype}.cfg" + printf "keymap %s\n" "${keymap}" >> "grub_${keymap}_${romtype}.cfg" + cat ../resources/grub/config/menuentries/{common,"${romtype}"}.cfg >> "grub_${keymap}_${romtype}.cfg" + # grubtest.cfg should be able to switch back to grub.cfg + sed "s/grubtest.cfg/grub.cfg/" < "grub_${keymap}_${romtype}.cfg" > "grub_${keymap}_${romtype}_test.cfg" + done +done +) + +# Build ROM images for supported boards +buildrom() { + board="$1" + if [ -f "resources/libreboot/config/grub/${board}/config" ]; then + ./oldbuild roms withgrub_helper "${board}" + fi +} + +if [ $# -gt 0 ]; then + for board in "${@}"; do + buildrom "${board}" + done +else + for board in resources/libreboot/config/grub/*; do + buildrom "${board##*/}" + done +fi + +# Needed on i945 systems for the bucts/dd trick (documented) +# This enables the ROM to be flashed over the lenovo bios firmware +for i945board in "x60" "t60" +do + if [ -d "bin/grub/${i945board}/" ]; then + cd "bin/grub/${i945board}/" + for i945rom in * + do + dd if="${i945rom}" of=top64k.bin bs=1 skip=$[$(stat -c %s "${i945rom}") - 0x10000] count=64k + dd if=top64k.bin of="${i945rom}" bs=1 seek=$[$(stat -c %s "${i945rom}") - 0x20000] count=64k conv=notrunc + rm -f top64k.bin + done + cd "../../../" + fi +done + +# Build the deblobbed descriptor+gbe regions for GM45/ICH9M targets. +# Then put them in the ROM images. +if [ -d "bin/grub/" ]; then + cd "bin/grub/" + for board in "x200" "r400" "t400" "t500" "w500" + do + for romsize in "4m" "8m" "16m" + do + if [ -d "${board}_${romsize}b/" ]; then + cd "${board}_${romsize}b/" + if [ -f "../../../gm45macaddress" ]; then + ../../../resources/utilities/ich9deblob/ich9gen --macaddress $(cat ../../../gm45macaddress) + else + ../../../resources/utilities/ich9deblob/ich9gen + fi + for rom in *.rom + do + dd if="ich9fdgbe_${romsize}.bin" of="${rom}" bs=1 count=12k conv=notrunc + done + rm -f "ich9fd"*.bin "mk"*.[ch] + cd "../" + fi + done + done + cd ../../ +fi + +# The GRUB files are no longer needed +rm -f "coreboot/"*.{elf,cfg} +rm -f "coreboot/"*/*/*.{elf,cfg} + +printf "\n\n" diff --git a/i18n/fr_FR/resources/scripts/helpers/build/roms/withgrub_helper b/i18n/fr_FR/resources/scripts/helpers/build/roms/withgrub_helper new file mode 100755 index 00000000..49294451 --- /dev/null +++ b/i18n/fr_FR/resources/scripts/helpers/build/roms/withgrub_helper @@ -0,0 +1,203 @@ +#!/usr/bin/env bash + +# helper script: create ROM images for a given system, with SeaGRUB +# +# Copyright (C) 2014, 2015, 2016 Leah Rowe <info@minifree.org> +# 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 git or release archive + +[ "x${DEBUG+set}" = 'xset' ] && set -v +set -u -e +if [ -z ${NPROC+x} ]; then + cores="$(nproc)" +else + case ${NPROC} in + ''|*[!0-9]*) + printf "value '%s' for NPROC is invalid. non-numeric. Exiting.\n" "${NPROC}" + exit 1 + ;; + esac + cores="${NPROC}" +fi + +if (( $# != 1 )); then + printf "Usage: ./oldbuild rom withgrub boardname\n" + printf "Example: ./oldbuild rom withgrub x60\n" + printf "You need to specify exactly 1 argument\n" + exit 1 +fi + +boardtarget="${1}" + +if [ -f "version" ]; then + # release archive is being used + version="$(cat version)" +else + # git repo is being used + version="$(git describe --tags HEAD)" +fi + +printf "GRUB Helper script: build ROM images for '%s'\n" "${boardtarget}" + +( +cbrevision="$(cat resources/libreboot/config/grub/${boardtarget}/cbrevision)" +vbootrevision="$(cat resources/libreboot/config/grub/${boardtarget}/vbootrevision)" +branchname="grub_${boardtarget}" + +cd "coreboot/${cbrevision}/${cbrevision}/" +git checkout ${branchname} +( + cd "3rdparty/vboot/" + git checkout ${branchname} +) + +# Make sure to remove these first +rm -f *.{elf,cfg} + +printf 'libreboot-%s\n' "${version}" > ".coreboot-version" # needed for reproducible builds in coreboot + +# Build ROM images with text-mode and corebootfb modes. + +if [ "${boardtarget}" = "qemu_i440fx_piix4" ] || [ "${boardtarget}" = "qemu_q35_ich9" ] +then + # assume that the default config enable framebuffer mode, duplicate and patch for text-mode + # necessary, otherwise it will ask you to enter the Y/X resolution of the framebuffer at build time + cp "../../../resources/libreboot/config/grub/${boardtarget}/config" "config_vesafb" + sed 's/CONFIG_FRAMEBUFFER_KEEP_VESA_MODE=y/# CONFIG_FRAMEBUFFER_KEEP_VESA_MODE is not set/' < "config_vesafb" > "config_txtmode" +else + # assume that the default config enables text-mode, duplicate and patch for framebuffer mode + cp "../../../resources/libreboot/config/grub/${boardtarget}/config" "config_txtmode" + sed 's/# CONFIG_FRAMEBUFFER_KEEP_VESA_MODE is not set/CONFIG_FRAMEBUFFER_KEEP_VESA_MODE=y/' < "config_txtmode" > "config_vesafb" +fi + +for romtype in txtmode vesafb +do + if [ "${boardtarget}" = "kgpe-d16" ] || [ "${boardtarget}" = "ga-g41m-es2l" ] || [ "${boardtarget}" = "kcma-d8" ] || [ "${boardtarget}" = "d510mo" ]; then + if [ "${romtype}" = "vesafb" ]; then + printf "Only text-mode is reported to work on KGPE-D16, KCMA-D8, D510MO and ga-g41m-es2l\n" + printf "TODO: get tpearson to fix it\n" + continue + fi + fi + + # Build coreboot ROM image + make clean + mv "config_${romtype}" ".config" + cp "../../grub_${romtype}.elf" "grub.elf" + if [ "${boardtarget}" = "d510mo" ] || [ "${boardtarget}" = "ga-g41m-es2l" ]; then + # Do not use SeaGRUB + cp grub.elf payload.elf + make -j${cores} + mv "build/coreboot.rom" "${boardtarget}_${romtype}.rom" + + # We dont need seabios.elf anymore + rm -f "payload.elf" + else + # Use SeaGRUB + cp "../../../seabios/out/bios.bin.elf" "payload.elf" + make -j${cores} + + mv "build/coreboot.rom" "${boardtarget}_${romtype}.rom" + + # We dont need seabios.elf anymore + rm -f "payload.elf" + # Add the grub.elf to CBFS + ./util/cbfstool/cbfstool "${boardtarget}_${romtype}.rom" add-payload -c lzma -f grub.elf -n img/grub2 + + # Set bootorder so that seabios loads grub by default + printf "/rom@img/grub2\n" > bootorder + ./util/cbfstool/cbfstool "${boardtarget}_${romtype}.rom" add -f bootorder -n bootorder -t raw + rm -f bootorder + + # Add 0s delay to seabios, so that the user is not burdened by seeing + # that horrible interface that seabios has + ./util/cbfstool/cbfstool "${boardtarget}_${romtype}.rom" add-int -i 0 -n etc/show-boot-menu || "already exists" + + # Add a file to CBFS that tells SeaBIOS not to load option ROMs + ./util/cbfstool/cbfstool "${boardtarget}_${romtype}.rom" add-int -i 0 -n etc/pci-optionrom-exec || "already exists" + + # keyboard spinup timeout + ./util/cbfstool/cbfstool "${boardtarget}_${romtype}.rom" remove -n etc/ps2-keyboard-spinup || printf "does not exist" + ./util/cbfstool/cbfstool "${boardtarget}_${romtype}.rom" add-int -i 3000 -n etc/ps2-keyboard-spinup || printf "already exists" + fi + + printf "%s\n" "${version}" > lbversion + ./util/cbfstool/cbfstool "${boardtarget}_${romtype}.rom" add -f lbversion -n lbversion -t raw + rm -f "lbversion" + + # we dont need that grub.elf now + rm -f "grub.elf" + + # .config no longer needed + rm -f ".config" + + # Add the background image + if [ "$romtype" = "vesafb" ] + then + if [ "$1" = "macbook21" ] || [ "$1" = "x200_4mb" ] || [ "$1" = "x200_8mb" ] || [ "$1" = "x200_16mb" ] || [ "$1" = "r400_4mb" ] || [ "$1" = "r400_8mb" ] || [ "$1" = "r400_16mb" ] || [ "$1" = "t400_4mb" ] || [ "$1" = "t400_8mb" ] || [ "$1" = "t400_16mb" ] || [ "$1" = "t500_4mb" ] || [ "$1" = "t500_8mb" ] || [ "$1" = "t500_16mb" ] || [ "$1" = "w500_4mb" ] || [ "$1" = "w500_8mb" ] || [ "$1" = "w500_16mb" ] + + then + ./util/cbfstool/cbfstool "${boardtarget}_${romtype}.rom" add -f ../../../resources/grub/background/background1280x800.png -n background.png -t raw + else + ./util/cbfstool/cbfstool "${boardtarget}_${romtype}.rom" add -f ../../../resources/grub/background/background1024x768.png -n background.png -t raw + fi + fi + + # Add the correct GRUB configuration file for this image. + for keylayout in ../../../resources/utilities/grub-assemble/keymap/original/* + do + keymap="${keylayout##*/}" + + # copy the images based on the keymap + cp "${boardtarget}_${romtype}.rom" "${boardtarget}_${keymap}_${romtype}.rom" + + # Insert grub config into the image + ./util/cbfstool/cbfstool "${boardtarget}_${keymap}_${romtype}.rom" add -f ../../"grub_${keymap}_${romtype}.cfg" -n grub.cfg -t raw + # Insert grub test config into the image (for the user to test modifications to before modifying the main one) + ./util/cbfstool/cbfstool "${boardtarget}_${keymap}_${romtype}.rom" add -f ../../"grub_${keymap}_${romtype}_test.cfg" -n grubtest.cfg -t raw + done + + # This config-less ROM is no longer needed + rm -f "${boardtarget}_${romtype}.rom" +done + +# Clean up and prepare bin/ containing all ROM images + +# move ROM images into the newly created directory +rm -Rf "${boardtarget:?}/" +mkdir "${boardtarget}/" +mv "${boardtarget}"*.rom "${boardtarget}/" + +# delete old ROM images +rm -Rf "../../../bin/grub/${boardtarget}/" +# put new ROM images in ../bin/grub/ +[ -d "../../../bin/grub/" ] || mkdir -p "../../../bin/grub/" +mv "${boardtarget}/" "../../../bin/grub/" + +# version info file no longer needed +rm -f ".coreboot-version" + +git checkout master +( + cd "3rdparty/vboot/" + git checkout master +) +) + +printf "\n\n" diff --git a/i18n/fr_FR/resources/scripts/helpers/build/roms/withseabios b/i18n/fr_FR/resources/scripts/helpers/build/roms/withseabios new file mode 100755 index 00000000..71f0c448 --- /dev/null +++ b/i18n/fr_FR/resources/scripts/helpers/build/roms/withseabios @@ -0,0 +1,55 @@ +#!/usr/bin/env bash + +# +# helper script: build ROM images with SeaBIOS and put them in ./bin/seabios/ +# +# Copyright (C) 2014, 2015, 2016 Leah Rowe <info@minifree.org> +# 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 git or release archive + +[ "x${DEBUG+set}" = 'xset' ] && set -v +set -u -e + +printf "Building ROM images with the SeaBIOS payload\n" + +[ -d bin ] || mkdir "bin/" + +# Build ROM images for supported boards +buildrom() { + board="$1" + if [ -f "resources/libreboot/config/seabios/${board}/config" ]; then + ./oldbuild roms withseabios_helper "${board}" + fi +} + +if [ $# -gt 0 ]; then + for board in "${@}"; do + buildrom "${board}" + done +else + for board in resources/libreboot/config/seabios/*; do + buildrom "${board##*/}" + done +fi + +# The SeaBIOS files are no longer needed +rm -f coreboot/*.{elf,cfg} +rm -f coreboot/*/*/*.{elf,cfg} + +printf "\n\n" diff --git a/i18n/fr_FR/resources/scripts/helpers/build/roms/withseabios_helper b/i18n/fr_FR/resources/scripts/helpers/build/roms/withseabios_helper new file mode 100755 index 00000000..caceddd0 --- /dev/null +++ b/i18n/fr_FR/resources/scripts/helpers/build/roms/withseabios_helper @@ -0,0 +1,139 @@ +#!/usr/bin/env bash + +# helper script: create ROM images for a given system, with SeaBIOS +# +# Copyright (C) 2014, 2015, 2016 Leah Rowe <info@minifree.org> +# 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 git or release archive + +[ "x${DEBUG+set}" = 'xset' ] && set -v +set -u -e +if [ -z ${NPROC+x} ]; then + cores="$(nproc)" +else + case ${NPROC} in + ''|*[!0-9]*) + printf "value '%s' for NPROC is invalid. non-numeric. Exiting.\n" "${NPROC}" + exit 1 + ;; + esac + cores="${NPROC}" +fi + +if (( $# != 1 )); then + printf "Usage: ./oldbuild rom withseabios boardname\n" + printf "Example: ./oldbuild rom withseabios x60\n" + printf "You need to specify exactly 1 argument\n" + exit 1 +fi + +boardtarget="${1}" + +if [ -f "version" ]; then + # release archive is being used + version="$(cat version)" +else + # git repo is being used + version="$(git describe --tags HEAD)" +fi + +printf "SeaBIOS Helper script: build ROM images for '%s'\n" "${boardtarget}" + +( +cbrevision="$(cat resources/libreboot/config/seabios/${boardtarget}/cbrevision)" +vbootrevision="$(cat resources/libreboot/config/seabios/${boardtarget}/vbootrevision)" +branchname="seabios_${boardtarget}" + +cd "coreboot/${cbrevision}/${cbrevision}/" +git checkout ${branchname} +( + cd "3rdparty/vboot/" + git checkout ${branchname} +) + +# Make sure to remove these first +rm -f *{elf,cfg} + +printf 'libreboot-%s\n' "${version}" > ".coreboot-version" # needed for reproducible builds in coreboot + +# Build ROM images with text-mode and corebootfb modes. + +for romtype in txtmode vesafb +do + if [ "${boardtarget}" = "kgpe-d16" ] || [ "${boardtarget}" = "kcma-d8" ] || [ "${boardtarget}" = "d945gclf" ]; then + if [ "${romtype}" = "vesafb" ]; then + printf "Only text-mode is reported to work on KGPE-D16, KCMA-D8, d945gclf\n" + continue + fi + fi + + if [ "${boardtarget}" = "qemu_i440fx_piix4" ] || [ "${boardtarget}" = "qemu_q35_ich9" ] + then + # assume that the default config enable framebuffer mode, duplicate and patch for text-mode + # necessary, otherwise it will ask you to enter the Y/X resolution of the framebuffer at build time + cp "../../../resources/libreboot/config/seabios/${boardtarget}/config" "config_vesafb" + sed 's/CONFIG_FRAMEBUFFER_KEEP_VESA_MODE=y/# CONFIG_FRAMEBUFFER_KEEP_VESA_MODE is not set/' < "config_vesafb" > "config_txtmode" + else + # assume that the default config enables text-mode, duplicate and patch for framebuffer mode + cp "../../../resources/libreboot/config/seabios/${boardtarget}/config" "config_txtmode" + sed 's/# CONFIG_FRAMEBUFFER_KEEP_VESA_MODE is not set/CONFIG_FRAMEBUFFER_KEEP_VESA_MODE=y/' < "config_txtmode" > "config_vesafb" + fi + + # Build coreboot ROM image + make clean + cp "../../../seabios/out/bios.bin.vga.elf" "payload.elf" + mv "config_${romtype}" .config + make -j${cores} + rm -f "payload.elf" + mv "build/coreboot.rom" "${boardtarget}_${romtype}.rom" + + # Now add SeaVGABIOS (SeaBIOS wrapper for coreboot native video init) + ./util/cbfstool/cbfstool "${boardtarget}_${romtype}.rom" add -f ../../../seabios/out/vgabios.bin -n vgaroms/vgabios.bin -t raw + + # Add a file to CBFS that tells SeaBIOS not to load option ROMs + ./util/cbfstool/cbfstool "${boardtarget}_${romtype}.rom" add-int -i 0 -n etc/pci-optionrom-exec || "already exists" + + # .config no longer needed + rm -f ".config" +done + +# Clean up and prepare bin/ containing all ROM images + +# move ROM images into the newly created directory +rm -Rf "${boardtarget:?}/" +mkdir "${boardtarget}/" +mv "${boardtarget}"*.rom "${boardtarget}/" + +# delete old ROM images +rm -Rf "../../../bin/seabios/${boardtarget}/" +# put new ROM images in ../bin/grub/ +[ -d "../../../bin/seabios/" ] || mkdir -p "../../../bin/seabios/" +mv "${boardtarget}/" "../../../bin/seabios/" + +# version info file no longer needed +rm -f ".coreboot-version" + +git checkout master +( + cd "3rdparty/vboot/" + git checkout master +) +) + +printf "\n\n" diff --git a/i18n/fr_FR/resources/scripts/helpers/download/bucts b/i18n/fr_FR/resources/scripts/helpers/download/bucts new file mode 100755 index 00000000..b57df1fd --- /dev/null +++ b/i18n/fr_FR/resources/scripts/helpers/download/bucts @@ -0,0 +1,59 @@ +#!/usr/bin/env 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 https://notabug.org/libreboot/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/i18n/fr_FR/resources/scripts/helpers/download/coreboot b/i18n/fr_FR/resources/scripts/helpers/download/coreboot new file mode 100755 index 00000000..8b8fa510 --- /dev/null +++ b/i18n/fr_FR/resources/scripts/helpers/download/coreboot @@ -0,0 +1,153 @@ +#!/usr/bin/env 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/i18n/fr_FR/resources/scripts/helpers/download/crossgcc b/i18n/fr_FR/resources/scripts/helpers/download/crossgcc new file mode 100755 index 00000000..8522458a --- /dev/null +++ b/i18n/fr_FR/resources/scripts/helpers/download/crossgcc @@ -0,0 +1,62 @@ +#!/usr/bin/env 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="35562d8b6477058e6bca31b5cedd9d4897124fc7" +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} + ) + # If -pie is enabled in GCC, then --with-pic must be used when compiling + git am ../resources/libreboot/patch/crossgcc/looking_for_pie.patch + # Update URI pointing to the version of libelf we need + git am ../resources/libreboot/patch/crossgcc/libelf.patch + #Patch to add hash checking to buildgcc + git apply ../resources/libreboot/patch/crossgcc/buildgcc_hash_patch.diff + rm -Rf .git* */*/.git* +) + + +printf "Deblobbing coreboot\n" +./resources/utilities/coreboot-libre/deblob + + diff --git a/i18n/fr_FR/resources/scripts/helpers/download/flashrom b/i18n/fr_FR/resources/scripts/helpers/download/flashrom new file mode 100755 index 00000000..da3adad0 --- /dev/null +++ b/i18n/fr_FR/resources/scripts/helpers/download/flashrom @@ -0,0 +1,65 @@ +#!/usr/bin/env 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 v0.9.9 +git reset --hard + +# Apply patches +# ------------------------------------------------------------------------------ + +printf "Enabling whitelist for X200S, X200 Tablet, T400, T500, W500 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/i18n/fr_FR/resources/scripts/helpers/download/grub b/i18n/fr_FR/resources/scripts/helpers/download/grub new file mode 100755 index 00000000..3ec8a8fb --- /dev/null +++ b/i18n/fr_FR/resources/scripts/helpers/download/grub @@ -0,0 +1,62 @@ +#!/usr/bin/env 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 e54c99aaff5e5f6f5d3b06028506c57e66d8ef77 + +# 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" + +# Enable reproducible builds +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/i18n/fr_FR/resources/scripts/helpers/download/memtest86plus b/i18n/fr_FR/resources/scripts/helpers/download/memtest86plus new file mode 100755 index 00000000..f96af2b1 --- /dev/null +++ b/i18n/fr_FR/resources/scripts/helpers/download/memtest86plus @@ -0,0 +1,71 @@ +#!/usr/bin/env 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/i18n/fr_FR/resources/scripts/helpers/download/seabios b/i18n/fr_FR/resources/scripts/helpers/download/seabios new file mode 100755 index 00000000..8e92618a --- /dev/null +++ b/i18n/fr_FR/resources/scripts/helpers/download/seabios @@ -0,0 +1,51 @@ +#!/usr/bin/env 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 https://git.seabios.org/seabios.git seabios || \ +git clone https://review.coreboot.org/cgit/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 19fdcca467ad3436d68ef88899b4dcd78154a9c6 +) + + diff --git a/i18n/fr_FR/resources/scripts/misc/check-trailing-newline b/i18n/fr_FR/resources/scripts/misc/check-trailing-newline new file mode 100644 index 00000000..5a6cd5cc --- /dev/null +++ b/i18n/fr_FR/resources/scripts/misc/check-trailing-newline @@ -0,0 +1,33 @@ +#!/usr/bin/env guile +-*- scheme -*- +!# +;;; check-trailing-newline -- Find files lacking a trailing newline +;;; Use guile 2 (not 1.8) +;;; Copyright (C) 2015 Mark H Weaver <mhw@netris.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/>. + +(use-modules (ice-9 match) + (rnrs io ports)) + +(define (check-file file-name) + (let ((contents (call-with-input-file file-name get-string-all))) + (unless (string-suffix? "\n" contents) + (format (current-error-port) + "~a: lacks trailing newline\n" + file-name)))) + +(match (command-line) + ((_ file-names ...) + (for-each check-file file-names))) diff --git a/i18n/fr_FR/resources/scripts/misc/grubeditor.sh b/i18n/fr_FR/resources/scripts/misc/grubeditor.sh new file mode 100644 index 00000000..9b26a5e0 --- /dev/null +++ b/i18n/fr_FR/resources/scripts/misc/grubeditor.sh @@ -0,0 +1,557 @@ +#!/usr/bin/env bash +# +# grubeditor.sh -- conveniently edit grub{test}.cfg files by automating their +# extraction with cbfstool and the user's editor of choice. +# +# Copyright (C) 2017 Zyliwax <zyliwax@protonmail.com> +# +# 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 BLOCK IS EXPERIMENTAL +# Allow debugging by running DEBUG= ${0}. +[[ "x${DEBUG+set}" = 'xset' ]] && set -v +# -u kills the script if any variables are unassigned +# -e kills the script if any function returns not-zero +#set -u + +############## +# HELP COMMAND +############## + +show_help() { + cat << HELPSCREEN +$0 -- conveniently edit grub{test}.cfg files in Libreboot +ROM image files by automating their extraction with cbfstool +and the user's editor of choice. + +Usage: + +$0 [OPTIONS] [ROMFILE] + +Options: + +-h | --help: show usage help + +-r | --realcfg: generate grub.cfg instead of grubtest.cfg + +-i | --inplace: do not create a modified romfile, instead +modify the existing file + +-e | --editor [/path/to/]editor: open the cfg file with +/path/to/editor instead of the value of \$EDITOR + +-s | --swapcfg: swap grub.cfg and grubtest.cfg + +-d | --diffcfg: diff grub.cfg and grubtest.cfg + +-D | --differ [/path/to/]differ: use /path/to/differ instead +of "diff", can be an interactive program like vimdiff + +-x | --extract: extract either grub.cfg or grubtest.cfg +depending on -r option +HELPSCREEN +} + +# Version number of script +geversion="0.2.0" + +# Define the list of available option in both short and long form. +shortopts="hvrie:sdD:x" +longopts="help,version,realcfg,inplace,editor:,swapcfgs,diffcfgs,differ:,extract" + +# Variables for modifying the program's operation +edit_realcfg=0 +edit_inplace=0 +do_swapcfgs=0 +do_diffcfgs=0 +do_extract=0 +# Path to cbfstool, filled by detect_architecture +# (Possible to provide explicitly and disclaim warranty?) +cbfstool="" +# Editor variables +use_editor="" +default_editor="vi" +editor_rawarg="" +# Differ variables +use_differ="" +default_differ="diff" +differ_rawarg="" +# Last but not least, the rom file itself +romfile="" + +############################ +#### PRIMARY FUNCTIONS ##### +############################ +# The script effectively lives in a series of function definitions, which are +# provided here before their calls to ensure that they have been declared. +# +# Please scroll to the bottom of the script to see how this cascade of +# functions gets initiated. + +################ +# OPTION SCRAPER +################ + +get_options() { + # Test for enhanced getopt. + getopt --test > /dev/null + if [[ $? -ne 4 ]]; then + echo "Your environment lacks enhanced getopt, so you cannot run this script properly." + exit 205 + fi + + # Parse the command line options based on the previously defined values. + parsedopts=$(getopt --options $shortopts --longoptions $longopts --name "$0" -- "$@") + if [[ $? -ne 0 ]]; then # getopt didn't approve of your arguments + echo "Unrecognized options." + exit 206 + fi + + # Use eval set to properly quote the arguments + eval set -- "$parsedopts" + + # Interpret the arguments one-by-one until you run out. + while [[ 1 ]]; do + case "$1" in + -h|--help) + show_help + # I return non-zero here just so nobody thinks we successfully edited grub{,test}.cfg + exit 200 + ;; + -v|--version) + show_version + # I return non-zero here just so nobody thinks we successfully edited grub{,test}.cfg + exit 201 + ;; + -r|--realcfg) + edit_realcfg=1 + shift + ;; + -i|--inplace) + edit_inplace=1 + shift + ;; + -e|--editor) + editor_rawarg="$2" + shift 2 + ;; + -s|--swapcfgs) + do_swapcfgs=1 + shift + ;; + -d|--diffcfgs) + do_diffcfgs=1 + shift + ;; + -D|--differ) + differ_rawarg="$2" + shift 2 + ;; + -x|--extract) + do_extract=1 + shift + ;; + --) + # Stop interpreting arguments magically. + shift + break + ;; + *) + echo "Something went wrong while interpreting the arguments!" + echo "I hit \"$1\" and don't know what to do with it." + exit 209 + ;; + esac + done + + # The only option remaining should be the input file. Ensure it was + # provided before proceeding with the rest of the script and capture it if + # it was. + if [[ $# -ne 1 ]]; then + echo "You have specified multiple (or no) input files, which is unsupported." + echo "Please rerun this command with just a single filename to remove any chance for ambiguity." + exit 210 + fi + romfile="$1" +} + +determine_architecture() { + # The cbfstool in _util is packed only for i686, x86_64, and armv7l. This + # procedure is necessary for this process to not fail. After this process + # is over, the variable $cbfstool gets filled with the appropriate value + # for use by the rest of the script. + arch="$(uname -m)" + case "$arch" in + armv7l|i686|x86_64) + echo "Supported architecture \"$arch\" detected. You may proceed." + cbfstool="${0%/*}/cbfstool/$arch/cbfstool" + ;; + *) + echo "Unsupported architecture \"$arch\" detected! You may not proceed." + exit 230 + ;; + esac +} + +determine_operation() { + if [[ $do_swapcfgs -eq 1 ]]; then + swap_configs + exit $? + elif [[ $do_diffcfgs -eq 1 ]]; then + diff_configs + exit $? + elif [[ $do_extract -eq 1 ]]; then + extract_config + exit $? + else + edit_config + exit $? + fi +} + +################ +# VERSION SHOWER +################ + +show_version() { + echo "$0 $geversion" +} + +########################## +# EXTERNAL COMMAND FINDERS +########################## + +find_differ() { + found_differ=0 + + if [[ -n "$differ_rawarg" ]]; then + which "$differ_rawarg" &> /dev/null + if [[ $? -eq 0 ]]; then + echo "Using differ \"$differ_rawarg\"..." + use_differ="$differ_rawarg" + found_differ=1 + else + echo "The provided \"$differ_rawarg\" is not a valid command!" + echo "Defaulting to $default_differ..." + use_differ="$default_differ" + fi + fi + + if [[ $found_differ -eq 1 ]]; then + return + else + echo "Defaulting to $default_differ..." + use_differ="$default_differ" + fi +} + +find_editor() { + found_editor=0 + + if [[ -n "$editor_rawarg" ]]; then + which "$editor_rawarg" &> /dev/null + if [[ $? -eq 0 ]]; then + echo "Using editor \"$editor_rawarg\"..." + use_editor="$editor_rawarg" + found_editor=1 + else + echo "The provided \"$editor_rawarg\" is not a valid command!" + echo "Defaulting to $default_editor..." + use_editor="$default_editor" + fi + fi + + if [[ $found_editor -eq 1 ]]; then + return + else + if [[ -n "$EDITOR" ]]; then + which "$EDITOR" &> /dev/null + if [[ $? -ne 0 ]]; then + echo "Your \$EDITOR is defined as $EDITOR, but is not a valid command!" + echo "(This is bad. I highly suggest fixing this in your ~/.bashrc.)" + echo "Defaulting to $default_editor..." + use_editor="$default_editor" + else + echo "Using your defined \$EDITOR \"$EDITOR\"..." + use_editor="$EDITOR" + fi + else + echo "\$EDITOR blank, defaulting to $default_editor..." + use_editor="$default_editor" + fi + fi +} + +####################### +# FILE NAMING FUNCTIONS +####################### + +random_tempcfg() { + # Inputs: + # $1 is a descriptive label for the file + # $2 is directory (becomes /tmp if not set) + [[ -n "$1" ]] && label="$1" || label="tempfile" + [[ -n "$2" ]] && savedir="${2%/}" || savedir="/tmp" + + # Hardcoded string size for multiple good reasons (no processing weird + # input, prevent malicious overflows, etc.) + size=5 + + # Loop forever until a free filename is found. + while [[ 1 ]]; do + # Read data from /dev/urandom and convert into random ASCII strings. + rand="$(cat /dev/urandom | tr -dc 'a-zA-Z' | fold -w $size | head -n 1)" + + # Build a complete filename with a hardcoded extension. + possible="$savedir/${label}_${rand}.tmp.cfg" + + # See if file doesn't exist and return it as string or keep going. + if [[ ! -f "$possible" ]]; then + echo "$possible" + break + fi + done +} + +modified_romfile() { + # Inputs: + # $1 is the path to the file, optional + # $2 provides an optional description of the modification + [[ -n "$1" ]] && fullname="$1" || fullname="" + [[ -n "$2" ]] && operation="$2" || operation="altered" + + # Attempt to extract an extension from the file (it's probably .rom but + # can't assume so). $extension will not include prefixing dot, just the + # extension itself! + if [[ "$fullname" = *.* ]]; then + extension="${fullname##*.}" + else + extension="" + fi + + # Break up full path into containing directory and raw filename, providing + # an attempt at graceful failure if they are absent. + if [[ -z "$fullname" ]]; then + dirname="/tmp" + filename="grubedited" + else + dirname="$(dirname "$fullname")" + if [[ -z "$extension" ]]; then + filename="$(basename "$fullname")" + else + filename="$(basename "$fullname" ".$extension")" + fi + fi + + # Loop forever until a free filename is found. + while [[ 1 ]]; do + # Grab the current date. + now="$(date +"%Y%m%d_%H%M%S")" + + # Build a complete filename with a hardcoded extension. + possible="$dirname/${filename}-${now}-${operation}.${extension}" + + # See if file doesn't exist and return it as string or keep going. + if [[ ! -f "$possible" ]]; then + echo "$possible" + break + fi + done +} + +########################### +# PRIMARY PROGRAM FUNCTIONS +########################### + +swap_configs() { + # Procedure: + # 1. Call cbfstool twice, once each to extract grub.cfg and grubtest.cfg. + # 2. If --inplace not specified, copy $romfile to a new file and implement + # remaining steps on this copy. Otherwise, implement remaining steps on + # $romfile. + # 3. Call cbfstool twice, once each to delete grub.cfg and grubtest.cfg + # from romfile. + # 4. Call cbfstool twice, once to embed grubtest.cfg as grub.cfg into + # romfile and again to embed grub.cfg as grubtest.cfg into romfile. + # 5. Delete the extracted grub.cfg and grubtest.cfg files. + # 6. You're done! + + # Extract config files from provided romfile. + real2test="$(random_tempcfg "real2test")" + test2real="$(random_tempcfg "test2real")" + "$cbfstool" "$romfile" extract -n grub.cfg -f "$real2test" + "$cbfstool" "$romfile" extract -n grubtest.cfg -f "$test2real" + + # Determine whether to edit inplace or make a copy. + if [[ $edit_inplace -eq 1 ]]; then + outfile="$romfile" + else + outfile="$(modified_romfile "$romfile" "swapped")" + cp "$romfile" "$outfile" + echo "Saving modified romfile to $outfile" + fi + + # Since we are swapping the configs, we must modify their "load test config" + # options or else they will simply reference themselves, rendering the user + # unable to (easily) load the other config. + sed -i -e 's/Load test configuration (grubtest.cfg)/Load test configuration (grub.cfg)/' "$real2test" + sed -i -e 's/configfile \/grubtest.cfg/configfile \/grub.cfg/' "$real2test" + sed -i -e 's/Load test configuration (grub.cfg)/Load test configuration (grubtest.cfg)/' "$test2real" + sed -i -e 's/configfile \/grub.cfg/configfile \/grubtest.cfg/' "$test2real" + + # Remove config files from the output file. + "$cbfstool" "$outfile" remove -n grub.cfg + "$cbfstool" "$outfile" remove -n grubtest.cfg + + # Embed new configs into the output file. + "$cbfstool" "$outfile" add -t raw -n grub.cfg -f "$test2real" + "$cbfstool" "$outfile" add -t raw -n grubtest.cfg -f "$real2test" + + # Delete the tempfiles. + rm "$test2real" "$real2test" +} + +diff_configs() { + # Procedure: + # 1. Call cbfstool twice, once to extract grub.cfg and grubtest.cfg. + # 2. Execute $use_differ grub.cfg grubtest.cfg #. + # 3. Delete the extracted grub.cfg and grubtest.cfg files. + # 4. You're done! + + # Determine the differ command to use. + find_differ + + grubcfg="$(random_tempcfg "grubcfg")" + grubtestcfg="$(random_tempcfg "grubtestcfg")" + + # Extract config files from provided romfile. + "$cbfstool" "$romfile" extract -n grub.cfg -f "$grubcfg" + "$cbfstool" "$romfile" extract -n grubtest.cfg -f "$grubtestcfg" + + # Run the differ command with real as first option, test as second option. + "$use_differ" "$grubcfg" "$grubtestcfg" + + # Delete the temporary copies of the configuration files. + rm "$grubcfg" + rm "$grubtestcfg" +} + +edit_config() { + # Procedure: + # 1. If --realcfg specified, set $thisconfig to "grub.cfg". Otherwise, + # set $thisconfig to "grubtest.cfg". + # 2. Call cbfstool once to extract $thisconfig from $romfile. + # 3. Run $use_editor $thisconfig. + # 4. If $use_editor returns zero, proceed with update procedure: + # 5. Call cbfstool once to extract $thisconfig from $romfile. + # 6. Quietly diff the extracted file with the edited file. If diff returns + # zero, take no action: warn the user that the files were the same, delete + # both files, then skip the remaining steps (you're done)! Otherwise, the + # files are different and you must continue with the update procedure. + # 7. If --inplace not specified, copy $romfile to a new filename and + # implement remaining steps on this copy. Otherwise, implement remaining + # steps on $romfile. + # 8. Call cbfstool once to delete internal pre-update $thisconfig from + # the rom file. + # 9. Call cbfstool once to embed the updated $thisconfig that was just + # edited into the rom file. + # 10. Alert the user of success (either explicitly or by not saying + # anything, either way return zero). + # 11. You're done! + + # Determine the editor command to use. + find_editor + + # Determine whether we are editing the real config or the test config. + if [[ $edit_realcfg -eq 1 ]]; then + thisconfig="grub.cfg" + else + thisconfig="grubtest.cfg" + fi + + # Extract the desired configuration file from the romfile. + tmp_editme="$(random_tempcfg "${thisconfig%.cfg}")" + "$cbfstool" "$romfile" extract -n "$thisconfig" -f "$tmp_editme" + + # Launch the editor! + "$use_editor" "$tmp_editme" + + # Did the user commit the edit? + if [[ $? -eq 0 ]]; then + # See if it actually changed from what exists in the cbfs. + tmp_refcfg="/tmp/${thisconfig%.cfg}_ref.cfg" + "$cbfstool" "$romfile" extract -n "$thisconfig" -f "$tmp_refcfg" + # Diff the files as quietly as possible. + diff -q "$tmp_editme" "$tmp_refcfg" &> /dev/null + if [[ $? -ne 0 ]]; then + # The files differ, so it won't be frivolous to update the config. + # See if the user wants to edit the file in place. + # (This code should really be genericized and placed in a function + # to avoid repetition.) + if [[ $edit_inplace -eq 1 ]]; then + outfile="$romfile" + else + if [[ $edit_realcfg -eq 1 ]]; then + op="realcfg" + else + op="testcfg" + fi + outfile="$(modified_romfile "$romfile" "${op}_edited")" + cp "$romfile" "$outfile" + echo "Saving modified romfile to $outfile" + fi + # Remove the old config, add in the new one. + "$cbfstool" "$outfile" remove -n "$thisconfig" + "$cbfstool" "$outfile" add -t raw -n "$thisconfig" -f "$tmp_editme" + else + echo "No changes to config file. Not updating the ROM image." + fi + # We are done with the config files. Delete them. + rm "$tmp_editme" + rm "$tmp_refcfg" + fi +} + +extract_config() { + # This simply extracts a given config and responds to + # the -r flag. + + # Determine whether we are extracting the real config or the test config. + if [[ $edit_realcfg -eq 1 ]]; then + thisconfig="grub.cfg" + else + thisconfig="grubtest.cfg" + fi + + # Extract to a unique filename. + tmp_extractme="$(random_tempcfg "${thisconfig%.cfg}" "$(dirname "$romfile")")" + "$cbfstool" "$romfile" extract -n "$thisconfig" -f "$tmp_extractme" + err=$? + + # Determine if cbfstool reported success. + if [[ $err -ne 0 ]]; then + echo "cbfstool reported an error ($err). If it succeeded anyway, check $tmp_extractme." + else + echo "Extracted $thisconfig from $romfile to file $tmp_extractme." + fi +} + +################################# +#### PRIMARY EXECUTION FLOW ##### +################################# +# Run through the primary function cascade. +get_options $@ +determine_architecture +determine_operation diff --git a/i18n/fr_FR/resources/scripts/misc/libreboot_usb_bugfix b/i18n/fr_FR/resources/scripts/misc/libreboot_usb_bugfix new file mode 100644 index 00000000..bdb5c40a --- /dev/null +++ b/i18n/fr_FR/resources/scripts/misc/libreboot_usb_bugfix @@ -0,0 +1,50 @@ +#! /bin/sh +################################################################################ +# Copyright (C) 2016 Namine Ritsu <ritsu73@ecantorix.moe> # +# # +# 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/>. # +# # +################################################################################ + +### BEGIN INIT INFO +# Provides: libreboot_usb_bugfix +# Required-Start: $remote_fs $syslog +# Required-Stop: $remote_fs $syslog +# Default-Start: 2 3 4 5 +# Default-Stop: +# Short-Description: Disable USB wakeup on libreboot machines +### END INIT INFO + +case "$1" in + start) + EHC1=$(cat /proc/acpi/wakeup | grep EHC1 | grep enabled | wc -l) + EHC2=$(cat /proc/acpi/wakeup | grep EHC2 | grep enabled | wc -l) + if [ "$EHC1" -gt 0 ] + then + echo EHC1 > /proc/acpi/wakeup + fi + if [ "$EHC2" -gt 0 ] + then + echo EHC2 > /proc/acpi/wakeup + fi + ;; + status) + cat /proc/acpi/wakeup | grep EHC + ;; + *) + echo "Usage: /etc/init.d/libreboot_usb_bugfix {start|status}" + exit 1 +esac + +exit 0 diff --git a/i18n/fr_FR/resources/scripts/misc/powertop.trisquel7 b/i18n/fr_FR/resources/scripts/misc/powertop.trisquel7 new file mode 100755 index 00000000..cfce8f77 --- /dev/null +++ b/i18n/fr_FR/resources/scripts/misc/powertop.trisquel7 @@ -0,0 +1,50 @@ +#!/usr/bin/env bash + +# powertop.trisquel7: automatically sets up powertop --auto-tune on startup in trisquel 7 +# +# 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/>. +# + +[ "x${DEBUG+set}" = 'xset' ] && set -v +set -u -e + +if [ $EUID -ne 0 ]; then + printf "This script must be run as root\n" + exit 1 +fi + +# For Trisquel 7 users. + +apt-get -y install powertop + +# Remove startup symlink if it exists +update-rc.d powertop remove +# Remove previous file if it exists +rm -Rf "/etc/init.d/powertop" + +# write the correct commands there: +printf "#!/bin/sh\n" > "/etc/init.d/powertop" +printf "/usr/sbin/powertop --auto-tune\n" >> "/etc/init.d/powertop" + +# make it executable: +chmod +x "/etc/init.d/powertop" + +# Add the service to make it run automatically at boot time: +update-rc.d powertop defaults + +# Run powertop now and tell the user +powertop --auto-tune +printf "Done. Run 'powertop --auto-tune' now. This will also run automatically at boot time. Run it again at any time, if needed. This has also been done for you just now.\n" |