diff options
author | Sebastiano Barezzi <barezzisebastiano@gmail.com> | 2021-01-17 02:26:08 +0100 |
---|---|---|
committer | Sebastiano Barezzi <barezzisebastiano@gmail.com> | 2021-02-23 18:12:01 +0100 |
commit | 7f0c788e9cc23800dffd6a021cfbd3504d45d4ce (patch) | |
tree | 67d5ba590e1292b916b0bfb2f1d9b18dcab0de60 | |
parent | 55ec88693338bb47f95368ee870e972be7cde0ff (diff) |
extract_utils: Implement versioned patchelf and patchelf 0.8
* Result of patchelf v0.9:
E dlopen failed: "/vendor/lib64/libvendor.goodix.hardware.fingerprint@1.0-service.so" loaded phdr 0x70d4cd6000 not in loadable segment
* While searching up this issue, I found a LineageOS Gerrit change (Ibeb09b6ec37ef62b6a5abe40bae1e8bd8d92e7af) with the same error
* Hamsi2k mentioned in the change that patchelf v0.8 is needed to fix the issue
* Building patchelf v0.8 and trying to patch the blobs works
* Implement versioned patchelf logic, allowing the script to both select the default patchelf and a specific patchelf version only for some files
* Leave 0.9 as the default version to not change the default behaviour
Change-Id: I6c0cbe76baf241233fdd125f5ed1eccbd5855124
-rw-r--r-- | extract_utils.sh | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/extract_utils.sh b/extract_utils.sh index b531d4d..53d926f 100644 --- a/extract_utils.sh +++ b/extract_utils.sh @@ -94,8 +94,19 @@ function setup_vendor() { VENDOR_RADIO_STATE=0 fi + export BINARIES_LOCATION="$ANDROID_ROOT"/prebuilts/extract-tools/${HOST}-x86/bin + + for version in 0_8 0_9; do + export PATCHELF_${version}="$BINARIES_LOCATION"/patchelf-"${version}" + done + + if [ -z "$PATCHELF_VERSION" ]; then + export PATCHELF_VERSION=0_9 + fi + if [ -z "$PATCHELF" ]; then - export PATCHELF="$ANDROID_ROOT"/prebuilts/extract-tools/${HOST}-x86/bin/patchelf + local patchelf_variable="PATCHELF_${PATCHELF_VERSION}" + export PATCHELF=${!patchelf_variable} fi } |