Commit Graph

102 Commits

Author SHA1 Message Date
Ethan Yonker
9eb1cd4752 Fix USB Mass Storage on some devices
On some devices we need to set the sys.storage.ums_enabled
property before we write to the lun file. Also sleep for a bit
after setting the propery before writing to the lun file.

Change-Id: I77ac853fde14ffc3adf20571c132f91ed85196df
2014-11-04 15:40:05 +01:00
that
39b7c16d28 add "done" after "Updating partition details..."
This addresses a usability problem. Some users are confused when they
switch to the console and see this message, thinking they have to wait.

Examples:
http://forum.xda-developers.com/showthread.php?t=2498492
http://androidforums.com/verizon-galaxy-s3-all-things-root/718376-twrp-recovery-update-question.html

Change-Id: Ib44773998c2ef1b8b821f3b8876218e11a7de357
2014-11-04 15:35:16 +01:00
that
78d0c5fc25 partitionmanager: remove unused By_Block and By_Name methods
Change-Id: Ia6eefd23f6671428221e35642f01534bc9fff6ad
2014-11-04 15:29:06 +01:00
Tom Hite
5a9267283c performance profile support
Many device trees support the recovery.perf.mode property to
set various core frequencies and online/offline mode. TWRP is
highly threaded, and support for multiple cores on many operations
dramatically recudes the time, e.g., backups, zip flashes, etc.

p2: removed user notifications

Change-Id: I957b8ca40b241c0af0471327eeb329cce1816017
2014-10-08 19:35:32 +02:00
that
9e0593eaf6 mtp: cleanup, fixes and performance improvements
- use std::map instead of linked list
- read directories on demand
- fix writing zip files to storage root
- fix creating directories
- lots of minor fixes
- simplify generation of storage IDs and make them spec compliant

Change-Id: I2137c27549ddbdc58466f2e3aeda464fac70a3c5
2014-10-08 18:34:39 +02:00
Ethan Yonker
6277c79727 Attempt to automatically identify data/media devices
Change-Id: Ia3007fbced9ce3bc94efdb3dacc582a5e68a49a4
2014-09-19 22:34:09 -05:00
Ethan Yonker
1eff6cd5d1 Additional checks to prevent partitioning internal storage
Change-Id: I9fcd7e0169fbdd52405c0c86aafbef091f69411e
2014-09-15 13:30:42 -05:00
Ethan Yonker
8613dc0278 Fix handling of MTP fork/child process
Change-Id: Iacd8a38d21e9c8b0dfafefbeb646f46cd3ba02a1
2014-09-11 09:28:20 -05:00
Ethan Yonker
8dfa77780f MTP: Use fork instead of pthread
Change-Id: I95cf6f4def0c86f40c775738f0712323f0a0f146
2014-09-04 21:59:20 -05:00
Ethan Yonker
6d154c4fe2 Allow toggle of MTP debug
Via command line in TWRP:
twrp set tw_mtp_debug 1

This will enable debugging for MTP. You will need to disable and
re-enable MTP in order to see the debug logging.

Change-Id: Ia7bb0c584e10a4322b65ecf80a67ed7ee836b38e
2014-09-03 14:22:50 -05:00
bigbiff bigbiff
c7eee6fef0 add mtp responder to TWRP.
Big thanks to Dees_Troy for helping with the implementation.

Change-Id: I6c9c522b9c9de5dc139e2ecb0141008182ba07f0
2014-09-02 21:44:49 -04: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
Ethan Yonker
bf2cb1c4d8 Color in the console
Allow each gui_print command to specify a color
Change LOGERR to use the error color
Theme should specify colors for error, warning, and highlight

Change-Id: Ie8ece34111f604e25fcb79e5b731cd4e61038ff9
2014-07-09 15:46:35 +02:00
Matt Mower
fb1c4ffaaf Whitespace and minor code cleanup
This is by no means comprehensive, but is quite a bit better already.

Change-Id: Ibc8654a5dfb0eec39cbd0b64bdb52bb4fbfe2f7e
2014-06-04 09:13:37 -05:00
Ethan Yonker
87c7bac9c9 Add options to repair or change file system
Change-Id: I9043e98e1e1ed4722f05c13a60b43d2d0bf739f6
2014-06-04 15:46:32 +02:00
Vojtech Bocek
93cb1ef2eb Fix crash while loading config due to incorrect tw_storage_path
Change-Id: Ia5957efe616defa4272501cd8f31d26d394077bb
Signed-off-by: Vojtech Bocek <vbocek@gmail.com>
2014-05-31 14:26:12 +02:00
Matt Mower
ee71706ad1 Fix multiple lun file USB mounting
Both the incorrect mount point and the incorrect lun file were being
passed as the second storage volume.

Change-Id: If9c7d92d1992ec022a2c89a82b2ea05c9150d635
2014-05-31 14:23:51 +02:00
Matt Mower
ed71fa3e82 Only setup settings,andsec partitions if available
Change-Id: Iafedcec9e6ba368e29e32ab7a92d774cdd3f64e1
2014-04-16 21:58:07 +02:00
Matt Mower
bf4efa39e4 Support alternative .android_secure location
Some devices (jewel, m8) have .android_secure at a non-standard
location. Allow a different partition to be specified as the home of
.android_secure using the fstab flag 'andsec'.

Using the /data/media variant of jewel as an example, recovery.fstab or
twrp.fstab could be edited like follows:

/external_sd  vfat  /dev/block/mmcblk1p1  flags=display="MicroSD";andsec

Note, this is NOT a method to move .android_secure in your ROM. Your ROM
must already write to this alternative location.

Change-Id: I3a6e4e63aaddb35870b79e80938b0f9c2c902443
2014-04-16 17:30:26 +02:00
Dees Troy
e65e35cc37 Merge "Fix display of .android_secure size in Backup" into android-4.4 2014-04-02 16:05:02 +02:00
Ethan Yonker
74a149bfcb Merge changes Ia75c34ab,I5743d9b9 into android-4.4
* changes:
  Support Qualcomm overlay graphics in recovery
  Improve USB Storage handling
2014-04-02 16:04:02 +02:00
Matt Mower
ed426904e6 Fix display of .android_secure size in Backup
Setup_Settings_Storage_Partition() needs to be called before
Update_System_Details() in order for the /and-sec mount point to be
setup and size read correctly.

Change-Id: Id5394c90b6d095027c1b852764676dc6080a871d
2014-04-02 00:28:30 -05:00
Ethan Yonker
47360be11c Improve USB Storage handling
Change-Id: I5743d9b967a8227c4bb87da01a9c67c574bf9876
2014-04-01 10:43:59 -05:00
bigbiff bigbiff
0733881369 if md5 check is not selected for subpartitions, don't check it.
Change-Id: I7248c75f17c6f82e098831c297c0662ef6ea289f
2014-03-30 14:56:41 -04:00
Dees Troy
02a6453b75 Re-arrange handling of settings storage partition
Sometimes we received an error about being unable to locate
storage partition because the DataManager would attempt to access
the PartitionManager before we finished adding the storage
partitions to the vector.

Change-Id: I0ce1778938d308b1eb17de46a192ecd52489cad3
2014-03-19 15:24:01 +00:00
Ethan Yonker
c05c598b73 Improve handling of settings storage and android secure
Change-Id: I8af92543c2f0c201e7220267c417d74e4561038d
2014-03-13 09:19:56 -05:00
Dees Troy
4159aedfaa Restore capabilities to run-as binary
Change-Id: I9e2b8e9b69c94b94c57143c04b950530490ec33e
2014-02-28 17:59:04 +00:00
Ethan Yonker
71413f4ee9 Check crypto footer before offering to decrypt
Verify that we have a valid footer with proper magic before
setting things up for decryption to help prevent user confusion
when dealing with data partitions that fail to mount. Also check
to make sure that the block device for /data is present.

Change-Id: Ie87818fe4505a8bf71df7d3934c114e7328ef3ca
2014-02-26 13:37:35 -06:00
bigbiff bigbiff
f08ada8483 Allow recovery to be restored if backup=1 flag is present in recovery.fstab
Change-Id: I426c8da8ae586004011ec4a103e1d7a1f23b3599
2014-02-12 17:30:51 +01:00
Ethan Yonker
d4d107388c Improve android secure handling
Change-Id: I9e1c7f4a8353b7be51e1a54bf5d506c9dce70da2
2014-02-03 15:27:52 -06:00
Dees Troy
6f6441da58 Fix include of cutils
Change-Id: I9868298908ce501d3043326862057e8a637544af
2014-01-23 02:07:03 +00:00
Dees Troy
a6a26429f6 Merge changes I4c369222,I8a8ad4b3 into android-4.4
* changes:
  Enable UMS mounting of storage drives
  Set listener properties for UMS mount/unmount
2014-01-21 15:58:42 +01:00
Dees Troy
98fb46c6e2 Fix handling of storage after decryption
Change-Id: I0c2614f841a225699be9d4a52c60e9456241659b
2014-01-21 15:39:45 +01:00
Matt Mower
d9cb90660a Set listener properties for UMS mount/unmount
Some kernels require the usb functions be defined before UMS mounting
of storage partitions will work. This sets the sys.storage.ums_enabled
property upon mount/unmount which can be listened for in init.rc.

Example routines to include in init.rc:

on property:sys.storage.ums_enabled=1
    write /sys/class/android_usb/android0/enable 0
    write /sys/class/android_usb/android0/functions adb,mass_storage
    write /sys/class/android_usb/android0/enable 1

on property:sys.storage.ums_enabled=0
    write /sys/class/android_usb/android0/enable 0
    write /sys/class/android_usb/android0/functions adb
    write /sys/class/android_usb/android0/enable ${service.adb.root}

Change-Id: I8a8ad4b392abbaa173d402714bcb4049ba84ccca
2014-01-20 20:13:48 -05: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
Hashcode
62bd9e04c7 add support for fsflags= option in twrp.fstab file
example userdata line (as needed by MotoX):
/data         f2fs      /dev/block/platform/msm_sdcc.1/by-name/userdata       flags=fsflags="inline_xattr"

Code for parsing flags/options originally based on AOSP fs_mgr sources.

Change-Id: I5fb2b5d5cdd08137e6bf71f0085a3f8aebd889a8
2013-12-19 17:04:02 +00:00
Dees Troy
3be70a897e Update licenses to all match 2013-10-22 14:25:12 +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
Vojtech Bocek
05534209f1 Add TWFunc::Exec_Cmd() with no 'result' agrument
Signed-off-by: Vojtech Bocek <vbocek@gmail.com>

Change-Id: Id8acff1ac9b3c7e4b562c80562a8ff42a1d132b9
2013-09-12 15:36:40 +00:00
Dees Troy
b21cc64ca8 Pull ROM info from build.prop for backup names
Change-Id: I7847fca22b5d4f0a35da41625b15bd677a1e9768
2013-09-12 09:11:13 -05:00
Hashcode
dabfd49bd4 implement "usermrf" fstab flag to force rm -rf * deletion on specific partitions
Change-Id: I58f4a8cedf31e6b6efd88f96a43ed525603ae311
2013-08-30 10:28:15 -07: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
066eb30abf Fix AOSP decrypt when TouchWiz code is present 2013-08-23 17:22:37 +00: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
d93bda5916 2.6.0.0
Also copy recovery.fstab to cache and create a storage.fstab in
cache for app/apk use.
2013-07-03 19:55:35 +00:00
Dees_Troy
59df9264e3 Fix backup of datadata
Change-Id: Ib0098542599283787592ba08caa070dc818d6111
2013-07-01 20:48:43 +00:00
Dees_Troy
74fb2e94d5 Fix some issues with wipe partition list
Change-Id: Ie7d5878faf86b8fa824b72211be7fd3596b471d7
2013-07-01 20:20:58 +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
9e0b71c6ad Improve backup list results 2013-04-08 13:35:37 +00:00
Dees_Troy
91862e618e Fix handling of subpartitions 2013-04-04 23:48:21 +00:00