[RECOVERY] [11-2-2013] Unofficial TWRP 2.6.3.0 for Nexus 5 - Nexus 5 Android Development

Unofficial Team Win Recovery Project version 2.6.3.0 for the Nexus 5​
Nexus 5 Stock Recovery Image
Downloads
Click to expand...
Click to collapse
Flashing Instructions
1. Download the above file.
2. Move the downloaded recovery file into the directory where you have ADB and Fastboot setup on your computer.
3. Navigate into the directory where you have ADB and Fastboot setup on your computer and run the following commands from the command prompt on your computer:
Code:
adb reboot bootloader
fastboot flash recovery twrp-hammerhead-build2.img
Congratulations you now have Team Win Recovery Project running on your Nexus 5.
Credits: Dees_Troy and Team Win for developing Team Win Recovery Project
F.A.Q
Q. What is Team Win Recovery Project and where can I find out more about it?
A. From the official Team Win Recovery site "Team Win Recovery Project 2.6, or twrp2 for short, is a custom recovery built with ease of use and customization in mind. We started from the ground up by taking AOSP recovery and loading it with the standard recovery options, then added a lot of our own features. It’s a fully touch driven user interface – no more volume rocker or power buttons to mash. The GUI is also fully XML driven and completely theme-able. You can change just about every aspect of the look and feel." If you would like to find out more about Team Win and Team Win Recovery Project please take a look at their website which can be found here.
Click to expand...
Click to collapse

Sweet. Thanks for sharing... and so fast
Sent from my SGH-I337M

wow, nexus 5 has development so fast!!! Can't wait for cm11:laugh:

Twrp too, fantastic!

I can confirm that this build of TWRP doesn't work. Good effort though. Just test the stuff next time , or there might be something device specific that made it work on yours but not mine/ours.
Sent from my Nexus 5 using Tapatalk

sewer56lol said:
I can confirm that this build of TWRP doesn't work. Good effort though. Just test the stuff next time , or there might be something device specific that made it work on yours but not mine/ours.
Sent from my Nexus 5 using Tapatalk
Click to expand...
Click to collapse
I appreciate you testing it, I don't have a Nexus 5 to test it or else I would have done that before. I have a feeling might have to wait for official builds to show up but I'll keep plugging away at it to see what I can do to fix it.

arDroid.99 said:
wow, nexus 5 has development so fast!!! Can't wait for cm10.3:laugh:
Click to expand...
Click to collapse
You mean CM11

@shimp208
Could you add the stock recovery into both of your recovery threads so people can reverse when their recoveries don't work?
I uploaded the stock Nexus 5 recovery for you.
http://www.mediafire.com/?9a4g4oks01zlpa6

sewer56lol said:
@shimp208
Could you add the stock recovery into both of your recovery threads so people can reverse when their recoveries don't work?
I uploaded the stock Nexus 5 recovery for you.
http://www.mediafire.com/?9a4g4oks01zlpa6
Click to expand...
Click to collapse
Thanks updated the Original Post to include the stock recovery image link you posted, as I mentioned I'll be looking into a solution for the problem of the recovery not booting in the meantime.

shimp208 said:
Unofficial Team Win Recovery Project version 2.6.0.3 for the Nexus 5
Click to expand...
Click to collapse
To be precise
recovery twrp-2.6.3.0

I can help you out with the mounting points I don´t have a Nexus5 yet, it may be experimental though. This is what I could grab out of the Stock Kernel´s RAMdisk..
Code:
/dev/block/platform/msm_sdcc.1/by-name/system /system ext4 ro,barrier=1 wait
/dev/block/platform/msm_sdcc.1/by-name/userdata /data ext4 noatime,nosuid,nodev,barrier=1,data=ordered,nomblk_io_submit,noauto_da_alloc,errors=panic wait,check,encryptable=/dev/block/platform/msm_sdcc.1/by-name/metadata
/dev/block/platform/msm_sdcc.1/by-name/cache /cache ext4 noatime,nosuid,nodev,barrier=1,data=ordered,nomblk_io_submit,noauto_da_alloc,errors=panic wait,check
/dev/block/platform/msm_sdcc.1/by-name/persist /persist ext4 nosuid,nodev,barrier=1,data=ordered,nodelalloc,nomblk_io_submit,errors=panic wait
/dev/block/platform/msm_sdcc.1/by-name/modem /firmware vfat ro,shortname=lower,uid=1000,gid=1000,dmask=227,fmask=337 wait
/dev/block/platform/msm_sdcc.1/by-name/boot /boot emmc defaults defaults
/dev/block/platform/msm_sdcc.1/by-name/recovery /recovery emmc defaults defaults
/dev/block/platform/msm_sdcc.1/by-name/misc /misc emmc defaults defaults
/dev/block/platform/msm_sdcc.1/by-name/modem /radio emmc defaults defaults
/dev/block/platform/msm_sdcc.1/by-name/sbl1 /sbl1 emmc defaults defaults
/dev/block/platform/msm_sdcc.1/by-name/tz /tz emmc defaults defaults
/dev/block/platform/msm_sdcc.1/by-name/rpm /rpm emmc defaults defaults
/dev/block/platform/msm_sdcc.1/by-name/sdi /sdi emmc defaults defaults
/dev/block/platform/msm_sdcc.1/by-name/aboot /aboot emmc defaults defaults
/dev/block/platform/msm_sdcc.1/by-name/imgdata /imgdata emmc defaults defaults

Awaiting a new version I'd like to know if we need to unlock the bootloader before flashing this recovery.

@shimp208
Can you share the TWRP flags. I've already made 'em but did'nt test as I don't have the device
---------- Post added at 02:12 PM ---------- Previous post was at 02:06 PM ----------
Primokorn said:
Awaiting a new version I'd like to know if we need to unlock the bootloader before flashing this recovery.
Click to expand...
Click to collapse
off course we should

mithun46 said:
@shimp208
Can you share the TWRP flags. I've already made 'em but did'nt test as I don't have the device
---------- Post added at 02:12 PM ---------- Previous post was at 02:06 PM ----------
off course we should
Click to expand...
Click to collapse
@mithun46 and @Gorgtech I'll be happy to work with you guys and anyone else to hopefully get this recovery fixed and booting properly as teamwork and community development is what makes XDA what it is
My build flags were pretty basic for TWRP that I added to BoardConfig.mk were:
Code:
DEVICE_RESOLUTION := 1080x1920
HAVE_SELINUX := true
And here is the recovery.fstab I was using:
Code:
# Android fstab file.
#<src> <mnt_point> <type> <mnt_flags and options> <fs_mgr_flags>
# The filesystem that contains the filesystem checker binary (typically /system) cannot
# specify MF_CHECK, and must come before any filesystems that do specify MF_CHECK
/dev/block/platform/msm_sdcc.1/by-name/system /system ext4 ro,barrier=1 wait
/dev/block/platform/msm_sdcc.1/by-name/userdata /data ext4 noatime,nosuid,nodev,barrier=1,data=ordered,nomblk_io_submit,noauto_da_alloc,errors=panic wait,check,encryptable=/dev/block/platform/msm_sdcc.1/by-name/metadata
/dev/block/platform/msm_sdcc.1/by-name/cache /cache ext4 noatime,nosuid,nodev,barrier=1,data=ordered,nomblk_io_submit,noauto_da_alloc,errors=panic wait,check
/dev/block/platform/msm_sdcc.1/by-name/persist /persist ext4 nosuid,nodev,barrier=1,data=ordered,nodelalloc,nomblk_io_submit,errors=panic wait
/dev/block/platform/msm_sdcc.1/by-name/modem /firmware vfat ro,shortname=lower,uid=1000,gid=1000,dmask=227,fmask=337 wait
/dev/block/platform/msm_sdcc.1/by-name/boot /boot emmc defaults defaults
/dev/block/platform/msm_sdcc.1/by-name/recovery /recovery emmc defaults defaults
/dev/block/platform/msm_sdcc.1/by-name/misc /misc emmc defaults defaults
/dev/block/platform/msm_sdcc.1/by-name/modem /radio emmc defaults defaults
/dev/block/platform/msm_sdcc.1/by-name/sbl1 /sbl1 emmc defaults defaults
/dev/block/platform/msm_sdcc.1/by-name/tz /tz emmc defaults defaults
/dev/block/platform/msm_sdcc.1/by-name/rpm /rpm emmc defaults defaults
/dev/block/platform/msm_sdcc.1/by-name/sdi /sdi emmc defaults defaults
/dev/block/platform/msm_sdcc.1/by-name/aboot /aboot emmc defaults defaults
/dev/block/platform/msm_sdcc.1/by-name/imgdata /imgdata emmc defaults defaults
If you want I can upload the recoveries unpacked ramdisk and related files if you want.

shimp208 said:
@mithun46 and @Gorgtech I'll be happy to work with you guys and anyone else to hopefully get this recovery fixed and booting properly as teamwork and community development is what makes XDA what it is
My build flags were pretty basic for TWRP that I added to BoardConfig.mk were:
Code:
DEVICE_RESOLUTION := 1080x1920
HAVE_SELINUX := true
And here is the recovery.fstab I was using:
Code:
# Android fstab file.
#<src> <mnt_point> <type> <mnt_flags and options> <fs_mgr_flags>
# The filesystem that contains the filesystem checker binary (typically /system) cannot
# specify MF_CHECK, and must come before any filesystems that do specify MF_CHECK
/dev/block/platform/msm_sdcc.1/by-name/system /system ext4 ro,barrier=1 wait
/dev/block/platform/msm_sdcc.1/by-name/userdata /data ext4 noatime,nosuid,nodev,barrier=1,data=ordered,nomblk_io_submit,noauto_da_alloc,errors=panic wait,check,encryptable=/dev/block/platform/msm_sdcc.1/by-name/metadata
/dev/block/platform/msm_sdcc.1/by-name/cache /cache ext4 noatime,nosuid,nodev,barrier=1,data=ordered,nomblk_io_submit,noauto_da_alloc,errors=panic wait,check
/dev/block/platform/msm_sdcc.1/by-name/persist /persist ext4 nosuid,nodev,barrier=1,data=ordered,nodelalloc,nomblk_io_submit,errors=panic wait
/dev/block/platform/msm_sdcc.1/by-name/modem /firmware vfat ro,shortname=lower,uid=1000,gid=1000,dmask=227,fmask=337 wait
/dev/block/platform/msm_sdcc.1/by-name/boot /boot emmc defaults defaults
/dev/block/platform/msm_sdcc.1/by-name/recovery /recovery emmc defaults defaults
/dev/block/platform/msm_sdcc.1/by-name/misc /misc emmc defaults defaults
/dev/block/platform/msm_sdcc.1/by-name/modem /radio emmc defaults defaults
/dev/block/platform/msm_sdcc.1/by-name/sbl1 /sbl1 emmc defaults defaults
/dev/block/platform/msm_sdcc.1/by-name/tz /tz emmc defaults defaults
/dev/block/platform/msm_sdcc.1/by-name/rpm /rpm emmc defaults defaults
/dev/block/platform/msm_sdcc.1/by-name/sdi /sdi emmc defaults defaults
/dev/block/platform/msm_sdcc.1/by-name/aboot /aboot emmc defaults defaults
/dev/block/platform/msm_sdcc.1/by-name/imgdata /imgdata emmc defaults defaults
If you want I can upload the recoveries unpacked ramdisk and related files if you want.
Click to expand...
Click to collapse
Try this
Code:
#TWRP config
DEVICE_RESOLUTION := 1080x1920
RECOVERY_SDCARD_ON_DATA := true
RECOVERY_GRAPHICS_USE_LINELENGTH := true
BOARD_HAS_NO_REAL_SDCARD := true
PRODUCT_BUILD_PROP_OVERRIDES += BUILD_UTC_DATE=0
TW_INCLUDE_JB_CRYPTO := true
TW_FLASH_FROM_STORAGE := true
TW_NO_USB_STORAGE := true
TW_INTERNAL_STORAGE_PATH := "/data/media"
TW_INTERNAL_STORAGE_MOUNT_POINT := "data"
TW_EXTERNAL_STORAGE_PATH := "/usb-otg"
TW_EXTERNAL_STORAGE_MOUNT_POINT := "usb-otg"

mithun46 said:
Try this
Code:
#TWRP config
DEVICE_RESOLUTION := 1080x1920
RECOVERY_SDCARD_ON_DATA := true
RECOVERY_GRAPHICS_USE_LINELENGTH := true
BOARD_HAS_NO_REAL_SDCARD := true
PRODUCT_BUILD_PROP_OVERRIDES += BUILD_UTC_DATE=0
TW_INCLUDE_JB_CRYPTO := true
TW_FLASH_FROM_STORAGE := true
TW_NO_USB_STORAGE := true
TW_INTERNAL_STORAGE_PATH := "/data/media"
TW_INTERNAL_STORAGE_MOUNT_POINT := "data"
TW_EXTERNAL_STORAGE_PATH := "/usb-otg"
TW_EXTERNAL_STORAGE_MOUNT_POINT := "usb-otg"
Click to expand...
Click to collapse
+1. I recommend this as well.
Sent from my Nexus 5 using Tapatalk

Original post has been updated with a new build of TWRP using updates build flags @mithun46. As always any feedback from testing is appreciated.

Flashed ok, but i cant boot into recovery
Thanks anyway :good:

Nope keeps hanging at the google logo

Why not flash this one? http://techerrata.com/file/twrp2/hammerhead/openrecovery-twrp-2.6.3.0-hammerhead.img
Works like a charme :good:

Related

[HOW TO]Device tree for building TWRP to your device

This thread is going to help you creating a device tree to make compatible to build TWRP for your device.
Inspired by this thread:http://forum.xda-developers.com/showthread.php?t=1943625
Requirements:
CM Source(Most compatible)
Knowledge about the risk and what are you doing
A working device tree of your phone
First we need to download TWP booteable recovery:
https://github.com/omnirom/android_bootable_recovery
Then remplace it with CM one.
After this we need our device tree:
Search for it on github or where you even want
For making life easier I recommend to look for other TWRP devices of same branch product etc...
Open BoardConfig.mk:
At the end add this FLAGS:
#TWRP
DEVICE_RESOLUTION := your resolution
Then use the following flags according to your device
More FLAGS:
In addition to the resolution, we have the following build flags:
RECOVERY_GRAPHICS_USE_LINELENGTH := true -- fixes slanty looking graphics on some devices
RECOVERY_SDCARD_ON_DATA := true -- this enables proper handling of /data/media on devices that have this folder for storage (most Honeycomb and devices that originally shipped with ICS like Galaxy Nexus)
BOARD_HAS_NO_REAL_SDCARD := true -- disables things like sdcard partitioning and may save you some space if TWRP isn't fitting in your recovery patition
TW_INCLUDE_DUMLOCK := true -- includes HTC Dumlock for devices that need it
This is how you would define dual storage for devices that have dual storage devices. For devices that have internal storage we usually define that as /emmc. Note that the mount point must match something in the recovery.fstab These flags are somewhat deprecated in TWRP 2.5+ but they are still used for a few things.
TW_INTERNAL_STORAGE_PATH := "/data/media"
TW_INTERNAL_STORAGE_MOUNT_POINT := "data"
TW_EXTERNAL_STORAGE_PATH := "/sdcard"
TW_EXTERNAL_STORAGE_MOUNT_POINT := "sdcard"
TW_NO_BATT_PERCENT := true -- disables the display of the battery percentage for devices that don't support it properly
TW_CUSTOM_POWER_BUTTON := 107 -- custom maps the power button for the lockscreen
TW_NO_REBOOT_BOOTLOADER := true -- removes the reboot bootloader button from the reboot menu
TW_NO_REBOOT_RECOVERY := true -- removes the reboot recovery button from the reboot menu
TW_NO_USB_STORAGE := true -- removes the USB storage button on devices that don't support USB storage
RECOVERY_TOUCHSCREEN_SWAP_XY := true -- swaps the mapping of touches between the X and Y axis
RECOVERY_TOUCHSCREEN_FLIP_Y := true -- flips y axis touchscreen values
RECOVERY_TOUCHSCREEN_FLIP_X := true -- flips x axis touchscreen values
TW_ALWAYS_RMRF := true -- forces the rm -rf option to always be on (needed for some Motorola devices)
TW_NEVER_UNMOUNT_SYSTEM := true -- never unmount system (needed for some Motorola devices)
TW_INCLUDE_INJECTTWRP := true -- adds ability to inject TWRP into some Samsung boot images for Samsung devices that have recovery as a second ramdisk in the boot image
TW_DEFAULT_EXTERNAL_STORAGE := true -- defaults to external storage instead of internal on dual storage devices (largely deprecated)
HAVE_SELINUX := true -- includes SELinux support for backup/restore, required for CM10.2 and requires CM10.0 or higher (CM9 and below do not have libselinux)
TWRP_EVENT_LOGGING := true -- enables touch event logging to help debug touchscreen issues (don't leave this on for a release - it will fill up your logfile very quickly)
Here's some flags that may help you, but are not specific to TWRP (works in CWM too):
This flag has multiple options, but can be used to set different graphics modes that may be need to correct color space issues on some devices:
TARGET_RECOVERY_PIXEL_FORMAT := "BGRA_8888"
TARGET_RECOVERY_PIXEL_FORMAT := "RGBX_8888"
TARGET_RECOVERY_PIXEL_FORMAT := "RGB_565"
BOARD_HAS_FLIPPED_SCREEN := true -- flips the screen upside down for screens that were mounted upside-down
TARGET_PREBUILT_RECOVERY_KERNEL := path/to/kernel -- use to specify a kernel specifically for building recovery
(ONLY IF IN YOU BOARDCONFIG IS THIS LINE:TARGET_RECOVERY_INITRC :=)
After we finnish it we need to PATH init.rc:
on init
export PATH /sbin
export LD_LIBRARY_PATH .:/sbin
(ONLY IF IN YOU BOARDCONFIG IS THIS LINE:TARGET_RECOVERY_INITRC :=)
Then we need to path the fstab;
EXAMPLE
Before
# Android fstab file.
# The filesystem that contains the filesystem checker binary (typically /system) cannot
# specify MF_CHECK, and must come before any filesystems that do specify MF_CHECK
#<src> <mnt_point> <type> <mnt_flags and options> <fs_mgr_flags>
/dev/block/mmcblk0p6 /modemfs ext4 noatime,nosuid,nodev,nomblk_io_submit,errors=panic wait,check
/dev/block/mmcblk0p10 /system ext4 errors=panic wait
/dev/block/mmcblk0p11 /data ext4 nosuid,nodev,noatime,noauto_da_alloc,journal_async_commit,nomblk_io_submit,errors=panic wait,check
/dev/block/mmcblk0p12 /cache ext4 noatime,nosuid,nodev,nomblk_io_submit,errors=panic wait,check
/dev/block/mmcblk0p9 /boot emmc defaults defaults
/dev/block/mmcblk0p9 /recovery emmc defaults defaults
# Internal SD Card
/devices/sdi4/mmc_host/mmc1/mmc1 auto auto nosuid,nodev wait,voldmanaged=sdcard0:14,nonremovable
# USB Disk
/devices/platform/musb-ux500.0/musb-hdrc /storage/usbdisk auto defaults
After
# mount point fstype device [device2] fstype2
/boot emmc /dev/block/mmcblk0p9
/system ext4 /dev/block/mmcblk0p10
/data ext4 /dev/block/mmcblk0p11
/cache ext4 /dev/block/mmcblk0p12
/sdcard vfat /dev/block/mmcblk0p14
More information:
*RECOVERY.FSTAB*
TWRP 2.5 and higher supports some new recovery.fstab features that you can use to extend TWRP's backup/restore capabilities. You do not have to add fstab flags as most partitions are handled automatically.
Note that TWRP does not currently support the "fstab 2" version of fstab files seen in AOSP 4.3 / CM10.2. You will still need to use the "old" format of fstab for TWRP. To maximize TWRP's compatibility with your build tree, you can create a twrp.fstab and use PRODUCT_COPY_FILES to place the file in /etc/twrp.fstab When TWRP boots, if it finds a twrp.fstab in the ramdisk it will rename /etc/recovery.fstab to /etc/recovery.fstab.bak and then rename /etc/twrp.fstab to /etc/recovery.fstab. Effectively this will "replace" the fstab 2 file that your device files are providing with the TWRP fstab allowing you to maintain compatibility within your device files and with other recoveries.
The fstab in TWRP can contain some "flags" for each partition listed in the fstab.
Here's a sample TWRP fstab for the Galaxy S4 that we will use for reference:
Code:
/boot emmc /dev/block/platform/msm_sdcc.1/by-name/boot
/system ext4 /dev/block/platform/msm_sdcc.1/by-name/system
/data ext4 /dev/block/platform/msm_sdcc.1/by-name/userdata length=-16384
/cache ext4 /dev/block/platform/msm_sdcc.1/by-name/cache
/recovery emmc /dev/block/platform/msm_sdcc.1/by-name/recovery
/efs ext4 /dev/block/platform/msm_sdcc.1/by-name/efs flags=display="EFS";backup=1
/external_sd vfat /dev/block/mmcblk1p1 /dev/block/mmcblk1 flags=display="Micro SDcard";storage;wipeingui;removable
/usb-otg vfat /dev/block/sda1 /dev/block/sda flags=display="USB-OTG";storage;wipeingui;removable
/preload ext4 /dev/block/platform/msm_sdcc.1/by-name/hidden flags=display="Preload";wipeingui;backup=1
/modem ext4 /dev/block/platform/msm_sdcc.1/by-name/apnhlos
/mdm emmc /dev/block/platform/msm_sdcc.1/by-name/mdmFlags are added to the end of the partition listing in the fstab separated by white space (spaces or tabs are fine). The flags affect only that partition but not any of the others. Flags are separated by semicolons. If your display name is going to have a space, you must surround the display name with quotes.
Code:
/external_sd vfat /dev/block/mmcblk1p1 flags=display="Micro SDcard";storage;wipeingui;removable
The flags for this partition give it a display name of "Micro SDcard" which is displayed to the user. wipeingui makes this partition available for wiping in the advanced wipe menu. The removable flag indicates that sometimes this partition may not be present preventing mounting errors from being displayed during startup. Here is a full list of flags:
removable -- indicates that the partition may not be present preventing mounting errors from being displayed during boot
storage -- indicates that the partition can be used as storage which makes the partition available as storage for backup, restore, zip installs, etc.
settingsstorage -- only one partition should be set as settings storage, this partition is used as the location for storing TWRP's settings file
canbewiped -- indicates that the partition can be wiped by the back-end system, but may not be listed in the GUI for wiping by the user
userrmrf -- overrides the normal format type of wiping and only allows the partition to be wiped using the rm -rf command
backup= -- must be succeeded by the equals sign, so backup=1 or backup=0, 1 indicates that the partition can be listed in the backup/restore list while 0 ensures that this partition will not show up in the backup list.
wipeingui -- makes the partition show up in the GUI to allow the user to select it for wiping in the advanced wipe menu
wipeduringfactoryreset -- the partition will be wiped during a factory reset
ignoreblkid -- blkid is used to determine what file system is in use by TWRP, this flag will cause TWRP to skip/ignore the results of blkid and use the file system specified in the fstab only
retainlayoutversion -- causes TWRP to retain the .layoutversion file in /data on devices like Sony Xperia S which sort of uses /data/media but still has a separate /sdcard partition
symlink= -- causes TWRP to run an additional mount command when mounting the partition, generally used with /data/media to create /sdcard
display= -- sets a display name for the partition for listing in the GUI
storagename= -- sets a storage name for the partition for listing in the GUI storage list
backupname= -- sets a backup name for the partition for listing in the GUI backup/restore list
length= -- usually used to reserve empty space at the end of the /data partition for storing the decryption key when Android's full device encryption is present, not setting this may lead to the inability to encrypt the device
canencryptbackup= -- 1 or 0 to enable/disable, makes TWRP encrypt the backup of this partition if the user chooses encryption (only applies to tar backups, not images)
userdataencryptbackup= -- 1 or 0 to enable/disable, makes TWRP encrypt only the userdata portion of this partition, certain subfuldes like /data/app would not be encrypted to save time
subpartitionof= -- must be succeeded by the equals sign and the path of the partition it is a subpartition of. A subpartition is treated as "part" of the main partition so for instance, TWRP automatically makes /datadata a subpartition of /data. This means that /datadata will not show up in the GUI listings, but /datadata would be wiped, backed up, restored, mounted, and unmounted anytime those operations are performed on /data. A good example of the use of subpartitions is the 3x efs partitions on the LG Optimus G:
Code:
/efs1 emmc /dev/block/mmcblk0p12 flags=backup=1;display=EFS
/efs2 emmc /dev/block/mmcblk0p13 flags=backup=1;subpartitionof=/efs1
/efs3 emmc /dev/block/mmcblk0p14 flags=backup=1;subpartitionof=/efs1
This lumps all 3 partitions into a single "EFS" entry in the TWRP GUI allowing all three to be backed up and restored together under a single entry.
For compiling:
make -j4 bootimage( if your device has recovvery inside boot)
OR
make -j4 recoveryimage (if your device can flash recovery.img
Thanks
thanks for this !

[Q] Is contents of Custom Recovery APK useful in obtaining custom recovery for vs985?

So I did some exploring in the posted custom recovery by AnZhi. There was some discussion over which partitions could be accessed. There is an fstab file in there that can be modified which should allow access to other partitions...
Recovery.fstab
Code:
# Android fstab file.
# The filesystem that contains the filesystem checker binary (typically /system) cannot
# specify MF_CHECK, and must come before any filesystems that do specify MF_CHECK
#<src> <mnt_point> <type> <mnt_flags> <fs_mgr_flags>
/dev/block/platform/msm_sdcc.1/by-name/system /system ext4 defaults defaults
/dev/block/platform/msm_sdcc.1/by-name/cache /cache ext4 defaults defaults
/dev/block/platform/msm_sdcc.1/by-name/userdata /data ext4 defaults defaults
/dev/block/platform/msm_sdcc.1/by-name/boot /boot emmc defaults defaults
/dev/block/platform/msm_sdcc.1/by-name/recovery /recovery emmc defaults defaults
Looking further it seems this works by overwriting the files in /system/recovery. The process can't be that simple... can it?
Also there is a keys file with a bunch of cryptic hex codes....not quite sure what they're used for.... useful?
I'm a very experienced programmer, but new when it comes to android bootloader/recovery exploit development.
Any ideas guys? What can we learn by perusing this apk?
PS
Newbies.... To see the contents of an apk file just rename *.apk to *.zip and unzip it
I'm also new to bootloaders, we can probably pull a fstab from a rooted g3 and edit the existing one from there
I'm Also curious to see what's in the apk, I'll extract it to see if I can gather some more info
Sent from my VS985 4G using XDA Premium 4 mobile app

Where is boot partition?

Hi, i'm searching for the boot partition on Xperia mini pro and i can't find it. On other devices it's usually '/dev/block/mtdblockx' but on this device it's not.
There is no /boot directory at all. I'm wondering why we should use fastboot to flash boot.img instead of flashing it with the device itself ? (like some other devices)
I'm using Legacy xperia cm 13.0 and i this is 'fstab.semc' file in the root directory:
Code:
# Android fstab file.
#<src> <mnt_point> <type> <mnt_flags> <fs_mgr_flags>
# The filesystem that contains the filesystem checker binary (typically /system) cannot
# specify MF_CHECK, and must come before any filesystems that do specify MF_CHECK
/dev/null /boot mtd defaults defaults
/dev/null /recovery mtd defaults defaults
/dev/block/mtd/by-name/system /system yaffs2 ro wait
/dev/block/mtd/by-name/cache /cache yaffs2 rw,noatime,nosuid,nodev wait
/dev/block/mmcblk0p1 /data f2fs rw,discard,nosuid,nodev,noatime,nodiratime,inline_xattr wait,check,formattable
/dev/block/mmcblk0p1 /data ext4 noatime,nosuid,nodev,data=ordered,noauto_da_alloc,journal_async_commit,errors=panic wait,check
# Vold managed devices
/devices/platform/msm_hsusb_host.0* auto auto defaults voldmanaged=usb:auto
# zRAM
/dev/block/zram0 none swap defaults zramsize=134217728
How is this possible? Why it's pointing to /dev/null ?
I'm just wondering which partition fastboot uses to flash the kernel img ? And is this possible for us to find the partition and flash the kernel with phone using dd ?
Can anyone explain it to me?
Thank you.

[Support] Perfect boot image - disable verity and forced encrypt

ive created a boot.img maybe someone can try and report back - in theory it should speed up /data /system and /cache partitions by the fstab flags set.
also uploaded the default boot.img from oxygen 4-7-5 (please make sure you're on 4-7-5) maybe someone can help fix this if it doesnt work.
please note this may wipe all storage / etc etc take all necessary precautions (external backup etc) until we get it working 100% as i havent tested
this work is open to anyone who'd like to use it.
Cliffs
- ive modified boot.img to try and disable verity and force encrypt - also enabling / disabling certain IO functions to improve throughput
- i need someone to go into twrp > flash the modifiedboot.img then format /data and check if it boots (i.e boots into OS if it does please report back)
-please make all necessary backups incase it doesnt work
-attached stock boot.img incase it doesnt work (please make external backup too)
here are my attempts:
Modified boot.img:
https://drive.google.com/open?id=154jrUAQ1oq7Fpjw7PgBKCJ_E6yBCxvaQ
stock boot.img
https://drive.google.com/open?id=17JU_OiEGdGm_9K1TcYlFtEkiiTJmODve
please report back if it works or not (i.e does it boot into OS or hang?)
background
my previous android phones ive created a perfect boot image whereby i edit the fstab in the boot.img
to disable force encryption and apply other android attributed in the fstab.
however i do not yet have my 1+5T as of yet so i can not try the edits as the boot.img is alittle different from my previous android phones.
The stock boot.img for the oneplus 5T (extracted from 4-7-5)
has two fstab files
the first fstab.qcom, and the second fstab_nodata.qcom
both these fstab are alittle different.
fstab.qcom looks like this:
Code:
#<src> <mnt_point> <type> <mnt_flags and options> <fs_mgr_flags>
/dev/block/bootdevice/by-name/system /system ext4 ro,barrier=1,discard,errors=panic wait,verify
/dev/block/bootdevice/by-name/userdata /data f2fs noatime,nosuid,nodev,discard,nodiratime,inline_xattr wait,check,forceencrypt=footer,resize
/dev/block/bootdevice/by-name/userdata /data ext4 nosuid,nodev,barrier=1,noauto_da_alloc,discard,errors=panic wait,check,fileencryption=ice,resize
#/devices/soc/c0a4900.sdhci/mmc_host* /storage/sdcard1 vfat nosuid,nodev wait,voldmanaged=sdcard1:auto,encryptable=footer
/dev/block/zram0 none swap defaults zramsize=536870912
/dev/block/bootdevice/by-name/misc /misc emmc defaults defaults
/dev/block/bootdevice/by-name/modem /firmware vfat ro,shortname=lower,uid=1000,gid=1000,dmask=227,fmask=337,context=u:object_r:firmware_file:s0 wait
/dev/block/bootdevice/by-name/bluetooth /bt_firmware vfat ro,shortname=lower,uid=1002,gid=3002,dmask=227,fmask=337,context=u:object_r:bt_firmware_file:s0 wait
/dev/block/bootdevice/by-name/cache /cache ext4 rw,nosuid,nodev,barrier=1 wait,check
/devices/soc/a800000.ssusb/a800000.dwc3/xhci-hcd.0.auto/usb* auto auto defaults voldmanaged=usbotg:auto
and fstab_nodata.qcom looks like this:
Code:
#<src> <mnt_point> <type> <mnt_flags and options> <fs_mgr_flags>
/dev/block/bootdevice/by-name/system /system ext4 ro,barrier=1,discard wait,verify
#/dev/block/bootdevice/by-name/userdata /data ext4 nosuid,nodev,barrier=1,noauto_da_alloc,discard,errors=panic wait,check,forceencrypt=footer,resize
tmpfs /data tmpfs defaults defaults
#/devices/soc/c0a4900.sdhci/mmc_host* /storage/sdcard1 vfat nosuid,nodev wait,voldmanaged=sdcard1:auto,encryptable=footer
/dev/block/zram0 none swap defaults zramsize=536870912
/dev/block/bootdevice/by-name/misc /misc emmc defaults defaults
/dev/block/bootdevice/by-name/modem /firmware vfat ro,shortname=lower,uid=1000,gid=1000,dmask=227,fmask=337,context=u:object_r:firmware_file:s0 wait
/dev/block/bootdevice/by-name/bluetooth /bt_firmware vfat ro,shortname=lower,uid=1002,gid=3002,dmask=227,fmask=337,context=u:object_r:bt_firmware_file:s0 wait
/dev/block/bootdevice/by-name/cache /cache ext4 rw,nosuid,nodev,barrier=1 wait
/devices/soc/a800000.ssusb/a800000.dwc3/xhci-hcd.0.auto/usb* auto auto defaults voldmanaged=usbotg:auto
as you can see these two files are alittle different - previous android devices have only had one fstab file.
so my first question why are there two fstab files? - anywho ive added my modifications to both where applicable.
secondly the modified fstab id like to introduce is the following:
Code:
/dev/block/bootdevice/by-name/system /system ext4 ro,noatime,noauto_da_alloc,nodev,nodiratime,barrier=0,data=writeback,nobh wait
/dev/block/bootdevice/by-name/userdata /data f2fs nosuid,nodev,noatime,nodiratime,discard,inline_data,inline_xattr wait,check,encryptable,resize
/dev/block/bootdevice/by-name/userdata /data ext4 noatime,nosuid,nodev,nodiratime,barrier=0,data=writeback,noauto_da_alloc,discard,nobh wait,check,encryptable,resize
/dev/block/bootdevice/by-name/cache /cache ext4 rw,nosuid,nodev,noatime,noauto_da_alloc,nodiratime,barrier=0,data=writeback,nobh wait,check
virtyx said:
Hi guys
my previous android phones ive created a perfect boot image whereby i edit the fstab in the boot.img
to disable force encryption and apply other android attributed in the fstab.
however i do not yet have my 1+5T as of yet so i can not try the edits as the boot.img is alittle different from my previous android phones.
The stock boot.img for the oneplus 5T (extracted from 4-7-5)
has two fstab files
the first fstab.qcom, and the second fstab_nodata.qcom
both these fstab are alittle different.
fstab.qcom looks like this:
and fstab_nodata.qcom looks like this:
as you can see these two files are alittle different - previous android devices have only had one fstab file.
so my first question why are there two fstab files? - anywho ive added my modifications to both where applicable.
secondly the modified fstab id like to introduce is the following:
ive created a boot.img maybe someone can try and report back - in theory it should speed up /data /system and /cache partitions by the fstab flags set.
also uploaded the default boot.img from oxygen 4-7-5 (please make sure you're on 4-7-5) maybe someone can help fix this if it doesnt work.
please note this may wipe all storage / etc etc take all necessary precautions (external backup etc) until we get it working 100% as i havent tested
this work is open to anyone who'd like to use it.
here are my attempts:
Modified boot.img:
https://drive.google.com/open?id=1BYH4J3Du9VBRyxM1hyTQhs_hKNLgOU0W
stock boot.img
https://drive.google.com/open?id=1IpByGusbuWXKOXGKamHHEwax3aSnsvfm
please report back if it works or not (i.e does it boot into OS or hang?)
Click to expand...
Click to collapse
You also need to make the kernel compatible, without verity. Otherwise won't boot
jgcaap said:
You also need to make the kernel compatible, without verity. Otherwise won't boot
Click to expand...
Click to collapse
please read OP again as ive done this
by default force encryption on /data is enabled, and dm-verify is enabled...boot.img needs to be modified to disable. also /data will have to be formatted to flash ROMS.
with dm-verify enabled, any changes to /system will cause no boot
to modify boot.img:
Code:
open /ramdisk/fstab.qcom
change:
/dev/block/bootdevice/by-name/system /system ext4 ro,barrier=1 wait,verify
/dev/block/bootdevice/by-name/userdata /data ext4 nosuid,nodev,barrier=1,noauto_da_alloc,discard,errors=continue wait,check,formattable,forceencrypt=/dev/block/bootdevice/by-name/extra
to:
/dev/block/bootdevice/by-name/system /system ext4 ro,barrier=1 wait
/dev/block/bootdevice/by-name/userdata /data ext4 nosuid,nodev,barrier=1,noauto_da_alloc,discard,errors=continue wait,check,formattable,encryptable=/dev/block/bootdevice/by-name/extra
virtyx said:
If we flash the boot.Img then another kernel may it work? @jgcaap how would we get it to work?
Never needed to do that on a previous android
Click to expand...
Click to collapse
You need to compile kernel that will allow to boot without the verity and change the ram disk.
benny3 said:
by default force encryption on /data is enabled, and dm-verify is enabled...boot.img needs to be modified to disable. also /data will have to be formatted to flash ROMS.
with dm-verify enabled, any changes to /system will cause no boot
to modify boot.img:
Code:
open /ramdisk/fstab.qcom
change:
/dev/block/bootdevice/by-name/system /system ext4 ro,barrier=1 wait,verify
/dev/block/bootdevice/by-name/userdata /data ext4 nosuid,nodev,barrier=1,noauto_da_alloc,discard,errors=continue wait,check,formattable,forceencrypt=/dev/block/bootdevice/by-name/extra
to:
/dev/block/bootdevice/by-name/system /system ext4 ro,barrier=1 wait
/dev/block/bootdevice/by-name/userdata /data ext4 nosuid,nodev,barrier=1,noauto_da_alloc,discard,errors=continue wait,check,formattable,encryptable=/dev/block/bootdevice/by-name/extra
Click to expand...
Click to collapse
which is why ive asked users to format /data before flashing the boot.img which should disable verity and forceencrypt
jgcaap said:
You need to compile kernel that will allow to boot without the verity and change the ram disk.
Click to expand...
Click to collapse
this is what im doing...
so if someone is brave enough to test this (as i dont have a 1+5T yet)
format /data then using mtp trasnfer the modifiedboot.img to the phone, then flash modified boot.img
and see if you can boot into OS if you can please report back.
updated the modifiedboot.img to omit discard flag - should slightly improve performance but requires a cron job to manually trim partitions, automatic trim can cause hangs upon large file deletion, plus i dont find the need to run trim on the block layer every time a file is deleted, i would rather run it daily with a cron job.
Isn't this what the disable force encryption and disable no verity zip is for? To flash over stock boot image and allow boot on a decrypted device by disabling Force encryption and no verity.?
yung40oz84 said:
Isn't this what the disable force encryption and disable no verity zip is for? To flash over stock boot image and allow boot on a decrypted device by disabling Force encryption and no verity.?
Click to expand...
Click to collapse
yes, those zips only remove verity and force encryption
this boot img includes other tweaks not found elsewhere (ie, data writeback, barrier=0, noatime, nodiratime, noautoalloc, disabling auto-trim, etc) which all theoretically should improve throughput while reducing overhead
virtyx said:
yes, those zips only remove verity and force encryption
this boot img includes other tweaks not found elsewhere (ie, data writeback, barrier=0, noatime, nodiratime, noautoalloc, disabling auto-trim, etc) which all theoretically should improve throughput while reducing overhead
Click to expand...
Click to collapse
Doesn't the auto-trim flag keeps the NAND flash healthy and prevents data corruption? ?
ground-zero said:
Doesn't the auto-trim flag keeps the NAND flash healthy and prevents data corruption? ?
Click to expand...
Click to collapse
No, doesnt prevent corruption.
we dont need the trim command to run every time a file is deleted that just causes unnecessary overhead, its better if we run the trim command daily via a cron job.
(imagine deleting files and running the trim command everytime we do so, its not needed, the OS does adequate garbage collection and the Trim command gets issued automatically from android 5 so its not needed to add it in the fstab)
for your reading
https://wiki.archlinux.org/index.php/Solid_State_Drives#Periodic_TRIM

Bugged - no chance to fix?

Hi everybody
Currently i have attached a F1 to my pc which has some weird conditions...
The phone itself seems to be flashed to latest LineageOS, but it is encrypted.
Maybe because of the latest sideload, i can't really tell because the owner gave this to a friend...
So, prefered solution would be: decrypt the phone, get all the pictures/videos from it.
Another acceptable solution would be: install from scratch.
But:
fastboot seems to be botched.
Code:
C:\adb>adb devices
List of devices attached
22fd65f3 recovery
Looking good, adb can access this device.
So, if i could flash some decrypt-voodoo that the device boots and decrypts system...
But no, failing so far.
Then i thought, well, as it is already gone, just fastboot flash and forward.
Nope:
Code:
C:\adb>fastboot devices
???????????? fastboot
And the device goes back to bootloop.
Booting to recovery gives me a TWRP 3.5.2_10-0
Full access, except the encrypted data.
recovery is fully working, so i tried to flash vbmeta with fastboot (--disable-verity --disable-verification) but fastboot seems to be broken.
So... any thoughts where to start first?
Thx
I pulled fstab from phone:
twrp.fstab
Code:
# Android fstab file.
# The filesystem that contains the filesystem checker binary (typically /system) cannot
# specify MF_CHECK, and must come before any filesystems that do specify MF_CHECK
# mount point type device device2 flags
/boot emmc /dev/block/bootdevice/by-name/boot flags=display="Boot"
/cache ext4 /dev/block/bootdevice/by-name/cache
/recovery emmc /dev/block/bootdevice/by-name/recovery flags=display="Recovery";backup=1
/system ext4 /dev/block/bootdevice/by-name/system flags=backup=1;wipeingui;display="System"
/vendor ext4 /dev/block/bootdevice/by-name/vendor flags=backup=1;wipeingui;display="Vendor"
/system_image emmc /dev/block/bootdevice/by-name/system flags=backup=1;flashimg=1
/vendor_image emmc /dev/block/bootdevice/by-name/vendor flags=backup=1;flashimg=1
/data ext4 /dev/block/bootdevice/by-name/userdata flags=encryptable=footer;length=-16384;fileencryption=ice:aes-256-cts:aes-256-heh
/firmware vfat /dev/block/bootdevice/by-name/modem flags=display="Firmware";mounttodecrypt
/cust ext4 /dev/block/bootdevice/by-name/cust flags=display="Cust"
/misc emmc /dev/block/bootdevice/by-name/misc
/modem emmc /dev/block/bootdevice/by-name/modem flags=backup=1;display="Modem"
/bluetooth emmc /dev/block/bootdevice/by-name/bluetooth flags=backup=1;subpartitionof=/modem
/dsp emmc /dev/block/bootdevice/by-name/dsp flags=backup=1;subpartitionof=/modem
/efs1 emmc /dev/block/bootdevice/by-name/modemst1 flags=backup=1;display=EFS
/efs2 emmc /dev/block/bootdevice/by-name/modemst2 flags=backup=1;subpartitionof=/efs1
/efsc emmc /dev/block/bootdevice/by-name/fsc flags=backup=1;subpartitionof=/efs1
/efsg emmc /dev/block/bootdevice/by-name/fsg flags=backup=1;subpartitionof=/efs1
/persist ext4 /dev/block/bootdevice/by-name/persist flags=display="Persist"
/storage ext4 /data/media/0 flags=display="Internal Storage";usermrf;backup=1;fsflags="bind";removable
# Removable storage
/usb_otg vfat /dev/block/sdg1 /dev/block/sdg flags=display="USB-OTG";storage;wipeingui;removable
/external_sd vfat /dev/block/mmcblk0p1 /dev/block/mmcblk0 flags=display="MicroSD Card";storage;wipeingui;removable
recovery.fstab
Code:
# Android fstab file.
# The filesystem that contains the filesystem e2fsck binary (typically /system) cannot
# specify 'check', and must come before any filesystems that do specify 'check'
# NOTE: /system and /vendor partitions are early-mounted and the fstab entry is specified in device tree (duplicated below for recovery image purposes only):
# /proc/device-tree/firmware/android/fstab/system
# /proc/device-tree/firmware/android/fstab/vendor
#<src> <mnt_point> <type> <mnt_flags and options> <fs_mgr_flags>
/dev/block/bootdevice/by-name/userdata /data ext4 noatime,nosuid,nodev,barrier=0,noauto_da_alloc latemount,wait,check,fileencryption=ice,quota,encryptable=footer
/dev/block/bootdevice/by-name/modem /vendor/firmware_mnt vfat ro,shortname=lower,uid=0,gid=1000,dmask=227,fmask=337,context=u:object_r:firmware_file:s0 wait
/dev/block/bootdevice/by-name/dsp /vendor/dsp ext4 ro,nosuid,nodev,barrier=1 wait
/dev/block/bootdevice/by-name/persist /mnt/vendor/persist ext4 noatime,nosuid,nodev,barrier=1 wait
/dev/block/bootdevice/by-name/bluetooth /vendor/bt_firmware vfat ro,shortname=lower,uid=1002,gid=3002,dmask=227,fmask=337,context=u:object_r:bt_firmware_file:s0 wait
/dev/block/bootdevice/by-name/cache /cache ext4 noatime,nosuid,nodev,barrier=1 wait
/dev/block/bootdevice/by-name/misc /misc emmc defaults defaults
/dev/block/bootdevice/by-name/boot /boot emmc defaults recoveryonly
/dev/block/bootdevice/by-name/recovery /recovery emmc defaults recoveryonly
/dev/block/bootdevice/by-name/system /system ext4 ro,barrier=1 wait,recoveryonly
/dev/block/bootdevice/by-name/vendor /vendor ext4 ro,barrier=1 wait,recoveryonly
/devices/platform/soc/8804000.sdhci/mmc_host* /storage/sdcard1 vfat nosuid,nodev wait,voldmanaged=sdcard1:auto,encryptable=footer
/devices/platform/soc/a600000.ssusb/a600000.dwc3/xhci-hcd.0.auto* /storage/usbotg vfat nosuid,nodev wait,voldmanaged=usbotg:auto
and the regular fstab
Code:
/dev/block/sda20 /cache ext4 rw 0 0
/dev/block/sde48 /system_root ext4 ro 0 0
/dev/block/sde47 /vendor ext4 ro 0 0
/dev/block/sda21 /data ext4 rw 0 0
/dev/block/sde46 /firmware vfat rw 0 0
/dev/block/sda18 /cust ext4 rw 0 0
/dev/block/sda14 /persist ext4 rw 0 0
/storage ext4 rw 0 0
/usb_otg vfat rw 0 0
/external_sd vfat rw 0 0
Lonesome Walker said:
Hi everybody
Currently i have attached a F1 to my pc which has some weird conditions...
The phone itself seems to be flashed to latest LineageOS, but it is encrypted.
Maybe because of the latest sideload, i can't really tell because the owner gave this to a friend...
So, prefered solution would be: decrypt the phone, get all the pictures/videos from it.
Another acceptable solution would be: install from scratch.
But:
fastboot seems to be botched.
Code:
C:\adb>adb devices
List of devices attached
22fd65f3 recovery
Looking good, adb can access this device.
So, if i could flash some decrypt-voodoo that the device boots and decrypts system...
But no, failing so far.
Then i thought, well, as it is already gone, just fastboot flash and forward.
Nope:
Code:
C:\adb>fastboot devices
???????????? fastboot
And the device goes back to bootloop.
Booting to recovery gives me a TWRP 3.5.2_10-0
Full access, except the encrypted data.
recovery is fully working, so i tried to flash vbmeta with fastboot (--disable-verity --disable-verification) but fastboot seems to be broken.
So... any thoughts where to start first?
Thx
Click to expand...
Click to collapse
If the phone doesn't recognize in fastboot you need the fix and the drivers.
You can find everything you need in my POCO F1 Ultimate Collection & Guides.
Check AMD/Intel Fastboot Fix.
If you know pin/pattern you can flash the TWRP by REIGNZ go to recovery put pin/pattern to decrypt then connect your device to pc while you are in twrp (if MTP doesn't work at first go advanced>file manager> and choose sdcard0 (internal storage) then your device shoule recognized in pc and get your data.
To clean flash follow my clean installation guide.
Everything you need is on my thread I mentioned above.
Okay, this is interesting...
My own Poco F1 had no issues with the drivers installed before.
After updating, the actual bugged F1 can fastboot but my own can't anymore.
WTF?
I also switched cables, doesn't matter.
Okay, nevertheless, mine is not broken, so this will be a task for later...
Thank you so far for this working hint!
So, i now finally have rescued all the pictures, videos and Whatsapp stuff.
My friend is happy.
The next step would be flashing the Pixel Experience.
But: how to find out which Android version is currently installed?
Or should i flash the latest stock rom from Xiaomi? I mean, it can't be higher than that, right?
Thank you for your response!

Categories

Resources