diff options
author | Libreboot Contributor <contributor@libreboot.org> | 2020-03-18 17:20:14 +0100 |
---|---|---|
committer | Libreboot Contributor <contributor@libreboot.org> | 2020-03-18 17:20:27 +0100 |
commit | 0f6ea1c9e0a25a9b7546f96f27cef8841f0d09b5 (patch) | |
tree | a28b9403123dd6204eb2dd8cb44eada12c169f4b /i18n/fr_FR/resources/libreboot/patch/crossgcc | |
parent | 6e5bdd1271059a9c61c80b21001fd3d14ff25045 (diff) | |
download | librebootfr-0f6ea1c9e0a25a9b7546f96f27cef8841f0d09b5.tar.gz librebootfr-0f6ea1c9e0a25a9b7546f96f27cef8841f0d09b5.zip |
Creation of i18n folder containing translations of the libreboot project. Added french one, not finished.
Diffstat (limited to 'i18n/fr_FR/resources/libreboot/patch/crossgcc')
3 files changed, 220 insertions, 0 deletions
diff --git a/i18n/fr_FR/resources/libreboot/patch/crossgcc/buildgcc_hash_patch.diff b/i18n/fr_FR/resources/libreboot/patch/crossgcc/buildgcc_hash_patch.diff new file mode 100644 index 00000000..9750795a --- /dev/null +++ b/i18n/fr_FR/resources/libreboot/patch/crossgcc/buildgcc_hash_patch.diff @@ -0,0 +1,163 @@ +diff --git a/util/crossgcc/buildgcc b/util/crossgcc/buildgcc +index 97c38b8d95..d6b11ed0a6 100755 +--- a/util/crossgcc/buildgcc ++++ b/util/crossgcc/buildgcc +@@ -270,18 +270,6 @@ check_cc() { + fi + } + +-check_sum() { +- test -z "$CHECKSUM" || \ +- test "$(cat sum/$1.cksum 2>/dev/null | sed -e 's@.*\([0-9a-f]\{40,\}\).*@\1@')" = \ +- "$($CHECKSUM tarballs/$1 2>/dev/null | sed -e 's@.*\([0-9a-f]\{40,\}\).*@\1@')" +-} +- +-compute_sum() { +- test ! -f sum/$1.cksum && test -f tarballs/$1 && \ +- (test -z "$CHECKSUM" || $CHECKSUM tarballs/$1 > sum/$1.cksum ) && \ +- printf "(checksum created. ${RED}Note. Please upload sum/$1.cksum if the corresponding archive is upgraded.)${NC}" +-} +- + download_showing_percentage() { + url=$1 + printf " ..${red} 0%%" +@@ -293,12 +281,13 @@ download_showing_percentage() { + + download() { + package=$1 +- archive="$(eval echo \$$package"_ARCHIVE")" ++ archive="$package"_ARCHIVE ++ archive="${!archive}" + + FILE=$(basename $archive) + printf " * $FILE " + +- if test -f tarballs/$FILE && check_sum $FILE ; then ++ if test -f tarballs/$FILE; then + printf "(cached)" + else + printf "(downloading from $archive)" +@@ -306,7 +295,6 @@ download() { + cd tarballs + download_showing_percentage $archive + cd .. +- compute_sum $FILE + fi + + if [ ! -f tarballs/$FILE ]; then +@@ -316,9 +304,100 @@ download() { + printf "\n" + } + ++# Compute the hash of the package given in $1, and print it raw (just the ++# hexadecimal hash). ++compute_hash() { ++ package=$1 ++ archive="$package"_ARCHIVE ++ archive="${!archive}" ++ file="$(basename "$archive")" ++ ++ if test -z "$CHECKSUM"; then ++ echo "${RED}\$CHECKSUM program missing. This is bad.${NC}" 1>&2 ++ exit 1 ++ fi ++ ++ $CHECKSUM "tarballs/$file" 2>/dev/null | sed -e 's@.*\([0-9a-f]\{40,\}\).*@\1@' ++} ++ ++error_hash_missing() { ++ package="$1" ++ archive="$package"_ARCHIVE ++ archive="${!archive}" ++ file="$(basename "$archive")" ++ ++ fullhashfile="util/crossgcc/sum/$file.cksum" ++ printf "${RED}hash file missing:${NC}\n\n" 1>&2 ++ printf "Please verify util/crossgcc/tarball/$file carefully\n" 1>&2 ++ printf "(using PGP if possible), and then rename\n" 1>&2 ++ printf " ${CYAN}${fullhashfile}.calc${NC}\n" 1>&2 ++ printf " to ${CYAN}${fullhashfile}${NC}\n\n" 1>&2 ++ ++ exit 1 ++} ++ ++# Read the known hash file of the package given in $1, and print it raw. ++get_known_hash() { ++ package=$1 ++ archive="$package"_ARCHIVE ++ archive="${!archive}" ++ file="$(basename "$archive")" ++ hashfile="sum/$file.cksum" ++ ++ if [ ! -f "$hashfile" ]; then ++ calc_hash="$(compute_hash "$package")" || exit 1 ++ echo "$calc_hash tarballs/$file" > "${hashfile}.calc" ++ ++ error_hash_missing "$package" ++ exit 1 ++ fi ++ ++ cat "$hashfile" | sed -e 's@.*\([0-9a-f]\{40,\}\).*@\1@' ++} ++ ++error_hash_mismatch() { ++ package=$1 ++ known_hash="$2" ++ computed_hash="$3" ++ archive="$package"_ARCHIVE ++ archive="${!archive}" ++ file="$(basename "$archive")" ++ ++ printf "${RED}hash mismatch:${NC}\n\n" ++ printf " expected (known) hash: $known_hash\n" ++ printf "calculated hash of downloaded file: $computed_hash\n\n" ++ ++ printf "If you think this is due to a network error, please delete\n" ++ printf " ${CYAN}util/crossgcc/tarballs/$file${NC}\n" ++ printf "and try again. If the problem persists, it may be due to an\n" ++ printf "administration error on the file server, or you might be\n" ++ printf "subject to a Man-in-the-Middle attack\n\n" ++ ++ exit 1 ++} ++ ++# verify_hash - Check that the hash of the file given in $1 matches the known ++# hash; Bail out on mismatch or missing hash file. ++verify_hash() { ++ package=$1 ++ archive="$package"_ARCHIVE ++ archive="${!archive}" ++ ++ known_hash="$(get_known_hash "$package")" || exit "$?" ++ computed_hash="$(compute_hash "$package")" || exit "$?" ++ ++ if [ "$known_hash" != "$computed_hash" ]; then ++ error_hash_mismatch "$package" "$known_hash" "$computed_hash" ++ exit 1 ++ fi ++ ++ printf "${GREEN}hash verified ("$known_hash")${NC}\n" ++} ++ + unpack_and_patch() { + package=$1 +- archive="$(eval echo \$$package"_ARCHIVE")" ++ archive="$package"_ARCHIVE ++ archive="${!archive}" + dir="$(eval echo \$$package"_DIR")" + test -d ${dir} && test -f ${dir}/.unpack_success || ( + printf " * $(basename $archive)\n" +@@ -963,10 +1042,11 @@ export PATH=$DESTDIR$TARGETDIR/bin:$PATH + + # Download, unpack, patch and build all packages + +-printf "Downloading tarballs ... \n" ++printf "Downloading and verifying tarballs... \n" + mkdir -p tarballs + for P in $PACKAGES; do +- download $P ++ download "$P" || exit "$?" ++ verify_hash "$P" || exit "$P" + done + printf "Downloaded tarballs ... ${green}ok${NC}\n" + diff --git a/i18n/fr_FR/resources/libreboot/patch/crossgcc/libelf.patch b/i18n/fr_FR/resources/libreboot/patch/crossgcc/libelf.patch new file mode 100644 index 00000000..af954446 --- /dev/null +++ b/i18n/fr_FR/resources/libreboot/patch/crossgcc/libelf.patch @@ -0,0 +1,25 @@ +From e2896721cff5af4d869a7c900e748c803f25a2ce Mon Sep 17 00:00:00 2001 +From: Andrew Robbins <contact@andrewrobbins.info> +Date: Thu, 26 Sep 2019 18:19:07 -0500 +Subject: [PATCH] buildgcc: Replace dead libelf archive URI + +--- + util/crossgcc/buildgcc | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/util/crossgcc/buildgcc b/util/crossgcc/buildgcc +index 97c38b8d95..54f87972e6 100755 +--- a/util/crossgcc/buildgcc ++++ b/util/crossgcc/buildgcc +@@ -57,7 +57,7 @@ MAKE_VERSION=4.2.1 + GMP_ARCHIVE="http://ftpmirror.gnu.org/gmp/gmp-${GMP_VERSION}.tar.xz" + MPFR_ARCHIVE="http://ftpmirror.gnu.org/mpfr/mpfr-${MPFR_VERSION}.tar.xz" + MPC_ARCHIVE="http://ftpmirror.gnu.org/mpc/mpc-${MPC_VERSION}.tar.gz" +-LIBELF_ARCHIVE="http://www.mr511.de/software/libelf-${LIBELF_VERSION}.tar.gz" ++LIBELF_ARCHIVE="https://fossies.org/linux/misc/old/libelf-${LIBELF_VERSION}.tar.gz" + GCC_ARCHIVE="http://ftpmirror.gnu.org/gcc/gcc-${GCC_VERSION}/gcc-${GCC_VERSION}.tar.bz2" + BINUTILS_ARCHIVE="http://ftpmirror.gnu.org/binutils/binutils-${BINUTILS_VERSION}.tar.bz2" + GDB_ARCHIVE="http://ftpmirror.gnu.org/gdb/gdb-${GDB_VERSION}.tar.xz" +-- +2.23.0 + diff --git a/i18n/fr_FR/resources/libreboot/patch/crossgcc/looking_for_pie.patch b/i18n/fr_FR/resources/libreboot/patch/crossgcc/looking_for_pie.patch new file mode 100644 index 00000000..942edac2 --- /dev/null +++ b/i18n/fr_FR/resources/libreboot/patch/crossgcc/looking_for_pie.patch @@ -0,0 +1,32 @@ +From e64fb0ce10d01d99154fb4bd95529e5cd8dfd4be Mon Sep 17 00:00:00 2001 +From: Andrew Robbins <contact@andrewrobbins.info> +Date: Fri, 27 Sep 2019 09:38:09 -0500 +Subject: [PATCH] buildgcc: Check for '-pie' when building gmp + +The regex formerly used was not flexible enough to catch some +instances where the '-pie' flag would be enabled. +--- + util/crossgcc/buildgcc | 7 +++++++ + 1 file changed, 7 insertions(+) + +diff --git a/util/crossgcc/buildgcc b/util/crossgcc/buildgcc +index 97c38b8d95..a6e4728514 100755 +--- a/util/crossgcc/buildgcc ++++ b/util/crossgcc/buildgcc +@@ -515,6 +515,13 @@ set_hostcflags_from_gmp() { + } + + build_GMP() { ++ # Check if GCC enables `-pie` by default (possible since GCC 6). ++ # We need PIC in all static libraries then. ++ if $CC -dumpspecs 2>/dev/null | grep -q '[{;][[:space:]]*\(!no-pie\)\?:-pie\>' ++ then ++ OPTIONS="$OPTIONS --with-pic" ++ fi ++ + CC="$CC" ../${GMP_DIR}/configure --disable-shared --enable-fat \ + --prefix=$TARGETDIR $OPTIONS \ + || touch .failed +-- +2.23.0 + |