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
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
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
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
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
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
* 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>
* Some devices like lavender, etc. getting failed to decrypt
Change-Id: I63ca05c4f87cdd17d48d4541a5a8121c736beb02
Signed-off-by: Mohd Faraz <androiabledroid@gmail.com>
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>
* All missing strings added (ref: en.xml).
* Many strings clarified and ambiguity removed.
* Inconsistent use of language reconciled.
* XML validated by xmllint(1).
* String length validated on device (G975F).
Change-Id: I4a4c3dc5a1147a62b8c141286fc7ac432678a322
* We may use a custom offset to:
a) preserve data that oem wrote to the first bytes of misc
b) skip recovery flags written by the bootloader (e.g. --wipe_data)
For case a) one should set the offset 'x' to be at least greater than
the size of bootloader_message struct (2048 bytes). If this is the case,
then we zero out bytes x ~ x + 2047
For case b) one should set the offset to be strictly smaller than
the size of bootloader_message struct. If this is the case, then we
zero out bytes 0 ~ 2047.
This allows to clear any additional flag set by the bootloader,
that would otherwise be forgotten in misc.
This also guarantees that we do not involountarily wipe any data that
the oem may have written starting at byte 2048 (coff coff LG)
Change-Id: I2d4e0702a2d8cbbef6274a87ce9499b0f69310dd
* bootloader_message.cpp is the only file using
BOOTLOADER_MESSAGE_OFFSET_IN_MISC and WIPE_PACKAGE_OFFSET_IN_MISC,
so we can move their definitions to the cpp.
This prevents the need to set BOARD_RECOVERY_BLDRMSG_OFFSET
in every module that includes the header.
* Global cflags are no longer supported Oreo and up,
so set the BOARD_RECOVERY_BLDRMSG_OFFSET via make variable
* Simplify logic, always set BOARD_RECOVERY_BLDRMSG_OFFSET.
Change-Id: I2b902bcce7f5ca13472e0ac30ac01b4991294dbe
/sbin must come before any other search path when TWRP is built for a
different version of Android than the one on which it will run.
Otherwise, as soon as any of the other paths becomes available via
direct action (i.e. the user mounts a file-system) or indirect action
(e.g. the user flashes a zip that mounts a file-system), incompatible
libraries will be prioritised and loaded instead of the correct ones
from /sbin in TWRP's ramdisk.
This will cause severe disruption of the TWRP environment. Toybox and
other dynamically linked binaries will immediately cease to work; and
since Toybox provides umount, it typically won't be possible to recover
from this state without a reboot.
For example, the following occurs when a Toybox applet is run on a
Samsung Galaxy S10 running Android 10, but using a version of TWRP built
for Android 9:
android:/ # getprop ro.boot.bootloader
CANNOT LINK EXECUTABLE "getprop": cannot locate symbol "_system_properties_init" referenced by "/system_root/system/lib64/libselinux.so"...
linker: CANNOT LINK EXECUTABLE "getprop": cannot locate symbol "_system_properties_init" referenced by "/system_root/system/lib64/libselinux.so"...
Change-Id: I31fe612ebb1c7d9ad71d67be2c615caa3fbb5d6f
- Move commands from prebuilt to root Android.mk
- Hotfix for linker errors after https://git.io/JerWD merge
on some Samsung device(s)
Change-Id: If628ab486689878885b696c2f5a107987092aeba
* without this A/B devices are writing 8MB+ uncompressed logs under persist/cache/recovery which increase in size over time. This can eventually leave persist partition OOM causing other cascading issues like crashing the modem during boot and bootloops.
Change-Id: I0f3aab0eb96804d1be8de965eb2c2e9bb83d5b56
Co-authored-by: Erfan Abdi <erfangplus@gmail.com>
Signed-off-by: Andrew Hexen <SyberHexen@gmail.com>
- Fixes the ld.config.txt errors in recovery log which may prevent
decryption and shell commands from working properly
Change-Id: I0e057525cdda39e8ac10115d37e2cb882b9c4844
This update will use pigz to compress the log that TWRP stores
on persistent storage in order to help with storing logs on the
persist partition.
Change-Id: I16971b8b138b74a164b1b0835847177cfc6104e2