wipe-sysroot 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. #! /bin/sh
  2. # Wipe out all of the sysroots and all of the stamps that populated it.
  3. # Author: Ross Burton <ross.burton@intel.com>
  4. #
  5. # Copyright (c) 2012 Intel Corporation
  6. #
  7. # This program is free software; you can redistribute it and/or modify
  8. # it under the terms of the GNU General Public License version 2 as
  9. # published by the Free Software Foundation.
  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.
  14. # See the 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, write to the Free Software
  18. # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  19. set -e
  20. if [ $# -gt 0 ]; then
  21. echo "Wipe all sysroots and sysroot-related stamps for the current build directory." >&2
  22. echo "Usage: $0" >&2
  23. exit 1
  24. fi
  25. ENVS=`mktemp --suffix -wipe-sysroot-envs`
  26. bitbake -p -e > $ENVS
  27. eval `grep -F SSTATE_MANIFESTS= $ENVS`
  28. eval `grep -F STAGING_DIR= $ENVS`
  29. eval `grep -F STAMPS_DIR= $ENVS`
  30. rm -f $ENVS
  31. if [ -z "$SSTATE_MANIFESTS" -o -z "$STAGING_DIR" -o -z "$STAMPS_DIR" ]; then
  32. echo "Could not determine SSTATE_MANIFESTS/STAGING_DIR/STAMPS_DIR from bitbake, check above for errors"
  33. exit 1
  34. fi
  35. echo "Deleting the sysroots in $STAGING_DIR, and selected stamps in $SSTATE_MANIFESTS and $STAMPS_DIR."
  36. # The sysroots themselves
  37. rm -rf $STAGING_DIR
  38. # The stamps that said the sysroot was populated
  39. rm -rf $STAMPS_DIR/*/*/*.do_populate_sysroot.*
  40. rm -rf $STAMPS_DIR/*/*/*.do_populate_sysroot_setscene.*
  41. rm -rf $STAMPS_DIR/*/*/*.do_packagedata.*
  42. rm -rf $STAMPS_DIR/*/*/*.do_packagedata_setscene.*
  43. # The sstate manifests
  44. rm -rf $SSTATE_MANIFESTS/manifest-*.populate-sysroot