Commit Graph

11007 Commits

Author SHA1 Message Date
Captain Throwback 36deede620 soong: create phony package to fix dirty builds (2/2)
Add twrp_soong as a required module to ensure twres
folder is included in dirty builds where device out folder
is removed

Change-Id: I5b3f57664cd2aa97ff74ff594c72e6f29c6c927f
2022-02-24 23:01:37 +00:00
bigbiff 2c53845cbe sdcard: remove mount check
Change-Id: I278d7f71e79a82a34f95dba197555d08960f2723
2022-02-20 17:42:27 +00:00
Captain Throwback fcb99a2cb5 twres: fix folder copy on dirty builds
Add MkdirAll before trying to copy to twres folder

Change-Id: I66f150828f804fd36bbcfd2bc9ee17c54761d672
2022-02-18 12:55:42 -05:00
bigbiff bee26852ce datamedia: setup datamedia with key_directory set
Change-Id: I92cc83caf7e4ff3b43a69d214d176acb230abdef
2022-02-09 20:49:54 -05:00
Captain Throwback e848afcea6 fstab: add quota to handled flags
Change-Id: Iffce38ff43b1337803a5fcf067483f61533ee423
2022-02-08 23:05:46 +00:00
Captain Throwback 32bcdcd32e fstab: add support for metadata_encryption flag
Change-Id: Ic1f12f280e9e99cfe3587e35b88a1f2e9d97a1b2
2022-02-08 12:45:01 -05:00
bigbiff cda1588bc5 sdcard: only bind mount sdcard after successful preparation of data
Change-Id: I589f48a019f90a60ad48f93c5f5555aae4b8a5c9
2022-02-08 00:52:07 +00:00
sekaiacg 2a8dc0dd8e language: Update Chinese Simplified translation
Change-Id: I86e6a61b29e5d4b70356daa6ae2ce528fef0cb1f
2022-02-05 15:11:36 +00:00
Darth9 7ce944d50f twrpRepacker: avoid code duplication
Change-Id: I75712f32ef8804774418bb425040dc2b8f2d4e00
2022-02-03 18:53:20 -05:00
Captain Throwback aafc82e8e2 Partition_Property_Get: Get props from additional partitions
Use the TW_OVERRIDE_PROPS_ADDITIONAL_PARTITIONS flag to
specify a space-separated list of additional partitions
that should be parsed when trying to locate props
for overriding.

Example:
TW_OVERRIDE_PROPS_ADDITIONAL_PARTITIONS := vendor odm

Requires TW_OVERRIDE_SYSTEM_PROPS to be defined.

Change-Id: I7baf4c15628789fe525976d9de0251bba6882395
2022-01-30 21:44:35 +00:00
Captain Throwback 7460b59230 theme: clean up TW_THEME_VERSION shell command
Change-Id: I6be1f15d05e6ad53bf239674cf41173879eef37a
2022-01-29 15:59:42 -05:00
Captain Throwback a1317fc7bb theme: move TW_THEME_VERSION to variables.h
Automatically add the current theme version to the
splash and ui xmls during the build

Change-Id: I52f8cb41fabe34a8849ecc54ece3c0fb645dcd74
2022-01-29 14:12:02 -05:00
DarthJabba9 45a8d148b5 Adding TARGET_OTA_ASSERT_DEVICE flag for custom device asserts
Should be handled via device tree's BoardConfig
Sample will be TARGET_OTA_ASSERT_DEVICE := le_zl1,zl1,lepro3,lex720,lex727,LEX720,LEX727 in BoardConfig
Only applicable for AB or VAB devices

Change-Id: I1fbe6155d3f79eee089a31dbe62ee9d04c33d65c
2022-01-23 23:35:25 +00:00
MD Raza 74ea1a7d66 fastbootd: Check for and run startup script if script exists
Signed-off-by: MD Raza <raza231198@gmail.com>
Change-Id: Id2eeb59ca9161a997b239e8b58619d197dcd2093
2022-01-23 12:46:34 -05:00
Captain Throwback 550a199e67 Add TW_QCOM_ATS_OFFSET flag to manually set time/date offset
Needed if no ats_ files are present on qcom device

Offset is the difference between the current time
and the time since_epoch

To calculate the offset in Android, the following expression
(from a root shell) can be used:
echo "$(( ($(date +%s) - $(cat /sys/class/rtc/rtc0/since_epoch)) ))"

Add 3 zeros to the output and use that in the TW_QCOM_ATS_OFFSET
flag in your BoardConfig.mk

For example, if the result of the calculation is 1642433544,
use 1642433544000 as the offset

Change-Id: I5d58125dffc3fdbfb76a5ffde4e27659376185f1
2022-01-20 21:45:42 +00:00
nijel8 80c92d9be2 nandroid: exclude apexdata com.android.art folder from backup
- throws tar 255 error on AOSP Android 12

Change-Id: I2bad9c83c294d7b533c637b678764fdf25bc2cf0
2022-01-15 20:38:34 +00:00
sekaiacg 2679fb8acd kernel_module_loader: Add missing gki directory
Change-Id: I63cafb2deaaaec091ee2dff9dfd01aac23e0aade
2022-01-15 20:37:03 +00:00
Adithya R 3a59df59cc kernel_module_loader: Set a prop after completing
* we can use this as a trigger in init rc, for any task
   that depend on kernel modules being loaded

Change-Id: I7623edc0b6dc799e911a087881f76e9642e005ee
2022-01-15 20:33:59 +00:00
sekaiacg 0df7c9ef27 SkipDecryption: Fix condition
Change-Id: I3330f49214f930d481e0e237b654d44d446092bd
2022-01-13 18:08:05 +00:00
sekaiacg 826ec47f60 custom theme: Fix the install custom theme
Change-Id: I639bfdac46cbe5a0d9760d1b62fd5f9875b63994
2022-01-13 18:00:44 +00:00
Captain Throwback e331b8a1b7 tw_crypto_pwtype: move default setting to data.cpp
Change-Id: Id3dda3bc2c32ad286b1ec67595f482f84b5077d7
2022-01-10 21:21:16 +00:00
Captain Throwback 2e5abc3ecc gui: fix restore_keymaster page in landscape and watch themes
Change-Id: If182e7fc7c50b063542c9a4a058a599f05c8e685
2022-01-10 21:20:35 +00:00
sekaiacg cf77cb357c keymaster restore: Do not enter the keymaster_restore page repeatedly
Change-Id: I0c7ca541d52d923067537adb561ca5a61bde7f08
2022-01-10 20:34:02 +00:00
Captain Throwback 086358633e System_Property_Get: Set default path for build.prop
Change-Id: I5f4fa7150c025033eca29bf4fe3fe3f908f18e5e
2022-01-05 18:58:19 -05:00
theincognito-inc 546ebc391d Change TWRP nano TERM env variable from pcansi to bg1.25
pcansi TERM has always had some display and/or scrolling (up, down, left or right) issues in nano on TWRP's embedded Terminal.
Most frequently seen is misaligned/displaced text on long lines and files, either initially or once scrolled through.
bg1.25 seems to be the most compatible TERM for all devices currently.

Change-Id: If00a8352ca3576085f69c12dffb5b21637c7b21c
2022-01-04 20:32:23 +00:00
Captain Throwback a185252c8e System_Property_Get: Allow specifying multiple prop file paths
Some OEMs include prop files in custom locations. Add these to
a list and parse when setting properties.

Use the flag TW_SYSTEM_BUILD_PROP_ADDITIONAL_PATHS followed
by a semi-colon-separated list of paths (relative to /system)
where the additional prop files can be found.

The standard build.prop file does not need to be specified and
will always be parsed.

Example:
TW_SYSTEM_BUILD_PROP_ADDITIONAL_PATHS := etc/buildinfo/oem_build.prop;etc/prop.default

Change-Id: Ie0e25c7d2575d928310ff1b4fc1aef44a83784ca
2022-01-02 16:02:04 -05:00
bigbiff 922b121f31 libresetprop: use the latest header
Change-Id: I24656393cc84b1a978338fa587c535797d81c2a9
2022-01-01 18:36:43 +00:00
bigbiff a84acc7fa5 fscrypt v1: support legacy ioctl
Crosshatch uses a legacy ioctl for setting and getting fscrypt
policies. If the device is legacy, we will use the legacy ioctl.

Change-Id: I5c2e068f166b89fe9f7839a6d6a9533e49fc5b07
2021-12-31 15:44:50 +00:00
Captain Throwback 740d852518 vold_decrypt: only include patch_level functions with libresetprop
The functions use the Property_Override function from libresetprop,
so don't include if libresetprop isn't included in build

Change-Id: I5eb210f17fea908ec35cb223e4a55066419f55dc
2021-12-29 16:00:54 +00:00
nebrassy 7007c999f9 correct condition for change TWRP folder
Change-Id: I3549d3be3bf2d4557055b9ca48a84f88db44eca7
2021-12-26 20:53:06 +00:00
Adithya R a42c10d156 sepolicy: twrp: Mark ueventd as permissive
* required to load fw from non-hlos

Change-Id: I4ee82c7cd405d91d3a4e70c75591631c236bd94d
2021-12-26 17:04:00 +00:00
dianlujitao b20dfaa26d partitionmanager: Use boot HIDL to switch active slots
Change-Id: I7009380d7736f71e63d5558b6a447961cc1075c7
2021-12-26 17:02:41 +00:00
Captain Throwback 4076a67cd3 postrecoveryboot: rename script to reflect recovery mode
Change-Id: Ifb9d64a2bec118592523682749093bf894ec2cbe
2021-12-21 22:07:29 +00:00
Magendanz 37920d9d6e Replacing format string with one appropriate for 32-bit or 64-bit size.
Change-Id: I280f38ce000a5231795953b251ba2123545903ae
2021-12-12 15:01:25 -08:00
sekaiacg a202b5aa32 recovery: Fix the crash caused by StartIteration
In the new version of libziparchive, the default values ​​of the optional_prefix and optional_suffix parameters of the StartIteration function are changed to empty strings, and nullptr is no longer detected.

Change-Id: I66ee58a9515586700b10a3d5aa5b780a6207b33c
2021-12-12 17:34:03 +00:00
luoqiangwei1 cd1f4cac6f Fix the fuse error that cannot handle the OTA package larger than 4 GiB
1. That read data will be blocked when adb sideload OTA package
2. An error(Out of bound read) occurs when installing OTA package by fuse

Test: as follows
    - adb sideload OTA package
    - install OTA package by install_with_fuse parameter

Change-Id: Ie53510d157f6ea4c92606b289fcb745d441918c8
Signed-off-by: luoqiangwei1 <luoqiangwei1@xiaomi.com>
Signed-off-by: GarfieldHan <2652609017@qq.com>
2021-12-10 23:27:53 +00:00
GarfieldHan b3f6a26422 twrpinstall: Switch to ZipEntry64
The libziparchive TWRP using was outdated, not supported a zip
size more than 4 GiB. With the development of technologies,
Obviously it was not enough for ROM packages, like Xiaomi's
MIUI for Vitrual A/B devices (for example Redmi K40 [alioth])
is more than 4 GiB and TWRP couldn't handle it properly.
Since we have updated libziparchive to latest version, we could
switch ZipEntry to ZipEntry64 so that TWRP can support a ROM
package if its size more than 4 GiB.

Co-authored-by: sekaiacg <sekaiacg@gmail.com>
Signed-off-by: GarfieldHan <2652609017@qq.com>
Change-Id: Iee811554bb08e02bf2bd8e9057511f36caefdc9d
2021-12-10 23:19:17 +00:00
bigbiff 36cb2ad28e /sdcard: do not bind mount twice
Change-Id: I1757eb8732a01a728392c3499ac3300c81522806
2021-12-09 19:26:06 -05:00
Gao Xiang 70b83292d6 libblkid: add erofs filesystem support
Enhanced Read-Only File System (EROFS) has been included in Linux
kernel, many Linux distributions, buildroot and Android AOSP for
a while. Plus, nowadays, it's known that EROFS has been commercially
used by several Android vendors for their system partitions.

This patch adds support for detecting EROFS filesystem to libblkid.

Since util-linux/util-linux@cd129b7 introduced blkid_probe_set_block_size
function to report filesystem block size, TWRP is using blkid 2.25.0, which
means blkid_probe_set_block_size wasn't supported and required, so remove
the blkszbits judgement and blkid_probe_set_block_size for fixing building.

Test: Add erofs mount point to twrp.flags, build and boot
OP4A7A:/ # logcat | grep erofs
I (6)[571:recovery]erofs: (device dm-0): mounted with opts: , root inode @ nid 58.
I (6)[571:recovery]erofs: (device dm-9): mounted with opts: , root inode @ nid 43.
I (6)[571:recovery]erofs: (device dm-1): mounted with opts: , root inode @ nid 52.
I (6)[571:recovery]erofs: (device dm-10): mounted with opts: , root inode @ nid 45.
I (6)[571:recovery]erofs: (device dm-8): mounted with opts: , root inode @ nid 42.
I (0)[571:recovery]erofs: (device dm-12): mounted with opts: , root inode @ nid 38.
I (3)[571:recovery]erofs: (device dm-0): mounted with opts: , root inode @ nid 58.
I (3)[571:recovery]erofs: (device dm-1): mounted with opts: , root inode @ nid 52.
I (3)[571:recovery]erofs: (device dm-0): mounted with opts: , root inode @ nid 58.
I (3)[571:recovery]erofs: (device dm-0): mounted with opts: , root inode @ nid 58.
I (3)[571:recovery]erofs: (device dm-9): mounted with opts: , root inode @ nid 43.
I (2)[571:recovery]erofs: (device dm-1): mounted with opts: , root inode @ nid 52.
I (2)[571:recovery]erofs: (device dm-10): mounted with opts: , root inode @ nid 45.
I (2)[571:recovery]erofs: (device dm-8): mounted with opts: , root inode @ nid 42.
I (2)[571:recovery]erofs: (device dm-12): mounted with opts: , root inode @ nid 38.
I (6)[571:recovery]erofs: (device dm-0): mounted with opts: , root inode @ nid 58.
I (6)[571:recovery]erofs: (device dm-0): mounted with opts: , root inode @ nid 58.

OP4A7A:/ # cat /tmp/recovery.log | grep erofs
   Current_File_System: erofs
   Fstab_File_System: erofs
   Current_File_System: erofs
   Fstab_File_System: erofs
   Fstab_File_System: erofs
   Current_File_System: erofs
   Fstab_File_System: erofs
   Current_File_System: erofs
   Fstab_File_System: erofs
   Current_File_System: erofs
   Fstab_File_System: erofs
   Current_File_System: erofs
   Fstab_File_System: erofs

Now TWRP can recognize the EROFS filesystem perfectly after setting fs in twrp.flags

Signed-off-by: Gao Xiang <hsiangkao@redhat.com>
[@pomelohan: Adapt for TWRP's libblkid version and add erofs.c to build]
Co-authored-by: GarfieldHan <2652609017@qq.com>
Signed-off-by: GarfieldHan <2652609017@qq.com>
Change-Id: I00263757b5b6ed881165e65795ef849d86763165
2021-12-09 00:18:38 +00:00
sekaiacg cdc0319717 twrpinstall: Remove unnecessary CloseArchive() calls
The destructor MemoryPackage::~MemoryPackage() will automatically call CloseArchive(), so there is no need to repeat the operation to prevent Recovery from crashing.

Change-Id: Ife5d5818bc603f8709e998b856a1e97bc365fc87
2021-12-04 20:05:53 +08:00
kirillsvk 82fba90680 Russian language: fix spaces
Change-Id: I2e8a52421c4120cbdbc08de78a402c81fc3d73fd
(cherry picked from commit 8d6dbd86c9bc0396b6300dd19d1a7f4d96761bfb)
2021-12-03 23:05:04 +00:00
GarfieldHan d0b854b31d Add EROFS to file system check list
This commit will add EROFS Filesystem mount support

Since Huawei announced the new file system EROFS and successfully
merged into mainline. More and more OEMs switch the ext4 filesystem
to EROFS filesystem for system/vendor/odm/product partitions like
Oplus (OPPO / Realme / OnePlus).

Test: Import the latest fstab from system, build and boot. EROFS-based
partions like system and vendor partitions were sucessfully mounted.

Notes: Although I tried to change 'ext4' to 'erofs' for correct partition
in twrp.flags, but it was still recognized as 'ext4'. So you can just copy
the line related erofs partitions from recovery.fstab and TWRP will failed
to recognize the line in twrp.flags, and then skip this line, so the issue
was solved.

Signed-off-by: GarfieldHan <2652609017@qq.com>
Change-Id: I49a04e4465f1d92eb589ad6d86b6db9b58d720eb
2021-11-21 23:54:28 +08:00
nebrassy 0fc1ee2c1a twrpRepacker: override slot back after flashing
and move updating partition details to the function

Change-Id: I6f27ab1191246b6a23e625b0e3459db9024691c7
2021-11-21 03:33:59 +01:00
bigbiff ac43dd1179 unmapping super devices: do not remove ramdisk mountpoints
Change-Id: Iabd543e914887af78813805141604ae0ca1c812d
2021-11-21 01:43:09 +00:00
Captain Throwback a866b44f45 lpdump: only build for dynamic partition devices
Change-Id: Ia4a90681a6342cb5e4269ca3475376507b5d5260
2021-11-19 23:46:27 +00:00
Captain Throwback 4f19caa016 lptools: add to build
Use TW_EXCLUDE_LPTOOLS to exclude from build

Will only be included on devices with dynamic partitions

Change-Id: I77092344a1e31e749161cb31e6e020f6e9fc3800
2021-11-19 23:46:05 +00:00
nkk71 3c1e35f51c Adopted Storage: Add support for mixed mode sdcards
* Adds support for mixed adopted storage + removable
  storage partitioned sdcards.

* Also symlinks Adopted Storage datamedia folder to an
  available /sdcardN (N being 2 through 9) folder.

* Requires a suitable entry in fstab, for example:

    # Removable Storage
    /sd_ext ext4 /dev/block/mmcblk1p2 /dev/block/mmcblk1
        flags=storage;wipeingui;removable;encryptable=footer
    /external_sd vfat /dev/block/mmcblk1p1 /dev/block/mmcblk1
        flags=storage;wipeingui;removable;encryptable=footer

  /sd_ext will be the mountpoint for adopted storage, and /sdcardN
  will become symlinked to /sd_ext/data/media[/0]

* Fix adopted storage nickname being ""

* Output adopted partition info after successful decrypt

* Mimic single lun code for multi lun devices:
  "Mount CurrentStoragePath if it's not /data"

Change-Id: I3874c09f1a1c3a81f04277e17f17cc03ecb4184a
2021-11-18 19:47:13 +00:00
nebrassy 9a68408725 repacker: update partition details after switching slot
Change-Id: I9f6f396530ad40f70c02c917b01e9b8158add773
2021-11-18 18:40:57 +01:00
LinkBoi00 7ebe82a950 gui: theme: Switch to larger buttons in the reboot menu
Since the TWRP app button is gone from the reboot menu,
it would make sense to switch back to the larger buttons
for the slots and move down the active slot information
to fit the screen better

Change-Id: Iabf891da8799b063bb4902d583b67f0594b4fc19
2021-11-16 23:38:32 +00:00
bigbiff 5bcc1408c6 Merge "gui: theme: Remove the TWRP app button from the reboot menu" into android-11 2021-11-16 23:27:43 +00:00