Commit Graph

40 Commits

Author SHA1 Message Date
Ethan Yonker
960f030b41 Fix twrpTar building
- ifdef around set_metadata
- Set tags as optional

Change-Id: I438e370c3bf6b590dc80ba372724c47cead6cbe5
2014-12-22 04:55:24 +01:00
Ethan Yonker
4b94cfd391 Attempt to set the proper uid/gid/contexts on new files and dirs
Files and folders that we create during backups, copy log, or MTP
operations often do not have the proper uid/gid/contexts assigned.
We will attempt to read the proper contexts from the settings
storage path and assign those same contexts to any files or dirs
that we create.

Change-Id: I769f9479854122b49b499de2175e6e2d026f8afd
2014-12-12 09:20:42 -06:00
Ethan Yonker
bcc502cff9 Make TWRP compile for arm64
-Remove dosfstools for arm64 until we can make it compile
-Fix TW_USE_TOOLBOX flag to work again
-Fix symlinking and handling of sh when using mksh
-Fix legacy properties to find futex_wake function
-Fix libcrecovery to not use bsd_signal anymore
-Fix rules for building with regards to libcrecovery
-Update toolbox_recovery rules to compile tools in lollipop
-Fix a few compile errors specific to arm64

Testers report that TWRP does not boot on Nexus 9 and we fail to
get a shell for adb shell. At least it compiles without errors.

Change-Id: I286be8628defb60cc527b8a548c0bdfcb0ebb574
2014-11-12 11:03:50 -06:00
Ethan Yonker
1b7a31bd65 Track backup and restore progress
Track backup and restore progress based on the sizes of the files
as they are being added to the tar backup file. Update the
progress bar based on the sizes of the files.

Change-Id: Idf649efa1db3e91830b4b2add86203a3f30042ff
2014-07-09 08:52:18 -05:00
Matt Mower
50248ab86b Simplify twrpTar skip dir checks, DU code cleanup
* Remove unused parent variable from twruDU constructor

* Replace manual checks for /data/media with DU's check_skip_dirs()
  function

* Remove check_skip_dirs(A,B) function which duplicates the
  functionality of check_skip_dirs(A)

* Remove redundant trailing slash removal from
  check_absolute_skip_dirs(); this function is only accessed through
  check_skip_dirs()

Change-Id: Icfe8d71de36e33db6749fc5896dd3eafbcf7c9a4
2014-04-15 15:28:45 +02:00
Dees Troy
b1c6e05217 Only split archives when split_archives is set
In some cases, statfs used on partitions like /system does not
report a size that would trigger a split archive, but using stat
on the individual files shows a larger size that statfs that
would trigger a split. This patch prevents us from trying to split
an archive unless we explicitly decided to split in advance.

Change-Id: I67f5cd343f12333e1189100cf0ec1c20c15b7cc2
2014-04-07 18:03:34 +00:00
Dees Troy
9d72327cfc Rearrange opening of output and input files for error handling
If the file could not be opened, the process would log an error
to the log file but the GUI would report success. Rearrange the
process so that the GUI shows an error.

Change-Id: I96af0b934c8f6f463d56656647b16accd1d40654
2014-04-07 17:16:10 +00:00
Ethan Yonker
924a80b7b3 Fix backup and restore of encrypted backups
After removing the DataManager code to support twrpTar separate
binary we were failing to pass / set the password for the various
separate threads used for openaes.

Change-Id: Ifff634777fe122e0195d84f67932177ca8879c2f
2014-04-02 10:54:18 -05:00
Matt Mower
bb81e5d02d Remove deprecated tar exclude functionality
twrpDU::check_skip_dirs() handles skipped folders now. Everywhere
twrpTar::setexcl() is being used to exclude files eventually calls
createTarFork(), which in turn calls Generate_TarList(), which checks
check_skip_dirs().

Change-Id: Ibbc4eb2eb89863ccb2a15f5a3b5092fb10fcbcc0
2014-03-31 16:10:28 -05:00
bigbiff bigbiff
ec8fc28866 Change to lstat so we don't count the target of symbolic links as part
of the tar archive size. Big thanks to Tassadar for pointing out the
fix.

Change-Id: I8894ffef54c93939b5b455634169d9c14d8ed7af
2014-03-16 20:32:50 -04:00
Vojtech Bocek
05f87d6cca Fix skipping of relative paths and lost+found in twrpDU
Change-Id: Ib79029fd6237502338b041a6bc2f9e539536d6ad
Signed-off-by: Vojtech Bocek <vbocek@gmail.com>
2014-03-13 14:55:12 +01:00
Ethan Yonker
eae4209443 Fix error handling in createList
Change-Id: I10211f2a20da119ae6a4a1bb2f768a3fa2ab87da
2014-03-07 15:33:13 -06:00
Ethan Yonker
a869eddeb9 Remove unused functions
Change-Id: I3230412e6aad7aab0f2fd034cc7b289cd4cd6a97
2014-02-12 15:12:06 +00:00
Ethan Yonker
87af56369b Move DataManager functions out of twrpTar.cpp
Change-Id: I943318afe787ff4ede724fa0bc77ebc6a3ba0c8b
2014-02-10 11:56:35 -06:00
Dees Troy
e0a433a94d Refactor twrpTar to use TarList
Eliminate the use of tarDirs and Generate_MultipleArcives in
favor of Generate_TarList so that we have one method for backup
creation instead of three.

Change-Id: I267937b6e40b32d43fbac8b4cca82f7468d4f94c
2014-02-03 19:13:26 +01:00
Dees Troy
42f40f5c1e declare dir for non data/media devices
Change-Id: I60e2e2a880c3bd5fff3f485f7c8e4ac9ab6fd3bd
2013-12-20 05:08:36 +00:00
bigbiff bigbiff
34684ff313 Create a TWRP Disk Usage Class to retain state about a directory and whether we should skip it in other classes like twrpTar.
Moved Get_Folder_Size to this new class.

Change-Id: If0a0220f900eb109581f2eeaf7b76e3f7d6886f1
2013-12-19 18:02:44 +00:00
bigbiff bigbiff
c49d706903 fix getting and setting contexts in selinux
recreate lost+found with selinux contexts

Change-Id: I19e8696d47319dfb641520956c8a27c2a796a0c3
2013-10-17 16:49:49 +00:00
Dees Troy
ed40077534 Ensure root folders get added in split archives
Make sure that we add the root folder itself to get the perms and
SELinux contexts before splitting to a second archive.

Change-Id: Id93a9f9b4767b61bba38eb0cf7306c81a8540a3c
2013-10-17 11:42:05 -05:00
Vojtech Bocek
25fd68d098 libtar: store SELinux file context in tar archives
* Using RedHat's "RHT.security.selinux=" tag in extended
  tar header (type 'x')

Signed-off-by: Vojtech Bocek <vbocek@gmail.com>

Change-Id: I102e492e4fa5b8a08fae4d34eb36386862509b4d
2013-09-05 21:43:52 +02:00
bigbiff bigbiff
86e77bcbb2 skip checking size on links
skip google music cache

Change-Id: I75d6fd0e17140d12cb2c6d335e8ff73a6f871aa2
2013-08-28 16:10:36 +00:00
bigbiff bigbiff
616afed985 ignore lost+found in all the places 2013-08-28 15:06:18 +00:00
Vojtech Bocek
fafb0c541b Unify indentation and little clean-up in TWRP files
Signed-off-by: Vojtech Bocek <vbocek@gmail.com>
2013-08-24 07:56:48 -05:00
Dees_Troy
2727b99f55 Fix problem with not waiting for pigz to exit
In some cases compressed backups would not wait for pigz to finish
leading to backup files that were 0 bytes or MD5 mismatches.
2013-08-14 20:09:34 +00:00
Dees_Troy
5612cc847f Fix permissions on backup files 2013-07-24 19:45:58 +00:00
Dees_Troy
59df9264e3 Fix backup of datadata
Change-Id: Ib0098542599283787592ba08caa070dc818d6111
2013-07-01 20:48:43 +00:00
Dees_Troy
83bd483f3d Support encrypted backup files
Also includes features merged from:

Update twrpTar by kokotas

Revised function entryExists().
Added function to get archive's uncompressed size.
Added option to exclude item(s) from the archive.
Revised forks()

http://review.teamw.in/#/c/590/

Change-Id: I01fa2c81643161984eff2625247af75990684bd9
2013-06-22 16:16:55 -05:00
Dees_Troy
2673cec07a Move all AOSP code out of recovery binary
Improves license compatibility between GPL and Apache

Change-Id: I2b165aa575bb6213af6b07936f99610c113443f0
2013-04-04 18:57:34 +00:00
n0d3
3b51163329 Add search function to libtar
Function entryExists() can be called in order
 to check if an entry exists inside an archive.

Change-Id: Id3d13d20dfb74a1779dbd8ba6f0ab08c3ca46319
2013-03-18 17:37:28 +00:00
Dees_Troy
3263e9260c Fix backup of initial directory with split archives
Change-Id: Icbb3be817b8a8fe693f6ee015152f780c40b3f7a
2013-03-16 09:03:53 -05:00
Dees_Troy
50d63be580 Fix capturing exit status to properly display libtar results
Error conditions were always showing successful in the TWRP GUI
making it much more difficult to determine if a backup or restore
was actually successful.
2013-03-02 08:49:37 -06:00
Dees_Troy
ee6632c3e1 libtar - Fix extraction of hardlinks to use the prefix
Change-Id: I116982ceed722364406b99fb08bc6943afa0390a
2013-02-27 18:19:18 +00:00
bigbiff bigbiff
71e5aa4eee fix restore on mknod
Change-Id: I9fb8b927f81a8cded651e42026beb3d5c252d1e8
2013-02-27 12:55:40 -05:00
bigbiff bigbiff
23aa819192 using __popen segfaults, switch back to popen 2013-02-22 10:43:59 -05:00
bigbiff bigbiff
e6594ab9a3 change libtar to fork instead of pthread
Conflicts:

	twrpTar.cpp
2013-02-17 20:18:31 -05:00
bigbiff bigbiff
8a68c31ffc This adds a 60 second screen timeout for TWRP. Might consider making this configurable in the future.
Will also set overlay to lockscreen so we don't have inadvetent screen selections.
Touching the screen will bring the display back up.
add back check script for poweroff
move diff time function to twrp-functions.cpp
make sure we chmod after copy_file
add read_file and write_file functions to twrp-functions.cpp
make single thread
try to force update screen
add forceRender
drop caches after tar processing

Change-Id: I3c5c509dd39dbb05451bbfe5d8b56d53c90d8d1b
2013-02-13 13:16:03 -06:00
Dees_Troy
40bbcf8ced Change popen in twrpTar to __popen
Change-Id: I921b0647b1f63dd348b059eb630ebe9bf5ec570d
2013-02-12 15:01:58 +00:00
Dees_Troy
e34c133ec6 Add write buffer for tar writes
update fuse to 2.9.2

catch return from unlink so that we don't print error messages when things work
Change-Id: I1115039a0fa5d9d73f78ef1abd79755d7ffd9d96
2013-02-07 08:21:17 -05:00
bigbiff bigbiff
3bf2b0e630 change tar create to pthread
Change-Id: I5a33d207ec6683de20da37e6f4f174c67785fc52
2013-01-24 19:44:11 +00:00
bigbiff bigbiff
9c754053b0 Add libtar to TWRP instead of using busybox tar
Add proper mkdosfs tool
Add fuse to TWRP
Add experimental exfat-fuse to TWRP
Convert all system() functions to use new Exec_Cmd function
2013-01-09 09:09:08 -05:00