deblob 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. #!/usr/bin/env 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. for payloads in resources/libreboot/config/*; do
  25. if [ ! -d "${payloads}/" ]; then
  26. continue
  27. fi
  28. payload="${payloads##*/}"
  29. for boards in "${payloads}/"*; do
  30. if [ ! -d "${boards}/" ]; then
  31. continue
  32. fi
  33. board="${boards##*/}"
  34. cbrevision="$(cat "resources/libreboot/config/${payload}/${board}/cbrevision")"
  35. vbrevision="$(cat "resources/libreboot/config/${payload}/${board}/vbootrevision")"
  36. boardpath="coreboot/${cbrevision}/${cbrevision}"
  37. # deblob coreboot
  38. for blob in $(cat "resources/utilities/coreboot-libre/blobs/coreboot/${cbrevision}/blobs.list"); do
  39. rm -f "${boardpath}/${blob}"
  40. done
  41. # deblob 3rdparty
  42. # only non-crossgcc archives have 3rdparty (vboot) present.
  43. if [ "${payload}" != "crossgcc" ]; then
  44. vbootrevision="$(cat "resources/libreboot/config/${payload}/${board}/vbootrevision")"
  45. # deblob 3rdparty
  46. for blob in $(cat "resources/utilities/coreboot-libre/blobs/vboot/${vbootrevision}/blobs.list"); do
  47. rm -f "${boardpath}/${blob}"
  48. done
  49. fi
  50. done
  51. done
  52. # Now also do the same for crossgcc coreboot
  53. for blob in $(cat "resources/utilities/coreboot-libre/blobs/coreboot/crossgcc/blobs.list"); do
  54. rm -f "crossgcc/${blob}"
  55. done
  56. for blob in $(cat "resources/utilities/coreboot-libre/blobs/vboot/crossgcc/blobs.list"); do
  57. rm -f "crossgcc/${blob}"
  58. done
  59. printf "\n\n"