Commit Graph

9650 Commits

Author SHA1 Message Date
Captain Throwback
47bf7204f8 partition: support tntfs module
Change-Id: I0532b10f6748d00c80454a051ef63cc74a77780c
2020-10-22 22:26:02 +00:00
Captain Throwback
b60a2732d5 Unmount vendor partition prior to switching slots
On some devices, having the vendor partition mounted
causes slot switching to fail ("Error getting bootctrl module")
Automatically unmount vendor partition prior to switching
slots to ensure the process completes successfully.

Use lazy unmount if Unmount_by_Path function fails.

TEST: Mount vendor partition, then switch slots.
      Vendor partition should be unmounted when
      switching completes
      
Change-Id: If6198d4693141be464749c4d423a9088753d939e
2020-10-21 18:03:24 -04:00
bigbiff
df8436b51a fastboot: implement fastbootd in twrp
fastbootd is a userspace daemon that runs in the recovery
ramdisk. It allows writing single partitions to the super
partition via fastboot CLI. When TWRP sees the fastboot option
in the misc partition during startup, it will start with
the fastbootd page and fastbootd running. Otherwise it will
run recovery normally.

Change-Id: Id7b12d29ef21dbd5950dc884dd1cd788f25357f0
2020-10-21 17:47:27 -04:00
Captain Throwback
12673e2a4c prebuilt: make paths consistent and remove some redundacies
Change-Id: I46d1a66622245ad61026e402bacc36924ff0e642
2020-10-20 12:15:29 -04:00
Aaron Kling
4eccd9a1c6 Choose hwrotation at runtime
If the prop persist.twrp.rotation is set to 0, 90, 180, or 270,
that will be used. If the prop is not set, the existing rotation
board config flags will be honored.

Note: This flag will only rotate graphics. If a set of devices
needs differing touch rotation, that support will need added
separately.

Change-Id: I6996c07bc0ae7bb8555b3d480b2917a17a365eb3
2020-10-19 22:08:25 +00:00
Captain Throwback
bff7617e2f init.rc: move "start logd" to logd rc file
Change-Id: I1ff512206a60056eb96f25e83db417382c9a44e5
2020-10-14 23:24:50 +00:00
Captain Throwback
ca2ba939c9 init: add services to build
hwservicemanager and servicemanager are needed for decryption
and fastbootd in TWRP. Include these services by default since
they are standard Android services and independent of device
tree or SoC.

Change-Id: Id0ec73d9a6ca0289c7b4f67e9dcf541b2157c04e
2020-10-14 12:55:58 -04:00
Captain Throwback
82c6693ec8 init.rc: clean up redundant "on fs" section
Change-Id: Ie5340ce0d31383117602df907ee3cc0b8ec7100c
2020-10-13 15:10:59 -04:00
bigbiff
c3793658b3 libtar: turn off debugging for block headers
Change-Id: I09e4dd2ec33457156faf99b0139d116b50cb7dc3
2020-10-11 09:56:44 -04:00
Mohd Faraz
815e24079b Fixes Decryption prompt asking when not needed
Signed-off-by: Mohd Faraz <androiabledroid@gmail.com>
Change-Id: Ic366a50f02f283864cf44d7b36f40ff6432d4970
2020-09-24 16:08:07 -04:00
Mauronofrio Matarrese
c1bb76ea74 Removing fake error: E: recv error on uevent
This shouldn't be an error, so i hide the line about the error.

Change-Id: I3ef667435dfa843440cc594409c8d20add676576
2020-09-24 19:24:58 +00:00
Ian Macdonald
57c289fd32 Fix path to fscrypt_policy.h include file.
Change-Id: I4d380196e3283748aa82628a4e4176120a10c46a
2020-09-17 22:17:22 +00:00
Ian Macdonald
1e0474acb0 Unconditionally call DataManager::ReadSettingsFile().
Change-Id: I86e14e65765b266efe1f8e96154c03b66b099771
2020-09-17 22:03:33 +00:00
bigbiff
6411e0832d apex: handle flattened apex directories
Change-Id: I4eb9934721ded959690d8da84a4305d15e448edf
2020-09-14 20:13:12 -04:00
bigbiff
c2cb385d5d wiping: this will fix wipe with devices that don't use the
/dev/block/mapper/userdata symlink to the setup device mapper.

Change-Id: I1d5a1ed59f7c445ce86ccd52dae1e2e729e06815
2020-09-13 18:05:41 +00:00
bigbiff
fdca6b8a5a truetype: fix truetype font key map
Change-Id: I09dc6798c219ae9d3f1a3745947b28e19fd0f527
2020-09-12 14:25:32 -04:00
bigbiff
8da46fa939 Revert "Implement autodetection for SAR, based on the installed system"
Change-Id: I9e6c549013c1d5564d0a2e369510535e3869dff6
2020-09-09 20:13:12 -04:00
Captain Throwback
dc0823c96e TW_OVERRIDE_SYSTEM_PROPS: move up to just after fstab processing
Change-Id: I9428222fd885c2afea0a5598cc4c3a52cd729ff8
2020-09-09 19:03:30 -04:00
Mohd Faraz
e3948ece83 Fix up issue during decryption
* Since some devices are unable to decrypt after processing of the fstab,
   because of the partition details updation, and after intro of dynamic partitioning
   here decryption process was going on after complete processing of the dynamic volumes.

 * This patch fix these issue, it process the logical volumes at their time not after all processing fstabs.
   This fixes the decryption issue.
   Translate more partitions i.e., ODM, Product.
   Added more partitions in unmount partitions.

Change-Id: I977c0cf0c40e5311f54a78c98f1fd89f71c6ac57
Signed-off-by: Mohd Faraz <androiabledroid@gmail.com>
2020-09-09 22:49:37 +00:00
Captain Throwback
57db2cc8ac f2fs: add back fsck.f2fs to recovery build
- Fixes issue of rebooting device when data filesystem
  is set to f2fs

Change-Id: I9de815e12be57773712d4acfa0b634ce909ea820
2020-09-09 15:40:13 -04:00
bigbiff
20edca8f34 minui: fix bad merge from aosp10.
Tested charger on flame and graphics show properly when device is
powered off.

Change-Id: Ic1a46497a6bce88992b2d1a9052cba2a1a6af8b7
2020-09-08 15:08:53 +00:00
bigbiff
ad58e1bfae repack: move sbin to /system ramdisk and update repacking
for android-10

This will support updating the ramdisk to a different
compression format and co-exist with magisk.

We are also cleaning up and removing non android-10
api makefile actions.

We are also moving twrp repacking to its own class. We
check the new ramdisk format and if it's different
we have magisk compress using the new ramdisk format.

Change-Id: I770030aae7797e75817178b2f0fccd9f39dc23af
2020-09-08 10:08:33 -04:00
bigbiff
3db1ffc89f Merge "persist logs: remove persist from available log directories in partitions." into android-10.0 2020-09-05 23:41:22 +00:00
Captain Throwback
b7cefd105e TW_OVERRIDE_SYSTEM_PROPS: move to after super partition is set up
Change-Id: I288ef00752be0cf59977e80007a9d2e0a059b41d
2020-09-05 17:12:47 -04:00
4ndyZ
af1e585f3a lang: Updated German language strings
* Added all missing strings
* Translated some English strings in the German language file
* Changed ZIP notation to "ZIP" to be consistent in the translation

Change-Id: I27812c7f79c95258363772481f71253b8b505e28
(cherry picked from commit 6c70991a72820b390185b6de923a3694dce3cf44)
2020-09-05 20:26:33 +00:00
bigbiff
aac58612ea persist logs: remove persist from available log directories in
partitions.

Too many problems have been reported for TWRP attempting to store
logs in the persist partition. Selinux denials have caused issues
booting Android, and filling up persist has caused IMEI issues.

This patchset will remove persist from the list of available log
directories by default in order to avoid these and other possible
issues.

Change-Id: I29889d69f76270a8fbb764a79be3523821d8579c
2020-08-30 18:16:35 -04:00
DarthJabba9
43d70f4bc7 Exclude the dumpsys dumps from backups, to avoid error 255 when restoring data backups
Change-Id: I7a83b3789828c1400e31007e868263c54d8eb38c
(cherry picked from commit 13b07f8dbe27d85254e0a04f689a9ed6bde7673e)
2020-08-04 23:03:14 +00:00
bigbiff
5b911ca621 persist: contexts for lost+found not found when running e2fsdroid
When running e2fsdroid on persist, lost+found doesn't have any
entries in file_contexts. We are removing the lost+found directory
after a wipe now, and before the restore of the tar.
Change-Id: If5db0971884e296fae0211ff4806f3e16e394632

Change-Id: I9fa51dc9ef558cd82445df9a8fa377b1feda11aa
2020-07-19 09:32:13 -04:00
Mohd Faraz
e1d72623b7 Fix up cache wipe issue in A-Only device
* missed in 3754fabbea

Change-Id: I8fc3719e7f98c3d9b5fd96a9820b84773d4f5d7d
Signed-off-by: Mohd Faraz <androiabledroid@gmail.com>
(cherry picked from commit 25371a7e1f7f7d690755e3b12140b39567456a98)
2020-07-06 20:56:57 -04:00
bigbiff
25d25b9e67 log storage: change AB device log storage to /data/recovery
This patchset is now exlcuding /data/cache from backup, and removing it
from the wipe exclusion list to prevent errors on restore and wiping
/data.

This patchset changes the directory from /data/cache to /data/recovery for TWRP
to store logs and other file information. This will help with AB
devices that don't want recovery to mess with /data/cache.

This patchset will make ORS use /data/cache for AB devices.

Remove policy code because we don't need to set a policy for the
recovery directory.

Change-Id: I1d140276314fd34804a72297d6e25a52e58210a0
2020-07-07 00:55:42 +00:00
bigbiff
7124009f9d fastbootd: relink for startup
Change-Id: Ica7dfbfd46c06618240fb06fce9c4b31103ec506
2020-07-03 18:55:21 +00:00
bigbiff
1f780663cf minuitwrp ev_init: delay start if specified in board
This setting in the board will help if it takes longer
for the touchscreen driver to initialize.

Use TW_DELAY_TOUCH_INIT_MS := nnnn where nnnn is in MS.

Change-Id: I0a5c602edfe1214d64adadc980921a7bc0aa2bc5
(cherry picked from commit c6e2cfecce019d70ed5de74611761a2546e34828)
2020-06-29 15:50:54 +00:00
mauronofrio matarrese
e50fde5c78 Set proper filesystem during decryption
Change-Id: I0bb9d4ceab83feff19571004f7dccd360ddceac0
2020-06-23 14:46:23 +00:00
mauronofrio
539597deed Rework is_metadata_wrappedkey_is_supported
Change-Id: Ia3c266bb32e31354375b633c4801e486f664539a
2020-06-23 14:45:20 +00:00
mauronofrio matarrese
f1079ed67b fscrypt: : Use wrapped key for metadata encryption
Importing of this commit:
944c48d5a4

Change-Id: I048a6c2aeff2591135f47223a99af5ddd215703c
2020-06-23 14:44:34 +00:00
mauronofrio matarrese
bd79db4d6d fscrypt: change to upgrade key if export fails
Importing this commit:
f999d65b23

Change-Id: If73dc534ddf6c8b96ce2789789f25ce432428aa5
2020-06-23 14:44:12 +00:00
mauronofrio matarrese
17fb1210a9 Rework is_wrapped_key_supported_common
Importing is_wrapped_key_supported_common from android-9.0 branch

Change-Id: I7a13b40e365a984a90a661e6c2c71cfa5b725a11
2020-06-23 14:43:47 +00:00
mauronofrio matarrese
7982032fcd fscrypt: Wrapped key support for FBE
Commit imported from:

https: //github.com/LineageOS/android_system_vold/commit/ce024f07c23d0649635a336fff389332b9806f48
Change-Id: I924a9fcbac7d790609fbafcf8c12654fdb267e32
2020-06-23 14:43:17 +00:00
bigbiff
86fabbe4d0 vendor partition: mount if found in super
Change-Id: I6348511087aca6fc722dc48677794e0d8b4a63fa
2020-06-22 17:07:27 -04:00
bigbiff
7ba7500953 decrypt: AOSP 10 requires the use of fscrypt
fscrypt aosp doc: https://source.android.com/security/encryption/file-based
kernel fscrypt doc: https://www.kernel.org/doc/html/v4.18/filesystems/fscrypt.html

This commit implements the ability for TWRP to use fscrypt to decrypt
files on the fscrypt implementation. It has been implemented mostly
in a new successor library to e4crypt called libtwrpfscrypt. Most of the
code was ported from AOSP vold.

Notable updates include:
 - updated policy storage by libtar
 - lookup of fbe policies by libtwrpfscrypt
 - threaded keystore operations

Big thanks to Dees_Troy for the initial trailblazing
of encryption in TWRP.

Change-Id: I69cd2eba3693a9914e00213d4943229635d0cdae
2020-06-22 12:17:22 +02:00
Simon Shi
f4c1553789 super: emmc shouldn't be mount-only.
Bugs:
E:Cannot restore super -- mounted read only.

Change-Id: I07891b3f45a8601c1cafa45f9dd2a7a94482ac06
2020-06-18 02:38:24 +08:00
Simon Shi
407437ed39 super: Don't mount while prepare
Some of the partitions will not be unmount automatically. They shouldn't
be mounted by default.

Bugs:
DM_DEV_REMOVE failed for [product]: Device or resource busy
Cannot unmap product before removing group qti_dynamic_partitions.
script aborted: assert failed: update_dynamic_partitions(package_extract_file("dynamic_partitions_op_list"))
assert failed: update_dynamic_partitions(package_extract_file("dynamic_partitions_op_list"))error: 25
Updater process ended with ERROR: 7

Change-Id: I7cbd5c29456ca2731b94a69bbf9ad77058cef09c
2020-06-16 00:06:48 +08:00
mauronofrio
6d3bf891c4 Add ozip decryption for Oppo/Realme device
This function will automatically decrypt .ozip file in a .zip and it will
save the .zip in the same folder of the .ozip and with the same name.
After the decryption, the flash will start.

To enable this function you have to set a Boardconfig flag with the
decryption key like i did here:

a30625f80a

Original projects:
https://github.com/sabpprook/ozip2zip
https://github.com/bkerler/oppo_ozip_decrypt

Change-Id: Ic93243a565008c442bcf2992069b2801532ac7c1
(cherry picked from commit 0ff59845f2f8dddedb4cee9a9faf86a6294cce66)
2020-06-10 22:31:49 +00:00
Captain Throwback
87d73d6620 FBE: set TW_IS_FBE based on whether key version path exists
- Should not be determined by whether support exists in TWRP
- Set to 0 by default if FBE is not detected

This also prevents the wrappedkey check from running
on FDE devices

Change-Id: I85d1952facdfafdaa1571fc1b11d4b4b7d9ba48e
(cherry picked from commit cf0dffce3413261f149a3565d8f27cb32490ae54)
2020-06-10 16:33:52 -04:00
mauronofrio
38ed6a7e82 Allow Gui File Selector filter to check among more extensions
For example now in Install menu we are seeing all files with .zip
extension, after this commit we can see also files with .ZIP extension.
Just add the extension between ";" separator.

Change-Id: I6ddd2a812a182570af3d76711b1e3e13740a466b
(cherry picked from commit 27020944c2472c28b12ceccf676d58c2709af890)
2020-06-10 15:34:28 +00:00
Patrick Zacharias
0edce1a2a4 gui: Repair OEM build
Building with TW_OEM_BUILD results in errors during compilation:

error: unused label 'error' [-Werror,-Wunused-label]
error: unused parameter 'allow_commands' [-Werror,-Wunused-parameter]

These changes are required to allow compilation to complete.

Change-Id: Iddc5bf1b90120de19a472c48b21d3531b758cacf
(cherry picked from commit 0cd6be903b3129b30d5abe40d3a0f30545eef27d)
2020-06-10 14:38:39 +00:00
Mohd Faraz
f9ded0665b fix flashing issue after restore policy issue
* since commit: a2bd7b7758
   after factory reset /data/recovery doesn't recreates in A-only devices.

 * so fixes issue flashing newer roms need access to /data/recovery

Signed-off-by: Mohd Faraz <androiabledroid@gmail.com>
Change-Id: I02cb67f7161571b1aa02784049231d42872a3587
Signed-off-by: Mohd Faraz <androiabledroid@gmail.com>
(cherry picked from commit bcbe94e2b5ef83fe65a5c9767287802365b5ee4e)
2020-06-10 14:24:25 +00:00
bigbiff
325e0a2cca ext4crypt: fix include location for recovery-twrp in lineage
Change-Id: Iefa73425fc13f41f5a267cce0c5d4047edc25e9e
(cherry picked from commit 186eb7002d95e28325f2d2e42637c989e08ac618)
2020-06-08 23:28:07 +00:00
LameMonster82
4ef96a6f9a add support for TSPDRV vibration
* Needed for the LG V30, G7, V35, V40

* Use TW_HAPTICS_TSPDRV in your BoardConfig.mk to enable it.

Change-Id: I0970ed5c046e851f7e6f562283523c7214c8d2b5
(cherry picked from commit 314cbd5698d1750a31c9cf4284d3ce8dfadce157)
2020-06-08 22:36:41 +00:00
bigbiff
32cbabe413 apex: mount up apex files into /sbin for library access
This patch uses the loop device to mount files under
/sbin/ from /system/apex in order for the device to
use libraries or other files store inside these files.

Each apex file is mounted over a loop device into a
directory correpsonding to the apex filename under
/sbin/.

Once apex mounting is completed, TWRP will set a
property twrp.apex.loaded to true so that init
can use them as a LD_LIBARY_PATH source.
Change-Id: I69f14a969123ac9cf1afc85b6cf76836cb092fb2

Change-Id: Ica6a7d8e479bcaec8bec4483b5e8d2b45ee105fb
2020-06-08 20:38:04 +00:00