yashsingh1/xdaforums huggingface dataset:
[Samsung Galaxy Nexus] Ziyan:
New build attached with USB-OTG fixed.

AOSP tends to install the AOSP recovery for itself :/ but fastboot should always work. Alternatively, you can simply flash any recovery img using terminal emulator if you're rooted, or you can use adb through usb (even if you're not rooted).
[Samsung Galaxy Nexus] Master94ga:
With the twrp 2.8.7.0 the rom AOSP created by you never overwritten the recovery, this is the first time and is also the first time I used the twrp 3.0.2.0.

However for the installation of the recovery I can't used terminal because I'm not rooted, a guide to use adb through usb? :)

Currently the phone work perfecly, the problem is that I have the default recovery, I don't have root and fastboot is not working.
[Samsung Galaxy Nexus] Ziyan:
Try this after enabling USB debugging from the developer settings, and installing adb and the drivers on the PC:

adb root
adb push twrp.img /sdcard/
adb shell "dd if=/sdcard/twrp.img of=/dev/block/platform/omap/omap_hsmmc.0/by-name/recovery"
adb reboot recovery
[Samsung Galaxy Nexus] massoudsh:
Thank you [MENTION=2633638]Ziyan[/MENTION], now USB-OTG work for me[emoji4] [emoji4] [emoji4]
[Samsung Galaxy Nexus] Master94ga:
You are awesome, it worked :good:
[Samsung Galaxy Nexus] osm0sis:
It depends on

a) whether you told TWRP not to modify the system partition, since this stops it from preventing the stock install-recovery.sh script from running, and

b) whether you installed SuperSU, since it's SELinux changes also prevent stock recovery, without needing to write to system.
[Samsung Galaxy Nexus] Master94ga:
On twrp when it start I selected read only, and about supersu I just flash the zip ;)
[Samsung Galaxy Nexus] osm0sis:
Okay well with read-only, the only way to prevent stock over-write is with SuperSU, and it works fine on my end, so I'm guessing you forgot to flash SuperSU when you had the issue. :good:
[Samsung Galaxy Nexus] bamtan2:
This is a good point! I think I lucked out and chose the right option for this. But I could have chosen the other and been screwed up.
[Samsung Galaxy Nexus] Master94ga:
Yes, I flashed only the rom and gapps :)
[Samsung Galaxy Nexus] Ziyan:
Here's hopefully the last unofficial build of TWRP. Compared to the previous build, the only change in this one is the support for the OMAP hardware backed encryption - in other words, this build should decrypt /data encrypted using newer ROMs using hardware backed encryption. Please try and report back how it works (also try out decrypting on older ROMs still using the software encryption).
[Samsung Galaxy Nexus] bamtan2:
FYI [MENTION=4750792]phaleg[/MENTION], [MENTION=5405242]norton75[/MENTION], [MENTION=6598907]spryka[/MENTION], [MENTION=5038522]tomasz86[/MENTION], [MENTION=6906944]PythonNut[/MENTION], [MENTION=6979267]nailyk[/MENTION], [MENTION=6204913]n76[/MENTION], [MENTION=7479668]htc-2016[/MENTION]

[MENTION=2633638]Ziyan[/MENTION] and friends have made some changes, and TWRP needs testing to check if 1) encryption is fixed, and 2) the F2FS restore bug is fixed (http://xdaforums.com/showpost.php?p=65625960&postcount=3940) !

PS: [MENTION=5290873]tlwhitec[/MENTION] and I have each committed $10 USD to whoever fixes the F2FS restore bug. (I need to repeat this to remind myself ;))
[Samsung Galaxy Nexus] n76:
As a test, I've just installed the twrp-3.0.2-0-maguro-decrypt-test.img file linked to by [MENTION=2633638]Ziyan[/MENTION] and then booted into recovery. It asked for my /data password and, after a little churning, claimed that it had successfully mounted it. I tried it again, to verify I could read files and got a message that it successfully decrypted /data but then rebooted into Android. On the third try, I played with the menus to see if I could actually access /data and was able to see various files and folders on my encrypted /data.

So I'd say it is working, with the caveat that I had a unexplained reboot which is a bit worrying.

I am running my own build of the 5.1 OMAP4 AOSP ROM on a Maguro. My /data partition is formatted as F2FS and is encrypted and the normal Settings->Security area shows it with a "Storage Type" of "Hardware-backed".

edit: I haven't ever tried backup/restore via recovery as none of the recovery images I'd used before could handle encrypted F2FS. I normally use adb backup, but also rely on the fact that all the important data on the phone is shared to my laptop either via SyncThing (some directories) or via my CalDav/CardDav/IMAP server.
[Samsung Galaxy Nexus] phaleg:
Awesome,

should I flash it before the newest build of your OMAP rom?
[Samsung Galaxy Nexus] massima:
I haven't flashed the latest OMAP4 yet but the OTG works!!!!!
[Samsung Galaxy Nexus] nailyk:
Some bad news from my maguro: cm13.0 (hardware-encrypted), with this test-decrypt version, the dm-0 seems to be created (i see 'Successful decrypted' on the log), but when twrp 'Update partition details' the recovery freeze, then the phone reboot. So no logs :(

I can't test with the cm12.1 as my backup is on the sdcard....

Many thanks for your work!

P.S.: my mounts point from cm13 if it can help

/dev/block/platform/omap/omap_hsmmc.0/by-name/system on /system type ext4 (ro,seclabel,relatime,user_xattr,barrier=1)
/dev/block/platform/omap/omap_hsmmc.0/by-name/efs on /factory type ext4 (ro,seclabel,relatime,user_xattr,barrier=1,data=ordered)
/dev/block/platform/omap/omap_hsmmc.0/by-name/dgs on /tee type ext4 (rw,seclabel,nosuid,nodev,noatime,user_xattr,barrier=1,nomblk_io_submit)
/dev/block/platform/omap/omap_hsmmc.0/by-name/cache on /cache type f2fs (rw,seclabel,nosuid,nodev,noatime,background_gc=on,discard,user_xattr,inline_xattr,active_logs=6)
/dev/block/dm-0 on /data type f2fs (rw,seclabel,nosuid,nodev,noatime,background_gc=on,discard,user_xattr,inline_xattr,active_logs=6)

Edit: it is build with unsecure adb, so i attach some logs. I dump the dmesg with

for i in {001..999}; do adb shell dmesg > ./dmesg_maguro$i.log && sleep 1 ; done;

so there is some dmesg part missing.
[Samsung Galaxy Nexus] Ziyan:
It seems like both of you are using f2fs, so the problem is possibly related to that (I only tested ext4) - would you guys mind posting /proc/last_kmsg after the unexpected reboot? That should contain the error :)
[Samsung Galaxy Nexus] nailyk:
The last kmesg on my device is incomplete. But i edit my first post with some logs, maybe you can find some information on it?

What should i look for?

P.S.: part of last_kmesg only contain this:

[ 35.511688] tf_aes_save_registers: aes_state(c2afe0c0) <- paes_reg(c9400000): CTRL=0x00000028
[ 35.511688] tf_crypto_disable_clock: clock_paddr=0x4A0095A0
[ 35.511688] tf_clock_timer_stop
[ 35.511688] tf_crypto_enable_clock: clock_paddr=0x4A0095A0
[ 35.511688] tf_clock_timer_start

repeated in infinite loop.
[Samsung Galaxy Nexus] Ziyan:
I'm not sure what you mean by incomplete :) the last few lines are the ones I'd like to see from last_kmsg, but just post the whole file really. The part you posted here is normal verbose logging turned on in the kernel of that twrp build.
[Samsung Galaxy Nexus] nailyk:
Sure. Here it is. (too big to fit in xda attachement).
[Samsung Galaxy Nexus] PythonNut:
Hey sorry I'm late. Has anyone tested the F2FS restore? If not, I can test tomorrow.
[Samsung Galaxy Nexus] PythonNut:
F2FS restore worked fine for me!
[Samsung Galaxy Nexus] ExecutorElassus:
Ziyan, I understand you're looking for people to test your TWRP on encrypted storage, yes?

I'm running maguro on a 1st-gen Galaxy Nexus, which is no longer officially supported by the TWRP team. I currently have 2.8.4.0 installed against CyanogenMod 13, and it is completely unable to mount encrypted storage (it doesn't even ask for a password; 2.7.1.0 did ask for a password, but it always failed [despite being the correct pw]). If there's any way I can help get a working version of TWRP for my device, I'll gladly offer my phone for beta testing: as it is, I can't install gapps, and thus can't install anything from the Play Store (and thus can't get my phone up to full working order).

Thanks in advance.

Cheers,

EE
[Samsung Galaxy Nexus] musical_chairs:
Link is here, just a few pages back.
[Samsung Galaxy Nexus] ExecutorElassus:
Tried it. It said it successfully decrypted storage (huzzah!), but then gave no further terminal output, and then just rebooted the phone (into the regular system, not recovery).

Was I supposed to input something more? Is there a timeout?

Cheers.
[Samsung Galaxy Nexus] n76:
What is the format of you /data area. My Maguro is formatted as F2FS and I had that reboot happen to me once out of three tries. Other two tried is worked great. Not sure what the issue is for the reboot, but it may be file system specific as Ziyan reports that his tests using ext4 work fine.
[Samsung Galaxy Nexus] ExecutorElassus:
Dumb question: how do I find this out? Like I said, it's an older phone, so I suspect it's probably ext4. But I'm not 100% sure. Is this something I can find out through adb, or internally?

Also: I tried booting into recovery again. This time, after the password worked and it decrypted storage (and created the /dm-crypt volume) it got a little further, but then froze and booted into system again. Is there any way to get logs of what might be going wrong here?

Cheers
[Samsung Galaxy Nexus] musical_chairs:
It would be ext4 by default, unless somebody intentionally reformatted it to f2fs.

Regarding logs, if you have access to a computer, boot into recovery, plug it in (USB), and run 'adb logcat' in a terminal on the computer. Or, better yet, 'adb logcat > log.txt' which will dump the log to a text file. (I'm a Linux user, so not sure if that's exactly how it would be done on Windows or another OS.) Then attempt to decrypt. Also, after it reboots, copy /proc/last_kmsg off the phone. That may give more info than the logcat in this case.
[Samsung Galaxy Nexus] n76:
To find out how you /data area is formatted:

$ mount | grep /data

/dev/block/dm-0 /data f2fs rw,seclabel,nosuid,nodev,noatime,background_gc=on,discard,user_xattr,inline_xattr,active_logs=6 0 0

shell@tuna:/ $ exit

Sorry, but I've not had to debug recovery so I don't know how to get a log from it.
[Samsung Galaxy Nexus] ExecutorElassus:
Thanks. OK, so /data is formatted as ext4. I'll work on pulling the logs off later this week when I have a bit more time.

Cheers
[Samsung Galaxy Nexus] ExecutorElassus:
Well, now I'm trying to install OpenGApps, wiping the system partition, and then re-installing CM, then OpenGApps, then wiping dalvik and cache. TWRP freezes and reboots when I try to flash the CM ROM, and then it won't boot. So now I'm kinda stuck. Did I just brick my phone? :(
[Samsung Galaxy Nexus] bamtan2:
Flashing opengapps just copies files to system. Flashing a ROM deletes /system and recreates it from scratch, but sometimes runs a script which reinstalls old gapps after. In any case, all you need to do to flash a rom is: flash ROM, flash opengapps, and wipe dalvik at the end. In the event of a major upgrade, you may need a factory reset of ALL data, because many bugs are brought across a major upgrade.

I have no advice for fixing bricks ;( When strange things happen, the experts here will recommend you operate from the ADB command line. I don't know how to do that, so I use skipsoft toolkit or wugfresh toolkit.
[Samsung Galaxy Nexus] ExecutorElassus:
So here's where I am: I have CyanogenMod 13.0-20160803.zip and a couple different versions of opengapps on my internal storage. I can boot into recovery if I cold boot and hold all the buttons down. From there, I'm into twrp, using the latest version from this thread. I can mount and wipe partitions, etc. However, if I try to install that cyanogenmod image, it runs for a while, but then stops and reboots. When it reboots, it freezes on the first Google logo and goes no further.

I've wiped /system, also dalvik and cache , but I still can't get cyanogenmod to install successfully (and since it apparently wiped /system, it also won't boot). So, since I can't presently use the phone past TWRP, what are my options for fixing this?

EDIT: I'm not dead set on using cyanogenmod, if there's a better ROM out there. Any suggestions, if I can't get this one to install? But I kinda suspect that this is a problem with TWRP failing to flash for some reason, so I'd like to try to get that right. Incidentally, the reason I tried flashing system was because I was unable to install the gapps-nano package, because I apparently didn't have enough space on system. Is that expected for this phone? I remember reading that the system storage on this one is stupidly small.

Cheers
[Samsung Galaxy Nexus] bamtan2:
All current roms are based on the same work (@Ziyan's and others), so no matter which you choose, you're staying in the family :)

If TWRP reboots while flashing, that sounds like a serious problem. You can try flashing a different rom, of course. But I hope someone will suggest a way to record the TWRP log so developers can see what is going wrong.
[Samsung Galaxy Nexus] runekock:
It could be a hardware problem: either overheating, or your storage is defective.

I would try installing the last factory image from Google.
[Samsung Galaxy Nexus] ExecutorElassus:
I'm reluctant to accuse the hardware for this, since the failures all started when I tried installing CM13, and then the TWRP-3.* recovery. When trying to flash the ROM again, the temp never gets above about 57°.

Devs, is there any way I can work on debugging this? Is there a way to attempt flashing the ROM image through adb? anything that might be able to leave a log?

Cheers
[Samsung Galaxy Nexus] n76:
In your recovery select "sideload". In TWRP it is under advanced.

On your desktop computer: "adb sideload path/to/image/file"

Until the recent test version of TWRP by Ziyan this was the only way I could flash a ROM as I could not get TWRP to mount my encrypted F2FS /data. I still use this method, mostly because I am now used to it and it fits my workflow pretty well.
[Samsung Galaxy Nexus] ExecutorElassus:
Whoa hey, so I can use adb on the phone while in recovery? Excellent. Do I need to mount the /system partition beforehand, or can I simply proceed with sideloading as you describe it? The /path is the path to the image on my local installation, yes? Not the copy on the phone?

Guess I'll try it out and see what happens.

Cheers

UPDATE: Hot damn, sideloading worked! I had to get a newer version of the Android SDK/platform-tools, but it successfully patched the image and booted. Huzzah!

Now I have the problem of not being able to install the opengapps package. It still fails with an Error 70 (ie, not enough space). I'll see if maybe the "pico" version will squeeze on. Anyway, it seems there's a problem with the twrp not being able to flash the ROM, but I can work around it with the sideloading, so I'm good. Progress!
[Samsung Galaxy Nexus] bamtan2:
ONLY the smallest opengapps fits on Galaxy Nexus with newer ROMs. The ROM threads have a link to REPIT which you can flash to resize your /system to be larger. But it's not necessary because the smallest opengapps should work fine :)
[Samsung Galaxy Nexus] ExecutorElassus:
Thanks, bantam. I sideloaded the "pico" version, and it seems to have installed. However, now it keeps crashing when I log into the phone. So I tried rebooting into recovery: that didn't work; it reboots the system right after I enter the pw to decrypt storage. I cold-boot into the bootloader to boot recovery there, which worked, but then when I tried wiping dalvik and cache, it rebooted into the system again. I'll keep plugging away at it. Aside from apparently being super crashy with installing ROMs and opengapps, the phone works fine, so I'm not willing to give up yet.

Cheers

UPDATE: New information. cold-booted into twrp. From there, I sideloaded opengapps with the instruction to wipe dalvik and cache. That worked. Now, when I boot, though, I get stuck in a constant loop of "Unfortunately, Setup Wizard has stopped" error messages. Is there any way around this?
[Samsung Galaxy Nexus] bamtan2:
I think some of what you're seeing is CM13 issues. CM13 cannot work if opengapps is installed after CM13 boots, and there is also a bug with the setup wizard and lock screen right now. You can see more about this in the last 10-20 pages of the CM13 thread. I suggest CM12 instead.
[Samsung Galaxy Nexus] Reptilez_DK:
You could make a gapps-config file, and exclude Provision (android setupwizard [can't remember the spelling]) or exclude cmsetupwizard. It is the clash of those two, that make the setupwizard crash. :)

---------- Post added at 06:40 AM ---------- Previous post was at 06:37 AM ----------

Also, if you flash cm and Gapps in separate processes, you need to confirm that permissions is enabled for your Gapps.
[Samsung Galaxy Nexus] ExecutorElassus:
I gave Google Play Services all permissions, and it still constantly crashes. How about this: would I get around this issue if I 1) boot into recovery, 2) wipe /system, 3) flash/sideload CM13, 4) flash opengapps, 5) wipe dalvik and cache, and only then 6) boot the system?

cheers
[Samsung Galaxy Nexus] Reptilez_DK:
That didn't work for me, but it might for you. :)

I had to make a gapps-config file, and remove one of the setupwizards.

https://github.com/opengapps/opengapps/wiki/Advanced-Features-and-Options

https://github.com/opengapps/opengapps/wiki/Notes-for-CMSetupWizard
[Samsung Galaxy Nexus] bamtan2:
This is a question for the CM13 thread, but the broken data is on /data not /system, so flashing won't help. I think you would need to wipe everything with a factory reset to fix this particular problem.
[Samsung Galaxy Nexus] ExecutorElassus:
I should clarify: my issue right now is specifically with the Google Play Services app, which is causing a SecurityException by trying to use the ACCESS_FINE_LOCATION permission. I no longer have the google Setup Wizard installed, as I followed the advice on this thread and STRAIGHT-UP COLD MURDERED THE **** OUT OF IT by deleting it from the TWRP file manager.

But later on that thread says this isn't the best solution. Also, despite giving Play Services all permissions from the regular Settings menu, it still crashes.

When I click the little dots on the upper right of the permissions list it shows All Permissions. How do I enable all of these? Or, if Play Services is the program with the issue, does disabling the CM Setup Wizard fix this?

Cheers

---------- Post added at 11:06 AM ---------- Previous post was at 11:03 AM ----------

Sigh, you're right. I'll bring this issue over to the CM13 thread. My issue with TWRP is actually still mostly the same: It fails tko mount encrypted storage if I reboot into recovery (I have to shut the phone down, then boot into the bootloader, then boot recovery), and even then I have issues with it rebooting while flashing a ROM. It seems to not happen if I keep touching the screen to keep it from locking, but I'm not sure if that's the issue. Any guesses?

Cheers
[Samsung Galaxy Nexus] mirhl:
Hope not to be too late, but I wonder if this F2FS issue might not be related to the famous one about inline_data switch.
[Samsung Galaxy Nexus] KemikalElite:
I'm using ext4 (checked in recovery), still getting the reboots, and haven't changed anything partition related, so I don't think its f2fs.

The first time I loaded recovery with a password it loaded normally, I tried two more times and it rebooted on both.

I've removed my password and as I've tested it TWRP seems to decrypt fine with the default password.

As a workaround for now I guess I can just remove the password when I want to flash anything in TWRP.
[Samsung Galaxy Nexus] iPlasm:
http://xdaforums.com/showpost.php?p=67975081&postcount=2014

My tryings:

1- First time, I flashed your new v3.0.2 recovery via fastboot adb shell successfully <> I entered recovery and it showed the twrp with warning unmodified System Partition, okay so I could select to tick to don't show the warning again, but suddenly it rebooted, entered recovery and something happened, so for few seconds after warning it will reboot.

2- Second time trying, I flashed the old v2 Recovery from official twrp using fast boot, then flashed yours recovery via TWRP installing img. This really worked for awhile for about a week, but after I wanted to install new ROMs (with wiping partitions using twrp) successfully, I entered recovery with same warning unmodified System Partition and it rebooted for about few seconds, so just same as first.

3- repeated my last two times trying, none of them works now!

I’m having problem with this, whatever I do I can’t use your shiny v3 recovery + F2FS file format.

I hope this will be a good information for future updates
[Samsung Galaxy Nexus] bamtan2:
This could be very important for [MENTION=2633638]Ziyan[/MENTION] and friends to see, so thank you for coming here to share your knowledge! :)
[Samsung Galaxy Nexus] iPlasm:
Fantastic New!

Official TWRP Recovery version 3.0.2-0 for Nexus

Download link site: https://dl.twrp.me/maguro/twrp-3.0.2-0-maguro.img.html

Thanks to all of you and all who helped Maguro/Nexus live!
[Samsung Galaxy Nexus] Ziyan:
It could be worth noting that I didn't include support for hardware backed decryption in this one, as it seemed problematic for some people for some reason :) other than that, it built upon the omni trees without any modifications.
[Samsung Galaxy Nexus] osm0sis:
Still seeing the following in the AROMA Filemanager terminal/console where it wasn't present before on TWRP 2.8.7.0 and is not present other devices:

CANNOT LINK EXECUTABLE: cannot locate symbol "prlimit" referenced by "/system/xbin/ls"...
page record for 0x402be04c was not found (block_size=32)

Steps to reproduce:

1) CM nightly as ROM, TWRP 3.0.2-0 official or any [MENTION=2633638]Ziyan[/MENTION] unofficial, AROMA FM 2.00b7.

1) Set AROMA FM to automount all partitions.

2) Exit and restart AROMA FM.

3) Open AROMA FM's terminal/console.

4) It will already have linking errors from hostname/pwd at the prompt, but I typed `ls` for the above loggable output.

Again, doesn't happen on any other device or older versions of TWRP, so there must be something weird with the compiles of the libs in these TWRP builds that they're missing this symbol making them incompatible for the basic shell commands like pwd and ls.
[Samsung Galaxy Nexus] iPlasm:
Well, you did your best with your friends, and those companies should really make just one specific model :cool: (united) rather than multiple models of the Device.

I like to request from you dear Ziyan and Dees_Troy; please edit this thread of the first page to include these new changes for Nexus + plus remember the title name should be changed also. I can help if new thread is needed to be created, or whatever you prefer :angel:

Have a nice Time :highfive:
[Samsung Galaxy Nexus] vortex-5:
Just out of curiosity guys if you have /data formatted to F2FS in recovery MTP no longer works correctly I suspect this is the way it is in that the recovery kernel only supports ext4 MTP.

Anyone know for sure or is this a known issue they are planning to address later? (BTW it's ok I'll just do the standard ADB pull)
[Samsung Galaxy Nexus] phaleg:
Does it work normally with your last OMAP build for Maguro? :highfive:
[Samsung Galaxy Nexus] KemikalElite:
If you're referring to the ROM build, Yes It works with all current ROMs.
[Samsung Galaxy Nexus] phaleg:
Yes, I felt there might be problem with encryption between this recovery and the rom...

(maguro rom is in my signature)
[Samsung Galaxy Nexus] KemikalElite:
The new official build from the TWRP website doesn't work with encryption enabled. It won't be able to write or read /data or the internal storage.

ADB Sideload still works to flash updates though.

http://xdaforums.com/showpost.php?p=67975081&postcount=2014

The build at that post "works" with encryption with random reboot issues.
[Samsung Galaxy Nexus] phaleg:
Up to now, I did not have any reboot, fingers crossed !

Today I flashed the newer TWRP from official channel and at first boot of recovery it asked something to keep it normal or swipe to allow modification.

Not sure if I did it right, but I swiped to allow it, was it a correct choice?