twrp
twrp copied to clipboard
End-of-Life: No updates are planned after version 3.1.N0-0.
Fork of TWRP
This fork differs from the original in the following ways:
- Designed to be built with LineageOS 14.1 only
- Encrypted backups are disabled by default due to poor implementation, see TWRP Issue #817
- Customize the mksh prompt and environment by editing
mksh/mkshrc - Require fstab v2 syntax (see examples and supported flags below)
- Use external repositories for pigz, exfat, fuse
- SuperSU and HTC Dumlock have been removed
adb backupis not implemented due to concerns about code quality- Other minor customizations (see change history)
BusyBox vs. Toybox
This fork is ready to rock with toybox... if only toybox were a truly suitable replacement for busybox. Specify TW_USE_TOYBOX := true to replace busybox with toybox, but be aware that many recovery installable packages depend on tools in busybox like awk that are not present in toybox, as well as arguments to available tools like --ignore-fail-on-non-empty for rmdir and -empty for find that are also missing. So, venture at your own risk.
The BusyBox repository at LineageOS can be synced by adding the following to your local manifest:
<project name="LineageOS/android_external_busybox" path="external/busybox" remote="github" />
At last check (May 4, 2017), LineageOS' busybox repository still needs this patch.
To Do
- Fix hard-coding of alternate block device search (code link)
- Support vold-formatted entries in fstab (e.g.
/devices/platform/msm_hsusb_host/usb*instead of/dev/block/sda1)
Versioning
To help distinguish builds of recovery made from this fork, the minor version digit is replaced with M#. Minor version increments will be handled as needed, independent of TWRP. The major and semi-major version digits follow upstream to roughly indicate feature parity (as close as possible with a fork, anyways).
Convention:
3.0.M0-0incorporates all major features from TWRP3.0.0-03.0.M1-0is the minor version increment after3.0.M0-0and is independent of any TWRP minor version increment(s)3.1.M0-0is the semi-major version increment after3.0.M4-2and is tied to a TWRP semi-major version increment3.0.M0-1is a device-specific fix to3.0.M0-0; this device digit resets when any other version increments
Examples of fstab v2 for TWRP
Example fstab v2 for device mt2:
Worth noting in this example: encryptable= does not need to be specified if encryption keys are stored at the footer of /data. This is the default, assumed location.
# device mount_point fstype mount_flags fs_mgr_flags twrp_flags
/dev/block/platform/msm_sdcc.1/by-name/boot /boot emmc defaults defaults
/dev/block/platform/msm_sdcc.1/by-name/cache /cache ext4 noatime,nosuid,nodev defaults
/dev/block/platform/msm_sdcc.1/by-name/userdata /data ext4 noatime,nosuid,nodev,noauto_da_alloc length=-16384
/dev/block/platform/msm_sdcc.1/by-name/modem /firmware vfat ro defaults twrp=display="Firmware";mounttodecrypt
/dev/block/platform/msm_sdcc.1/by-name/log /log ext4 defaults defaults twrp=display="Log"
/dev/block/platform/msm_sdcc.1/by-name/misc /misc emmc defaults defaults
/dev/block/platform/msm_sdcc.1/by-name/recovery /recovery emmc defaults defaults
/dev/block/platform/msm_sdcc.1/by-name/system /system ext4 defaults defaults
/dev/block/mmcblk1p1 /external_sd vfat defaults defaults twrp=display="MicroSD";storage;wipeingui;removable
/dev/block/sda1 /usb-otg vfat defaults defaults twrp=display="USB OTG";storage;wipeingui;removable
Example fstab v2 for device jewel:
# device mount_point fstype mount_flags fs_mgr_flags twrp_flags
/dev/block/platform/msm_sdcc.1/by-name/boot /boot emmc defaults defaults
/dev/block/platform/msm_sdcc.1/by-name/cache /cache ext4 noatime,nosuid,nodev defaults
/dev/block/platform/msm_sdcc.1/by-name/userdata /data ext4 noatime,nosuid,nodev,noauto_da_alloc encryptable=/dev/block/platform/msm_sdcc.1/by-name/extra
/dev/block/platform/msm_sdcc.1/by-name/devlog /devlog ext4 noatime,nosuid,nodev defaults twrp=display="Devlog"
/dev/block/platform/msm_sdcc.1/by-name/misc /misc emmc defaults defaults
/dev/block/platform/msm_sdcc.1/by-name/recovery /recovery emmc defaults defaults
/dev/block/platform/msm_sdcc.1/by-name/system /system ext4 noatime defaults
/dev/block/mmcblk1p1 /external_sd vfat defaults defaults twrp=display="MicroSD";storage;wipeingui;removable
/dev/block/sda1 /usb-otg vfat defaults defaults twrp=display="USB OTG";storage;wipeingui;removable
Supported fstab v2 flags in TWRP
Recognized mount flags (Column 4):
Syntax: comma separated
binddefaultsnoatimenodevnodiratimenoexecnosuidprivaterecremountrorwsharedslaveunbindable
Recognized fs_mgr flags (Column 5):
Syntax: comma separated
defaultsencryptable=length=
Recognized twrp flags (Column 6):
Syntax: semicolon separated, begin with twrp=
Example: twrp=display="Firmware";mounttodecrypt
andsecbackup=backupname=blocksize=canbewipedcanencryptbackup=display=encryptable=flashimgforceencrypt=ignoreblkidlength=mounttodecryptremovableretainlayoutversionrwsettingsstoragestoragestoragename=subpartitionof=symlink=userdataencryptbackup=usermrfwipeduringfactoryresetwipeingui