summaryrefslogtreecommitdiffstats
path: root/partitions.hpp (unfollow)
Commit message (Collapse)AuthorFilesLines
2016-01-29Replace fix permissions with fix contexts for emulated storageEthan Yonker1-1/+1
Fix permissions rarely fixed anything on more recent versions of Android and usually made things worse. Instead we will replace it with a more dumbed down option that should fix contexts on /data/media with a few improvements to ensure that contexts get fixed for multiple users and on adopted storage. Change-Id: If5523781936a0b04196e2ad871cae767ebae2583
2016-01-25Adopted Storage supportEthan Yonker1-1/+7
-Detects, decrypts, and mounts an adopted SD card if a secondary block device is defined (usually mmcblk1) -Handles unified storage -Displays the adopted storage in MTP along with internal -Factory Reset - wiped just like a data media device, we retain the keys folder and the storage.xml during a factory reset -Backup / Restore -Disable mass storage when adopted storage is present -Read storage nickname from storage.xml and apply it to display names in the GUI -Read storage.xml and determine what storage location is in use for /sdcard and remap accordingly libgpt_twrp is source code mostly kanged from an efimanager project. It is GPL v2 or higher, so we will opt for GPL v3. Change-Id: Ieda0030bec5155ba8d2b9167dc0016cebbf39d55
2016-01-04partitions.hpp: some formattingAndreas Blaesius1-4/+4
tabs > spaces for line-comments to be consistent Change-Id: I4e859fab61c54a5ae86e719a656398a085cfd7fb
2015-12-19Use ioctl to get block device sizeEthan Yonker1-0/+1
AMLogic based device uses paths like /dev/block/recovery and the stock init binary either deletes or does not create mmcblk0p12 which breaks TWRP because TWRP cannot match up the path / name. The ioctl method is probably more reliable anyway and certainly should be faster. Change-Id: I73f981dcec637cdf5b189bdefa00ea15b924b500
2015-12-19Multiple Language SupportEthan Yonker1-0/+4
This is similar to https://gerrit.omnirom.org/#/c/14014 A lot of the features built in the older patch set have been split out into separate patches, most of which have already been merged. The remaining functionality here should all be directly related to language selection and loading. We always load English as a base before loading other languages over the top of the base. The idea is that if another language is missing a translation, then we will still display the English. Maybe still to do: read the /cache/recovery/last_locale file and load a language based on that. For me, this file contains just: en_US We probably won't bother with region specific translations so we would have to look at either trimming off the _US or using some other method like perhaps a symlink or a combination of the two. Thanks to _that for twmsg.cpp class Change-Id: I9647a22e47883a3ddd2de1da51f64aab7c328f74
2015-11-26Fix broken fsflags supportKetut Putu Kumajaya1-1/+1
Process_FS_Flags Flags parameter is just a copy not a reference, not get updated, Mount_Flags always 0 - fix it now. Thanks to SHM @ XDA-Developers Change-Id: Ib044db905febfedefee493cfc04fd1cad6f61f8e
2015-11-26Update dosfstoolsMatt Mower1-1/+1
* Version 3.0.28 * Update filenames in source * Remove unnecessary symlink to fsck * Commit "Recode short filenames from DOS codepage (default 437)." has been reverted since we do not have access to iconv * Commits cherry-picked on top of 3.0.28: - mkfs.fat: fix incorrect int type - Prevent out of bound array read in date_dos2unix() Change-Id: I50310235c62ec2e6bc90afcd10f2814d3afb5113
2015-07-14Add ntfs-3g supportEthan Yonker1-0/+1
Add support for mounting ntfs via ntfs-3g and support for wiping and repairing ntfs partitions. Change-Id: I82dc4626f459bb93b86eb9ebba64ad3a6560781b
2015-05-28Add resize2fs and ability to run resize2fs via GUIEthan Yonker1-1/+4
Note: Only works on ext2/3/4 partitions. Only tested on ext4. We can use this in some cases to resize the data partition if an incorrect fstab caused recovery to not reserve the 16KB for a crypto footer. Sometimes the BoardConfig for a custom ROM does not have the correct size for the system partition and if the ROM flashes a raw system image, that image will not take up the full block device. Running resize2fs can fix the size and may allow more room in the system partition for customizations like busybox or a larger gapps package. Sometimes flashing a factory image may flash userdata with an image with a file system that does not take up the full size of the block device (e.g. factory images for the Nexus 6 will flash userdata with a ~24GB userdata image, wasting ~30GB of space). Using resize2fs we can easily fix this issue without having to do a full format data. Change-Id: I631f5c6f567bbc6a9241e5dd95f1e435820a1b13
2015-05-27Mount system as read-only by defaultEthan Yonker1-0/+3
Mounting system as rw can prevent future OTA updates. The purpose of this patch set is to prevent TWRP from mounting sytem as rw on the first boot. Device maintainers should update their twrp.fstab files on these devices to include an additional line: /system_image emmc /dev/block/../system This line will allow TWRP to create a raw system image backup to ensure that the user can return to an original state for future OTA updates. Change-Id: I8929d85bc3a5b96cc564bc7f734b58d5612ec833
2015-02-23Theme: Add ability to disable size checking before backupbigbiff1-1/+1
(for compressed backup users with low space). Clean up backup folder and copy only recovery.log for debugging. Conflicts: gui/devices/watch/res/watch.xml Change-Id: If8aa3580dbc082d0fe4882d4af8dc3cdb362a8b5
2015-02-02MTP: make MTP work even if unplugged and repluggedEthan Yonker1-0/+1
Set up a loop to keep trying to open / read the MTP device so that MTP will work even if the device is unplugged during boot or unplugged and replugged in. Change-Id: I0d3a3b7c91ce84a8cbed16caa4b15efee35b3641
2015-01-27Add cancel backup capability.bigbiff1-3/+8
This will stop the iteration of the partition objects, kill the current twrpTar thread and remove the backup directory. Implement TWAtomicInt class to give us a wrapper that automatically uses mutexes before the read and write to help ensure that the reads and writes will be atomic based on documentation. Change-Id: I645b22bc980a292e9c7202acb24ffd22ebe68c63
2015-01-09Allow flashing of images via the GUIEthan Yonker1-2/+6
- Use the Images... button in the lower right of the zip install page - Unify image flashing functions between restore and image flash - boot and recovery partitions are flashable by default - use fstab flag flashimg=1 or 0 to override defaults - file system partitions are currently not flashable Change-Id: I822dc446030543c55d2153e219d67a1292374ffc
2014-12-19MTP add/remove storage instead of disabling MTPEthan Yonker1-0/+8
Implement a pipe between TWRP and MTP to allow TWRP to tell MTP to remove storage partitions as they become unavailable (e.g. during a wipe, unmount, etc) instead of disabling MTP completely. This includes some fixes and improvements in destructors to properly remove / delete various items. This also means that we will not be toggling adb off and on quite as often. I do not like that we had to add another thread, but we were unable to use select() on the mtp_usb character device because this device does not support polling. Select always returned indicating that the mtp file descriptor was ready to be read and the resulting read would block. The read block prevented us from being able to include reading of the pipe between TWRP and MTP in the main MTP thread. We might want to add a return pipe letting TWRP know if the removal of the storage device was successful, but I am not sure how we want to implement this. It would invovle timeouts in both TWRP and MTP to ensure that we returned a failure indicator in a timely manner to TWRP and prevent deleting the storage device in the case of a failure. Right now we make no attempt to ensure that an MTP operation is underway like a large file transfer, but we were not doing anything like this in the past. In some respects we have limited control over what happens. If the user installs a zip that unmounts a storage partition, we will not know about the change in storage status anyway. Regular Android does not have these troubles because partitions rarely get unmounted like in recovery. At some point, we have to hold the user accountable for performing actions that may remove a storage partition while they are using MTP anyway. Ideally we do not want to toggle the USB IDs and thus toggle adb off and on during early boot, but I am not sure what the best way to handle that at this time. Change-Id: I9343e5396bf6023d3b994de1bf01ed91d129bc14
2014-12-04add function to partition.cpp to return max file size to mtp responderbigbiff1-0/+1
Change-Id: If8114b5eac741db6c512fb35cb48e3825c2ff098
2014-12-04Reduce libs needed for decrypt and clean up old decypt filesEthan Yonker1-3/+2
Trim cryptfs.c to remove functions that TWRP does not use for decrypt and remove the need for libfs_mgr from cryptfs.c by passing some items to cryptfs.c from the partition manager. Add support for new fstab flags: encryptable and forceencrypt=/path/to/cryptokey For example: flags=forceencrypt=/dev/block/platform/sdhci-tegra.3/by-name/MD1 Note that "footer" is the default, so you do not need to set this flag on devices that use the footer for the crypto key. Also add mounttodecrypt if you need to mount a partition during the decrypt cycle for firmware of proprietary libs. Clean up decrypt and only support one version Android 5.0 lollipop decrypt should be backwards compatible with older versions so we will only support one version, 1.3 that came with 5.0 lollipop. Remove support for Samsung TouchWiz decrypt. It does not work with the latest versions of Samsung encryption anyway and it has not been updated to work with any AOSP decryption higher than 1.1 Change-Id: I2d9c6e31df50268c91ee642c2fa090f901d9d5c9
2014-11-04partitionmanager: remove unused By_Block and By_Name methodsthat1-15/+0
Change-Id: Ia6eefd23f6671428221e35642f01534bc9fff6ad
2014-10-08mtp: cleanup, fixes and performance improvementsthat1-5/+2
- 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-09-20Attempt to automatically identify data/media devicesEthan Yonker1-0/+1
Change-Id: Ia3007fbced9ce3bc94efdb3dacc582a5e68a49a4
2014-09-15Additional checks to prevent partitioning internal storageEthan Yonker1-1/+3
Change-Id: I9fcd7e0169fbdd52405c0c86aafbef091f69411e
2014-09-05MTP: Use fork instead of pthreadEthan Yonker1-1/+1
Change-Id: I95cf6f4def0c86f40c775738f0712323f0a0f146
2014-09-03add mtp responder to TWRP.bigbiff bigbiff1-2/+9
Big thanks to Dees_Troy for helping with the implementation. Change-Id: I6c9c522b9c9de5dc139e2ecb0141008182ba07f0
2014-07-09Track backup and restore progressEthan Yonker1-7/+10
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-06-04Add options to repair or change file systemEthan Yonker1-0/+9
Change-Id: I9043e98e1e1ed4722f05c13a60b43d2d0bf739f6
2014-05-31Fix crash while loading config due to incorrect tw_storage_pathVojtech Bocek1-0/+1
Change-Id: Ia5957efe616defa4272501cd8f31d26d394077bb Signed-off-by: Vojtech Bocek <vbocek@gmail.com>
2014-04-16Support alternative .android_secure locationMatt Mower1-1/+2
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-01Improve USB Storage handlingEthan Yonker1-0/+1
Change-Id: I5743d9b967a8227c4bb87da01a9c67c574bf9876
2014-03-13Improve handling of settings storage and android secureEthan Yonker1-0/+1
Change-Id: I8af92543c2f0c201e7220267c417d74e4561038d
2013-12-19Create a TWRP Disk Usage Class to retain state about a directory and whether we should skip it in other classes like twrpTar.bigbiff bigbiff1-1/+2
Moved Get_Folder_Size to this new class. Change-Id: If0a0220f900eb109581f2eeaf7b76e3f7d6886f1
2013-12-19add support for fsflags= option in twrp.fstab fileHashcode1-0/+3
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-10-24Update licenses to all matchDees Troy1-21/+17
Change-Id: I3be70a897e563658736b2dec3a9ea2697b69b225
2013-10-22Update licenses to all matchDees Troy1-21/+17
2013-08-30implement "usermrf" fstab flag to force rm -rf * deletion on specific partitionsHashcode1-0/+1
Change-Id: I58f4a8cedf31e6b6efd88f96a43ed525603ae311
2013-08-29Initial f2fs supportDees_Troy1-0/+1
Need to add this to your source tree: https://github.com/razrqcom-dev-team/android_external_f2fs-tools Change-Id: I3ee9ebbb617259655518f8ea356ce7b8c246cd4d
2013-08-24Clean-up in partitions.hppVojtech Bocek1-90/+88
* Remove useless 'virtual' keyword * Set proper members visibility Signed-off-by: Vojtech Bocek <vbocek@gmail.com>
2013-07-032.6.0.0Dees_Troy1-0/+1
Also copy recovery.fstab to cache and create a storage.fstab in cache for app/apk use.
2013-06-22Support encrypted backup filesDees_Troy1-0/+2
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-03-30Add partition list GUI elementDees_Troy1-0/+16
Add partition list GUI element and update backup, restore, mount, storage selection, and wipe sections of GUI and partition manager code to reflect the new GUI element. Update ORS engine to handle new backup and restore setup. Fix a bug with decrypt. Add 1080x1920 layout. Change-Id: Iaa2f44cb707167e66f935452f076ba00e68a2aa4
2013-01-15Add flag for retaining layout versionDees_Troy1-0/+1
Needed on Sony mint (Xperia T) as the /data/media folder is a separate partition and normal data media wiping is not appropriate for this device but the layout version file needs to be retained for Android 4.2 multi-user.
2013-01-09Improve remounting sdcard with ecryptfsDees_Troy1-0/+3
2013-01-09Add libtar to TWRP instead of using busybox tarbigbiff bigbiff1-1/+2
Add proper mkdosfs tool Add fuse to TWRP Add experimental exfat-fuse to TWRP Convert all system() functions to use new Exec_Cmd function
2012-12-12Add ignore blkid flag for TransformersDees_Troy1-0/+1
Change-Id: I8f2b5b68a8c3ede74858d53002efab997174ee65
2012-11-22restore based on backup type, not destination typeGary Peck1-2/+3
Change-Id: Ie44958a148d00cadd2ba3c51255f7fd9d8a651e7
2012-10-15Update and improve USB storage codeDees_Troy1-0/+1
2012-10-14Handle storage devices that are slow to mountDees_Troy1-0/+1
2012-10-12Unmount system after boot, backup, and restoreDees_Troy1-0/+1
2012-10-10redo fix permissions in c++ for faster changesbigbiff bigbiff1-0/+1
2012-09-27Update sdcard partitioning to C++Dees_Troy1-1/+1
2012-09-27Port backup name checking to Partition ManagerDees_Troy1-0/+1
2012-09-26Add option to wipe android secureDees_Troy1-0/+1
2012-09-26Fix permissions updatesDees_Troy1-1/+0
Also redirect stderr output on terminal commands for display in GUI console
2012-09-26Fix problems with MTD devicesDees_Troy1-1/+1
Also improve handling of MTD names
2012-09-26Add backup size checkingDees_Troy1-2/+4
Converted bootloader.cpp to TWRP and removed AOSP fstab parsing from startup
2012-09-21Add progress bar support to backup and restoreDees_Troy1-2/+2
2012-09-21Add android_secure supportDees_Troy1-1/+6
2012-09-20Add and improve OpenRecoveryScript supportDees_Troy1-0/+1
Improve zip finding in ORS engine Add support for restoring with just a backup name
2012-09-18Cleanup extra-functionsDees_Troy1-0/+4
2012-09-18Improve backup and restoreDees_Troy1-0/+1
Add in archive splitting support
2012-09-17Update backup and restore code, adb sideloadDees_Troy1-3/+6
Fixed a problem with using make_ext4fs by making its lib a dynamic lib. Added ADB sideload zip install feature - no way to cancel it yet. Improve backup and restore code.
2012-09-14Add wipe functions, compiles in CM7, text shows in UI, zips installDees_Troy1-4/+14
Zip install works, had to move mincrypt code into TWRP to prevent a crash when checking the zip signature. Added wipe functions Made it compile in CM7 Made text show up in console and logging
2012-09-10More Partition Manager functionalityDees_Troy1-0/+1
2012-09-10Improve storage size code, mount, unmountDees_Troy1-3/+9
Add flag parsing from recovery.fstab
2012-09-07Add processing of fstab, mounting, and decryptDees_Troy1-34/+55
2012-09-05TWRP-ify AOSP codeDees_Troy1-32/+34
Pull in most TWRP sources Stub out partition management code Make it compile -- probably will not boot Kind of a mess but have to start somewhere
2012-09-04Initial stub of partitions.hppDees_Troy1-0/+141