deblob 647 B

12345678910111213141516171819202122
  1. #!/usr/bin/env bash
  2. # SPDX-FileCopyrightText: 2022 Caleb La Grange <thonkpeasant@protonmail.com>
  3. # SPDX-License-Identifier: GPL-3.0-only
  4. board="${1}"
  5. board_config_dir="resources/coreboot/${board}/config"
  6. set -- "${board_config_dir}/*"
  7. . ${1} 2>/dev/null
  8. if [ "${CONFIG_HAVE_MRC}" = "y" ] || [ "${CONFIG_HAVE_ME_BIN}" = "y" ]; then
  9. rm ${board_config_dir}/*_deblobbed
  10. for config in ${board_config_dir}/* ; do
  11. grep -v 'CONFIG_HAVE_ME_BIN\|CONFIG_ME_BIN_PATH\|CONFIG_HAVE_MRC\|CONFIG_MRC_FILE' ${config} > "${config}_deblobbed"
  12. done
  13. ./blobutil download ${board} redistributable
  14. else
  15. # Quickly exits for boards requiring no blobs
  16. exit 2
  17. fi