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
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
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
The functions use the Property_Override function from libresetprop,
so don't include if libresetprop isn't included in build
Change-Id: I5eb210f17fea908ec35cb223e4a55066419f55dc
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
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>
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
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
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
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
Use TW_EXCLUDE_LPTOOLS to exclude from build
Will only be included on devices with dynamic partitions
Change-Id: I77092344a1e31e749161cb31e6e020f6e9fc3800
* 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
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
* Since commit 168bc4caaedfdf655a71ba24a1c5a7f2b905a122 the vendor partition gets unmounted prior to switching the slots. However, devices without a vendor partition (e.g. tissot's stock partition table) will have errors since the partition doesn't actually exist
* Therefore, it should be only mounted if that partition exists in the partition table
Change-Id: Id16ab55e25d05964ca0de1bf218914d66c2b0205
Support for '--special_update_package' command from boot message
For example realmeUI 2.0 using this command for boot message to install OTA packages
--special_update_package=/data/ota_package/OTA/.otaPackage/system_vendor_19720.1.3.202108120000042554318_patch
Change-Id: I7d1a49a3e05a439d4c96717c1700dd063f4e55c4
In A12 format of XML files changed to Android Binary XML
TWRP uses RapidXML to parse XMLs, but it don't support ABX format
So before parse check format of XML format and if it is in ABX, just ignore it for now
Change-Id: Ie40f5b3534db50143999984be22ade1d1af162e7
In A12 keymaster_key_blob format changed
Compared to A11 it contains another new 8 bytes at beginning "pKMblob\0" (in hex 0x704B4D626C6F6200)
We can just ignore them
Change-Id: I8a1701a248be536fdd000b9011122ef954c8e4d1
Starting in Android 10, zygote relies on stored inodes in order
to find packages in the user's CE directories. Since TWRP cannot
force inode creation on restore, we warn the user to remove their
pin before restoring their backup. Otherwise zygote may not load
properly in Android. This will force the system to update the
inode cache.
The user can then re-add their security settings to android.
Change-Id: I8f07962d07304dee54c08318efc500dca424b6c0