Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't extract files from a backup to a relative path, using the built-in tar #1628

Open
mmortal03 opened this issue Aug 26, 2022 · 0 comments

Comments

@mmortal03
Copy link

mmortal03 commented Aug 26, 2022

  • [ X] I am running an official build of TWRP, downloaded from https://twrp.me/Devices/
  • [ X] I am running the latest version of TWRP
  • [ X] I have read the FAQ (https://twrp.me/FAQ/)
  • [ X] I have searched for my issue and it does not already exist

Device codename: hima
TWRP version: twrp-3.6.2_9-0-hima.img

WHAT IS THE EXPECTED RESULT?

Extracting files from a backup to a relative path, using the built-in tar in TWRP, should be possible.

WHAT STEPS WILL REPRODUCE THE PROBLEM?

Extracting files from a backup to a relative path, using the built-in tar in TWRP, isn't working.

To be clear, I'm using the tar that is included in twrp-3.6.2_9-0-hima.img from an adb shell in recovery.
(tangential, but tar --version reports toybox 0.7.4, but it'd make more sense for the TWRP devs to modify this version information if it includes extensions that are not identical to toybox 0.7.4 tar)

Here's an example:

tar -tvf system.ext4.win002 | grep system/vendor/lib64/libmdmdetect.so

-rw-r--r-- root/root 18344 2017-04-05 05:53:31 /system/vendor/lib64/libmdmdetect.so

tar -xvf system.ext4.win002 system/vendor/lib64/libmdmdetect.so

tar: 'system/vendor/lib64/libmdmdetect.so' not in archive

If I add the leading '/':

tar -xvf system.ext4.win002 /system/vendor/lib64/libmdmdetect.so

it will extract the file to the absolute path.

If I add the leading '/' and append -C new_directory to the end of the command:

tar -xvf system.ext4.win002 /system/vendor/lib64/libmdmdetect.so -C new_directory

it will ignore the appended argument pointing to the new_directory, and will still extract the file to the absolute path.

If I cd to the new_directory and run:

tar -xvf ../system.ext4.win002 /system/vendor/lib64/libmdmdetect.so

it will still extract the file to the absolute path.

@mmortal03 mmortal03 changed the title Can't extract files from a backup image to a relative path, using the built-in tar in TWRP Can't extract files from a backup to a relative path, using the built-in tar in TWRP Aug 26, 2022
@mmortal03 mmortal03 changed the title Can't extract files from a backup to a relative path, using the built-in tar in TWRP Can't extract files from a backup to a relative path, using the built-in tar Aug 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant