X-Git-Url: https://git.zerfleddert.de/cgi-bin/gitweb.cgi/proxmark3-svn/blobdiff_plain/36f05880545d24cc53533c57709fdbf61bad12ba..c5847ae8af8d567da6cb905bd59c886e3d0c040b:/tools/install-gnuarm4.sh diff --git a/tools/install-gnuarm4.sh b/tools/install-gnuarm4.sh index ffb509bf..793bdbf5 100755 --- a/tools/install-gnuarm4.sh +++ b/tools/install-gnuarm4.sh @@ -50,7 +50,7 @@ GNU_KEYRING_GPG=gnu-keyring.gpg GNU_KEYRING=ftp://ftp.gnu.org/gnu/${GNU_KEYRING_GPG} # Common configuration options (i.e., things to pass to 'configure') -COMMON_CFG="--enable-interwork --target=arm-eabi --program-prefix=arm-eabi- --prefix=${DESTDIR} --disable-werror --enable-languages=c,c++ --enable-multilib --disable-shared" +COMMON_CFG="--enable-interwork --target=arm-eabi --program-prefix=arm-none-eabi- --prefix=${DESTDIR} --disable-werror --enable-languages=c,c++ --enable-multilib --disable-shared" # Extra configuration options for each toolchain component BINUTILS_CFG= @@ -81,7 +81,7 @@ GPG_OPTS="--keyring ${GNU_KEYRING_GPG} --no-default-keyring --homedir ." # End of configuration section. You shouldn't have to modify anything below. ############################################################################ -if [[ `whoami` != "root" ]]; then +if [[ "$USER" != "root" ]]; then echo "*** Warning! Not running as root!" echo "Installation may fail if you do not have appropriate permissions!" fi @@ -99,68 +99,32 @@ else # Check if signature file exists (otherwise download the signature file as well - if download fail, warn the user and return function) # Check the signature. If failed, backup-by-renaming current files, redownload both file & signature, run the function body one more time - if still no success, warn and return from function - # NOTE: If new downloads are added here, please see the IMPORTANT note below - echo Now downloading BINUTILS... - wget ${WGET_OPTS} ${BINUTILS} - wget -N ${WGET_OPTS} ${BINUTILS}.sig - gpg $GPG_OPTS --verify ${BINUTILS_TAR}.sig 2> /dev/null - if [[ $? != 0 ]]; then - echo "Failed signature check for:" ${BINUTILS_TAR}.sig - exit 1 - fi - - echo Now downloading GCC... - wget ${WGET_OPTS} ${GCCCORE} - wget -N ${WGET_OPTS} ${GCCCORE}.sig - gpg $GPG_OPTS --verify ${GCCCORE_TAR}.sig 2> /dev/null - if [[ $? != 0 ]]; then - echo "Failed signature check for:" ${GCCCORE_TAR}.sig - exit 1 - fi + function download_lib { + echo Now downloading $1 + wget ${WGET_OPTS} $2 + } + + function download_signed_lib { + download_lib $1 $2 + wget -N ${WGET_OPTS} $2.sig + gpg $GPG_OPTS --verify $3.sig 2> /dev/null + if [[ $? != 0 ]]; then + echo "Failed signature check for:" $3.sig + exit 1 + fi + } - echo Now downloading G++... - wget ${WGET_OPTS} ${GPP} - wget -N ${WGET_OPTS} ${GPP}.sig - gpg $GPG_OPTS --verify ${GPP_TAR}.sig 2> /dev/null - if [[ $? != 0 ]]; then - echo "Failed signature check for:" ${GPP_TAR}.sig - exit 1 - fi - - echo Now downloading NEWLIB... - wget ${WGET_OPTS} ${NEWLIB} + # NOTE: If new downloads are added here, please see the IMPORTANT note below + download_signed_lib BINUTILS ${BINUTILS} ${BINUTILS_TAR} || exit 1 + download_signed_lib GCC ${GCCCORE} ${GCCCORE_TAR} || exit 1 + download_signed_lib G++ ${GPP} ${GPP_TAR} || exit 1 + download_lib NEWLIB ${NEWLIB} # TODO: signature/hash check - - echo Now downloading INSIGHT... - wget ${WGET_OPTS} ${INSIGHT} + download_lib INSIGHT ${INSIGHT} # TODO: signature/hash check - - echo Now downloading GDB... - wget ${WGET_OPTS} ${GDB} - wget -N ${WGET_OPTS} ${GDB}.sig - gpg $GPG_OPTS --verify ${GDB_TAR}.sig 2> /dev/null - if [[ $? != 0 ]]; then - echo "Failed signature check for:" ${GDB_TAR}.sig - exit 1 - fi - - echo Now downloading GMP... - wget ${WGET_OPTS} ${GMP} - wget -N ${WGET_OPTS} ${GMP}.sig - gpg $GPG_OPTS --verify ${GMP_TAR}.sig 2> /dev/null - if [[ $? != 0 ]]; then - echo "Failed signature check for:" ${GMP_TAR}.sig - exit 1 - fi - - echo Now downloading MPFR... - wget ${WGET_OPTS} ${MPFR} - wget -N ${WGET_OPTS} ${MPFR}.sig - gpg $GPG_OPTS --verify ${MPFR_TAR}.sig 2> /dev/null - if [[ $? != 0 ]]; then - echo "Failed signature check for:" ${MPFR_TAR}.sig - exit 1 - fi + download_signed_lib GDB ${GDB} ${GDB_TAR} || exit 1 + download_signed_lib GMP ${GMP} ${GMP_TAR} || exit 1 + download_signed_lib MPFR ${MPFR} ${MPFR_TAR} || exit 1 # IMPORTANT: Here is the number of .tar. archives downloaded above. Please update if new .tar. are added to download list. if [[ `ls -1 *.tar.bz2 *.tar.gz | wc -l` != 8 ]]; then @@ -309,5 +273,5 @@ chmod -R a+rX . echo Downloaded archives are in ${SRCDIR} echo build driectory: ${BUILDDIR} -echo set environment variable ARMLIB to ${DESTDIR}/lib/gcc/arm-elf/4.3.3/interwork for Makefile.linux +echo set environment variable ARMLIB to ${DESTDIR}/lib/gcc/arm-eabi/4.3.3/interwork for Makefile.linux exit 0