No Description

extract-files.sh 1.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. #!/bin/bash
  2. #
  3. # Copyright (C) 2017 The LineageOS Project
  4. #
  5. # Licensed under the Apache License, Version 2.0 (the "License");
  6. # you may not use this file except in compliance with the License.
  7. # You may obtain a copy of the License at
  8. #
  9. # http://www.apache.org/licenses/LICENSE-2.0
  10. #
  11. # Unless required by applicable law or agreed to in writing, software
  12. # distributed under the License is distributed on an "AS IS" BASIS,
  13. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14. # See the License for the specific language governing permissions and
  15. # limitations under the License.
  16. #
  17. set -e
  18. DEVICE=tulip
  19. VENDOR=zte
  20. # Load extractutils and do some sanity checks
  21. MY_DIR="${BASH_SOURCE%/*}"
  22. if [[ ! -d "$MY_DIR" ]]; then MY_DIR="$PWD"; fi
  23. CM_ROOT="$MY_DIR"/../../..
  24. HELPER="$CM_ROOT"/vendor/lineage/build/tools/extract_utils.sh
  25. if [ ! -f "$HELPER" ]; then
  26. echo "Unable to find helper script at $HELPER"
  27. exit 1
  28. fi
  29. . "$HELPER"
  30. if [ $# -eq 0 ]; then
  31. SRC=adb
  32. else
  33. if [ $# -eq 1 ]; then
  34. SRC=$1
  35. else
  36. echo "$0: bad number of arguments"
  37. echo ""
  38. echo "usage: $0 [PATH_TO_EXPANDED_ROM]"
  39. echo ""
  40. echo "If PATH_TO_EXPANDED_ROM is not specified, blobs will be extracted from"
  41. echo "the device using adb pull."
  42. exit 1
  43. fi
  44. fi
  45. # Initialize the helper
  46. setup_vendor "$DEVICE" "$VENDOR" "$CM_ROOT"
  47. extract "$MY_DIR"/proprietary-files.txt "$SRC"
  48. # qseecomd linkage for recovery
  49. RECOVERY_QSEECOMD="$CM_ROOT/vendor/$VENDOR/$DEVICE/proprietary/recovery/root/sbin/qseecomd"
  50. if [ -f "$RECOVERY_QSEECOMD" ]; then
  51. sed 's@/system/bin/linker64@/sbin/linker64\x0\x0\x0\x0\x0\x0@' \
  52. < "$RECOVERY_QSEECOMD" \
  53. > "$RECOVERY_QSEECOMD.tmp"
  54. mv "$RECOVERY_QSEECOMD.tmp" "$RECOVERY_QSEECOMD"
  55. fi
  56. "$MY_DIR"/setup-makefiles.sh