crossgcc 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. #!/bin/bash
  2. # helper script: downloads crossgcc, for building coreboot
  3. #
  4. # Copyright (C) 2016 Leah Rowe <info@minifree.org>
  5. #
  6. # This program is free software: you can redistribute it and/or modify
  7. # it under the terms of the GNU General Public License as published by
  8. # the Free Software Foundation, either version 3 of the License, or
  9. # (at your option) any later version.
  10. #
  11. # This program is distributed in the hope that it will be useful,
  12. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. # GNU General Public License for more details.
  15. #
  16. # You should have received a copy of the GNU General Public License
  17. # along with this program. If not, see <http://www.gnu.org/licenses/>.
  18. #
  19. # This script assumes that the working directory is the
  20. # root of libreboot_src or libreboot git.
  21. [ "x${DEBUG+set}" = 'xset' ] && set -v
  22. set -u -e
  23. if [ -f "version" ]; then
  24. # _src release archive is being used
  25. version="libreboot-$(cat version)"
  26. else
  27. # git repo is being used
  28. version="libreboot-$(git describe --tags HEAD)"
  29. fi
  30. # coreboot revisios used for crossgcc
  31. crossgccrevision="35562d8b6477058e6bca31b5cedd9d4897124fc7"
  32. vbootrevision="d187cd3fc792f8bcefbee4587c83eafbd08441fc"
  33. rm -Rf "crossgcc/"
  34. (
  35. git clone https://review.coreboot.org/coreboot crossgcc || git clone https://github.com/coreboot/coreboot.git crossgcc
  36. cd "crossgcc/"
  37. git reset --hard ${crossgccrevision}
  38. git submodule update --init --checkout -- 3rdparty/vboot/
  39. (
  40. cd 3rdparty/vboot/
  41. git reset --hard ${vbootrevision}
  42. )
  43. # workaround to fix the error on debian stretch and later, when building
  44. # GMP. If -pie is enabled in GCC, then --with-pic must be used when compiling
  45. git am ../resources/libreboot/patch/crossgcc/gccfix.diff
  46. rm -Rf .git* */*/.git*
  47. )
  48. printf "Deblobbing coreboot\n"
  49. ./resources/utilities/coreboot-libre/deblob