deblob 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. #!/bin/bash
  2. # DEBLOB script: deblobs the version of coreboot used for this release.
  3. #
  4. # Copyright (C) 2014, 2015, 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 current working directory is the root
  20. # of the libreboot_src/ or git clone.
  21. [ "x${DEBUG+set}" = 'xset' ] && set -v
  22. set -u -e
  23. printf "Deleting blobs in coreboot\n"
  24. if [ ! -d "coreboot/" ]; then
  25. printf "coreboot-libre deblob: no coreboot directory exists, so there is nothing to deblob\n"
  26. fi
  27. for payloads in resources/libreboot/config/*; do
  28. if [ ! -d "${payloads}/" ]; then
  29. continue
  30. fi
  31. payload="${payloads##*/}"
  32. for boards in "${payloads}/"*; do
  33. if [ ! -d "${boards}/" ]; then
  34. continue
  35. fi
  36. board="${boards##*/}"
  37. cbrevision="$(cat "resources/libreboot/config/${payload}/${board}/cbrevision")"
  38. vbrevision="$(cat "resources/libreboot/config/${payload}/${board}/vbootrevision")"
  39. boardpath="coreboot/${cbrevision}/${cbrevision}"
  40. # deblob coreboot
  41. for blob in $(cat "resources/utilities/coreboot-libre/blobs/coreboot/${cbrevision}/blobs.list"); do
  42. rm -f "${boardpath}/${blob}"
  43. done
  44. # deblob 3rdparty
  45. # only non-crossgcc archives have 3rdparty (vboot) present.
  46. if [ "${payload}" != "crossgcc" ]; then
  47. vbootrevision="$(cat "resources/libreboot/config/${payload}/${board}/vbootrevision")"
  48. # deblob 3rdparty
  49. for blob in $(cat "resources/utilities/coreboot-libre/blobs/vboot/${vbootrevision}/blobs.list"); do
  50. rm -f "${boardpath}/${blob}"
  51. done
  52. fi
  53. done
  54. done
  55. # Now also do the same for crossgcc coreboot
  56. for blob in $(cat "resources/utilities/coreboot-libre/blobs/coreboot/crossgcc/blobs.list"); do
  57. rm -f "crossgcc/${blob}"
  58. done
  59. for blob in $(cat "resources/utilities/coreboot-libre/blobs/vboot/crossgcc/blobs.list"); do
  60. rm -f "crossgcc/${blob}"
  61. done
  62. printf "\n\n"