Commit Graph

9577 Commits

Author SHA1 Message Date
Peter Cai
28ea7b000a partition: set fbe.data.wrappedkey automatically via flag
In change I79c2855d577156670b45c10c7c7b1fcd9fece8d9 we introduced a
property to enable wrappedkey mode. This change supports an extra
`wrappedkey` flag in fstab to automatically set the property to true.

Change-Id: I4f060d4ed6b2a5680649b8746dfa7fd903fe2d35
(cherry picked from commit 40ed06e850de2dc7cc06c2e647688212563f1ec2)
2020-05-13 00:39:19 +00:00
Chaosmaster
6c1477d974 Mount system and vendor for A/B installs for backuptool to work
Also bind mount a copy of /sbin/sh over /system/bin/sh

Change-Id: I58026af425b07b50a4377ab843192578e0d45587
(cherry picked from commit 7bf8df5086c561cbc9da9b32afa678ebe966f5c1)
2020-05-11 18:16:56 +00:00
bigbiff
a34befa5c8 system mount: unmount system after checking for TWRP app
Change-Id: I9ab74c9839b50e399432d19839191b7de2d1bf60
(cherry picked from commit 07f991a3ed1457d4774078219e828e6d63756777)
2020-05-11 15:23:32 +00:00
Captain Throwback
89a03ccd36 vold_decrypt: automatically set Android version & patch level
- Requires TW_INCLUDE_LIBRESETPROP
  (set automatically if TW_OEM_BUILD is not set)
- Set based on installed system (if present)
- Will set values back to TWRP defaults
  after decryption completes
- Only included/run on Oreo+ systems

Change-Id: I41fcc1af8cd4b15329574f7403f7491320199f48
(cherry picked from commit 3284a66e23fbc6e1a82df668b497ef931d9c0081)
2020-05-11 15:22:14 +00:00
bigbiff
437b93a087 Merge remote-tracking branch 'origin/android-9.0' into android-10.0
Change-Id: Ie850f431f0d2c39c86b9c10701676a24770ab447
2020-05-10 20:06:41 -04:00
dianlujitao
b76a73a1a9 Fix backup and restore after autodetection for SAR
This reverts commit 8a411c8d25.

 * Always use "/system" to interact with the frontend and replace it
   with the detected path before taking actions.
 * Don't replace the pretty display name and backup name set during
   processing fstab after wipe. This improves UX and ensures that the
   system backup is always named system.ext4.win despite the actual
   mount point is /system_root so TWRP is able to recover either SAR or
   non-SAR backups.

Change-Id: Ie2594d2678d0c75ce25c0d1087d47b035b3f10e9
2020-05-10 21:35:01 +00:00
Chaosmaster
65633a46d0 Add optional PartitionManager and Mount_Point to
Get_System_Properties for use during SAR-detect

Change-Id: Ie1ffba53459b7bb77ca47d9cb928b2626c704a05
2020-05-10 21:30:50 +00:00
Mohd Faraz
0d9a62e409 Remove Extra spaces occured while using multiline string variable
* On multiline string variable it adds spaces

Change-Id: I0f9140f3840b0238009af2271ac67b25754f76c9
Signed-off-by: Mohd Faraz <androiabledroid@gmail.com>
2020-05-10 21:24:00 +00:00
Chaosmaster
97c4541415 libresetprop: not available for Android < 7
Change-Id: I5cf384b472e43ee8d380ac08aeed1a8567844d7e
2020-05-10 21:21:47 +00:00
Chaosmaster
01a17998da Add flag for overwriting properties with system values
This adds the flag TW_OVERRIDE_SYSTEM_PROPS which can contain
a ";" separated list of properties that should be overriden.

A different source property can be defined by separating
target and source using "="

Example:

TW_OVERRIDE_SYSTEM_PROPS := "ro.build.product;ro.build.fingerprint=ro.system.build.fingerprint"

This will override ro.build.product with the value of ro.build.product from system/build.prop.
And also override ro.build.fingerprint with the value of ro.system.build.fingerprint.

with their corresponding values from the system partition.

Change-Id: Ibcd3e6ed51fa7f7195ad524e606a2b9542687e55
2020-05-10 21:19:32 +00:00
Chaosmaster
461e39fe89 Add TWFunc::Property_Override(name, value) to override properties
using libresetprop

Change-Id: Ic49e187698c714f8a629d20ceddc40e823555477
2020-05-10 17:17:56 -04:00
bigbiff
aaa9e64b81 Merge "Create a flag to include resetprop in the TWRP" into android-9.0 2020-05-10 20:37:09 +00:00
Chaosmaster
f6e42ce390 Implement autodetection for SAR, based on the installed system
This will detect whether SAR is present in the currently installed
OS and set the property ro.twrp.sar accordingly.
After setting the property it will call the bootscript
/sbin/sarsetup.sh (if present) to give device maintainers the
option to do setup operations depending on SAR-status, such
as modifiyng the fstab.

If no system is detected and AB_OTA_UPDATER is defined or built with
Android 10 and upwards, it will fallback to using SAR, otherwise it
will use ro.build.system_root_image as basis for deciding whether SAR
is required or not.

The property ro.twrp.sar will also be used by
TWPartitionManager::Get_Android_Root_Path()

This allows maintaining a single TWRP-build for devices switching
to SAR for Android 10.

The default behavior (when no system is installed)
is determined by the build-flags AB_OTA_UPDATER and
BOARD_BUILD_SYSTEM_ROOT_IMAGE

Change-Id: I2a48c6c81a6ea6fad6e452c06bfbe4d9da0f1e5c
2020-05-10 15:43:56 -04:00
Chaosmaster
da97480567 Create/Remove system_root/system bind mount, when mounting System
This will automatically create and remove a bind mount
/system -> /system_root/system
everytime "System" is mounted via the GUI or ORS.
This should get rid of issues with ZIPs trying to mount
the system-partition to /system on SAR-devices, while keeping
the filesystem-layout in sync with AOSP from a user-perspective.

Change-Id: I7f531d113b07c31b39d8f87edac76a7fc79075e7
2020-05-10 15:43:55 -04:00
Chaosmaster
ff4f958182 Add option to automatically unmount system before installing ZIP
This adds the option to automatically unmount the system partition
before installing a ZIP-file.
This option is enabled by default, This is usefull on SAR-devices
where system is mounted as system_root and ZIPs (i.e. Magisk)
try to unmount system instead of system_root and fail to install.

Change-Id: Id94ae658964679e23aa7fa137e07edf74ee073df
2020-05-10 15:43:55 -04:00
Chaosmaster
3b3b634365 ORS Make mount/unmount system mount system_root on SAR
Change-Id: Ibf8d4d61e6cbb132786f5f9aa23ec91b49bcab89
2020-05-10 15:43:54 -04:00
Chaosmaster
3b6827372e Set system-partition mount point to proper location
This sets the system mount point to either /system_root or /system
depending on whether SAR is detected or not irregardless of what
is specified in fstab.

This removes the need to edit fstab for SAR-builds and simplifies
building unified (SAR/non-SAR) builds.

Change-Id: I154fd76f842702be9e5d09005463c8e5f1d289a4
2020-05-10 15:43:54 -04:00
dianlujitao
58f1a63767 Properly detect system-as-root
ANDROID_ROOT environment variable is also used by other Android
components thus it should ALWAYS be /system in order not to break other
tools. On the other hand, AOSP does have a system property to indicate
system-as-root, just make use of it.

Change-Id: I7fc58a78db7abd05fac9000910169c370f5de62d
2020-05-10 15:43:53 -04:00
mauronofrio
76ef9f3c04 Create a flag to include resetprop in the TWRP
The flag is:
TW_INCLUDE_RESETPROP := true

Change-Id: I4d4d25a6d5bbd2330efd7f184d0f878a8cf0346e
2020-04-30 16:42:03 +08:00
Mohd Faraz
fdd49bbb41 partitionmanager: Unmount all directories mounted to same block
* Like Xiaomi's some older devices uses cust as vendor and also mounts cust & vendor simultanously

 * This patch will unmount all directories mounted to same block

Change-Id: Ic242e267a470b4d82098d847f74b807a461605c4
Signed-off-by: Mohd Faraz <androiabledroid@gmail.com>
(cherry picked from commit 77a31917f2)
2020-04-26 18:16:59 +00:00
Mohd Faraz
77a31917f2 partitionmanager: Unmount all directories mounted to same block
* Like Xiaomi's some older devices uses cust as vendor and also mounts cust & vendor simultanously

 * This patch will unmount all directories mounted to same block

Change-Id: Ic242e267a470b4d82098d847f74b807a461605c4
Signed-off-by: Mohd Faraz <androiabledroid@gmail.com>
2020-04-26 18:16:04 +00:00
Andreas Schneider
5a850bd493 Fix building libuuid
libuuid uses flock() which requires <sys/file.h>.

Change-Id: I230a5d08ce90088d14db2f89a0843bf43029b3c7
(cherry picked from commit 915bbd225e)
2020-04-26 15:26:25 +00:00
bigbiff
fec60c3e33 Merge "Fix building libuuid" into android-9.0 2020-04-26 15:26:04 +00:00
bigbiff
973167aff3 ramdisk: move uevent link that build creates
Add missing init.rc files for recovery.
Cleanup init symbolic links.
Comment out removing the source file in relink.sh because we need
to retain files in /system in the ramdisk.
Change-Id: Ie959024296738538f3b3161e38027a44525b0696

Change-Id: I5b1a744414b88a9a15c56bd81f37091664d5cdf1
2020-04-09 16:47:23 -04:00
bigbiff
4721a5a1a3 unzip: relink unzip binary from system/bin
Change-Id: I69a8c86c3c817f0a539be53a52f33b8bb6813fdf
2020-04-05 10:32:40 -04:00
bigbiff
36f088ac7c adbd: relink sh properly
Change-Id: Ifb4eba0cded949db66a9d3b77bb185828425d197
2020-04-04 19:58:19 -04:00
bigbiff
63d7add7cf logd: make logd run and relink logcat
Change-Id: I5a2984ea2649bebd923d42e6b984856b36b18fbd
2020-03-31 18:00:59 -04:00
Andreas Schneider
a4e510ee54 init: ueventd already needs /acct
Change-Id: Ifae7078aedc1a520ee003160fb17c8893041cb09
(cherry picked from commit ec350e9d0d)
2020-03-30 17:06:17 -04:00
Andreas Schneider
ec350e9d0d init: ueventd already needs /acct
Change-Id: Ifae7078aedc1a520ee003160fb17c8893041cb09
2020-03-30 21:02:48 +00:00
mauronofrio
cb163e0b14 Relink update_engine_sideload
Change-Id: Ifb95d94a5804f0d490bc8c2c19cab7b03c8f1432
2020-03-30 16:46:35 +02:00
bigbiff
416fe3a18a toybox: deprecate busybox and toolbox utils
Starting with android-10.0 we should only use tools from toybox.
Toyxbox in android-10.0 is specified as a recovery target, so
we just move the symlinks in our relink target.

Change-Id: Ic0116a7d583519b39422ac4d82d30e00918eb29d
2020-03-28 14:13:43 -04:00
bigbiff bigbiff
ac6cc08941 truetype: convert to STL map for handling fonts
In Android 10, libcutils is deprecating the hash functions. This
patchset moves to use the STL map to handle storing related
truetype objects.

This patchset moves the truetype functions to it's own static
class and moves the declarations to a header file. I also removed
statistics functions that were not called from anywhere.

Change-Id: I1679df4c7e844c01e3a2cbdaf5117bb09df2a5f3
2020-03-24 12:01:16 -04:00
bigbiff
6087339d3a prebuilts: don't try to relink again if source is unavailable 2020-03-23 15:41:27 -04:00
theimpulson
d95dcd207c bootable: Move to optional tags everywhere
FAILED:
bootable/recovery/etc/Android.mk: error: init.recovery.ldconfig.rc: LOCAL_MODULE_TAGS := eng is obsolete. See https://android.googlesource.com/platform/build/+/master/Changes.md#LOCAL_MODULE_TAGS
build/make/core/base_rules.mk:171: error: done.
18:29:38 ckati failed with: exit status 1

Change-Id: I056f019aa3249c185b808140bcef45a4777d21b3
Signed-off-by: theimpulson <aayushgupta219@gmail.com>
2020-03-23 15:09:31 -04:00
bigbiff
bf3b1564f9 aosp10: minor cleanup, other commented makefiles need to be worked on 2020-03-23 13:58:30 -04:00
bigbiff
d58ba18272 AOSP10 TWRP Merge: fix conflicts and update libraries needed
This allows flame to boot TWRP. Still will need to work on
super partition for vendor and system access.

The plan will be to cherry-pick any updates to android-9.0
through gerrit.twrp.me to this branch as a WIP.
2020-03-23 11:18:29 -04:00
bigbiff
26d5d5f0b9 Merge tag 'android-10.0.0_r25' into aosp10-4
Android 10.0.0 release 25
2020-03-23 09:56:16 -04:00
Fatih Fırıncı
901141c2eb language: turkish update
Change-Id: I9dab6ea9378f87879384e43dafb2e3ae4f733f68
2020-03-14 17:21:30 -04:00
Martin Dünkelmann
c630b3864f Fix 'system/etc/ld.config.txt' not found error
According to

https://android.googlesource.com/platform/system/core/+/refs/tags/android-9.0.0_r51/rootdir/Android.mk#260

the ld.config.txt gets generated with the vndk version as a suffix.
This behaviour exists since API level 28 (Android 9.0), if
BOARD_VNDK_VERSION is defined and BOARD_VNDK_RUNTIME_DISABLE is not
true.

The issue seems to be exist since commit
8d70eb617e in twrp.

Change-Id: I19741c29cda65ce051b7c167a946d551ce149f7b
2020-03-14 21:14:54 +00:00
Mohd Faraz
191a6948d9 crypto: fde: decrypt master key first
* Some devices like lavender, etc. getting failed to decrypt

Change-Id: I63ca05c4f87cdd17d48d4541a5a8121c736beb02
Signed-off-by: Mohd Faraz <androiabledroid@gmail.com>
2020-03-09 23:19:54 +00:00
Andreas Schneider
915bbd225e Fix building libuuid
libuuid uses flock() which requires <sys/file.h>.

Change-Id: I230a5d08ce90088d14db2f89a0843bf43029b3c7
2020-03-08 11:44:54 +01:00
dianlujitao
8a411c8d25 Fix ORS backup and restore for system-as-root
Change-Id: Ice7f2e22ded280f723c19e920a15f3e918c17264
2020-03-08 02:16:10 +00:00
Captain Throwback
a5283b3570 crypto: add more missing newlines
Change-Id: I158b2a8fee89c2543a0b809af8e278702466b106
2020-03-08 02:13:03 +00:00
Captain Throwback
f8d0e2156e openrecoveryscript: do not skip decryption even if using block.map
- Allows addon.d scripts to run that require access
  to decrypted /data (e.g. Magisk). Seems to also affect
  GApps addon.d script, resulting in non-booting system
- If decryption prompt is canceled, installation will
  still proceed (i.e. on devices where TWRP doesn't
  support encryption)
- Should resolve
  https://github.com/TeamWin/Team-Win-Recovery-Project/issues/1478
  and possibly
  https://github.com/TeamWin/Team-Win-Recovery-Project/issues/1459

Change-Id: Idcd397aa145577c409d5174ae3f9c48474e5734b
2020-03-08 00:31:54 +00:00
Captain Throwback
d54e1da83e partitionmanager: add /etc to Local_Path
- Prevents errors when using copy_file for
  paths starting with /etc

Change-Id: I7d52acdbc8e67a21e3d32f4793257dbdad5d82de
2020-03-04 16:55:48 -05:00
Mauronofrio Matarrese
6d5d08a1c0 Move decryption error from logerror to loginfo
Change-Id: Iffa01968dfb92d2cc91b0b6a33c87d7f270430db
2020-02-17 17:13:04 -05:00
bigbiff
2c2d559113 Merge "Removing fake error: E: recv error on uevent" into android-9.0 2020-02-16 19:46:11 +00:00
Hernán Castañón
990168bec0 bootable: read all asserts in case there are more than one.
In A/B, the device check isn´t done by the updater script, but using
metadata for it.

Let´s search if the device codename/assert is included in the string.

Change-Id: Ie856ac699aaa83de2b364bc85a510a037d36edf9
Signed-off-by: Hernán Castañón <herna@paranoidandroid.co>
2020-02-05 00:28:04 +00:00
Darth9
0864aa54ce Prevent errors caused by /data/per_boot/
Change-Id: I543723f3da4f57fb4d580661216acc1abaac883e
2020-02-01 21:27:53 +00:00
Captain Throwback
49cfb7e537 crypto: add some missing newlines
Change-Id: I6bc6b512fe6e841703229d45333421532ecebb83
2020-01-28 17:46:23 -05:00