yashsingh1/xdaforums huggingface dataset:
[Google Pixel 3 XL Guides, News, & Discussion] ultimatepichu:
I just finished setup and checked those files too. I adb pull out the files.

Yeah, my morning reading has paid off, a little. Thanks to a bunch of people on the hint about /persist.

My suspicion was I saw a semi functional GPS in GPS Status & Toolbox app in Android 10 (see attachment), and semi functional Pressure Sensor (which disappeared after reboot) while trying to explain to various google support teams what is wrong with our device.

Can you adb pull the registry folder out? I'd like to compare yours to mine.

I can already see from screenshot from both of you that the bmi160 has different file sizes for both of you.

Now the problem is... what do we do from here lol.
[Google Pixel 3 XL Guides, News, & Discussion] David B.:
Perhaps it could be as simple as getting a copy of the good files from someone that is not having the problem and pasting them in to place? I would certainly be willing to try it. In the worst case, I just have to reflash my phone.

---------- Post added at 12:55 AM ---------- Previous post was at 12:48 AM ----------

I am trying to see if I can extract the vendor.img file, but apparently it's a nonstandard format and I cannot open it even in a Linux VM.
[Google Pixel 3 XL Guides, News, & Discussion] ffchampmt:
Can't adb pull atm, but here's a copy/zip came from the mnt/vendor/.... path
[Google Pixel 3 XL Guides, News, & Discussion] David B.:
I am going to try copying and pasting in to place. I figure that at worst, I'll just have to reinstall the OTA.

---------- Post added at 01:18 AM ---------- Previous post was at 01:11 AM ----------

Scratch that. Apparently copying and pasting doesn't even allow for all files to be copied over. Might still be able to fix this by writing a Magisk module?

---------- Post added at 01:42 AM ---------- Previous post was at 01:18 AM ----------

I am pretty sure that the way to work this out is to write a Magisk module the loads the sensor files where they belong, but it's almost 3AM where I am and I probably will not have time to try to figure out how to make one tomorrow. :( Perhaps someone else can give it a go?
[Google Pixel 3 XL Guides, News, & Discussion] UltraPower31:
Is there anyone that has ever used TWRP that can confirm that his sensors are working on Android Q? I mean I see TWRP writing to this partition for whatever reason.
[Google Pixel 3 XL Guides, News, & Discussion] FcukBloat:
yes for sure i know some people that was running custom rom (so was using twrp) and got q working.

so maybe it is a particular version of twrp?

[MENTION=1615926]ultimatepichu[/MENTION] many thanks for all your time and dedication invested into this troubleshooting ;)
[Google Pixel 3 XL Guides, News, & Discussion] ultimatepichu:
Well, the good side, and in this case the bad side, of Android 10 - We are unable to modify system files anymore. The only way is, as you said, Magisk systemless over it. But I have 0 clue how to do this.

I saw the feature to mount /persist is added not long ago,

though I don't know what's the point of mounting it in twrp-3.3.1-2-crosshatch.img while I cannot wipe or do anything about it.

Anyway, it's my interest to dig around codings and it only costs me some sleeping hours (around 4h sleep per day since a week ago for this) :highfive:
[Google Pixel 3 XL Guides, News, & Discussion] FcukBloat:
I'm on blueline, so maybe the problem happened when i flashed the test twrp img by bigbiff?

i mean this:

https://xdaforums.com/pixel-3-xl/development/twrp-3-2-3-0-pixel-3-xl-t3861623/post79995400

do other blueline users have sensors bug having only used official twrp versions for blueline?

ps. see your PM ;)
[Google Pixel 3 XL Guides, News, & Discussion] ultimatepichu:
If you check your TWRP, it has the option to mount /persist. Default is on. Maybe that affects.
[Google Pixel 3 XL Guides, News, & Discussion] sliding_billy:
Perhaps you remember that test version was posted by big bigbiff i response to my question about blueline support on the crosshatch thread. I have had my wife's blueline on every version of TWRP released for it including that test version (even though I didn't really need it since I never did a factory reset that would have caused loss of decryption). I installed blueline .19 build with a flash-all (minus -w), and sensors worked fine before and after. I never had that phone on a custom ROM or on any of the 10 beta builds. I didn have the canary Magisk Manager on it for a little while (long enough for it to pull at least one canary build of Magisk itself and get rebooted multiple times). Feel free to shoot me a PM if you need any additional info since this thread can be a bit overwhelming for someone not impacted - my crosshatch is on Havoc OS an I am in no hurry to move it to 10.
[Google Pixel 3 XL Guides, News, & Discussion] UltraPower31:
I have a crosshatch device and I only used official TWRP versions.

I just don't understand why TWRP is modifying the partition by writing on it. Maybe the update checked the sha sum of persist and didn't update it because the sha sum didn't match the expected sum because TWRP modified it.
[Google Pixel 3 XL Guides, News, & Discussion] saxmydix:
That's what i thought too, but it fixed when i flash custom rom. Most of the user face this after may security update.
[Google Pixel 3 XL Guides, News, & Discussion] nikhilnangia:
I was 90% sure it was persist after the Dev's comment. Now I'm 99% sure it is the persist partition. Thank you for your investigation!

My question is this: if we simply fastboot erase persist and then reflash the factory image, would that not fix the issue? By default, persist partition is not erased even when we use the flash-all script.
[Google Pixel 3 XL Guides, News, & Discussion] UltraPower31:
Well there is no persist image in the factory image, so you might end up with a bricked device.

But if you're brave try it.
[Google Pixel 3 XL Guides, News, & Discussion] steal25:
Would going into twrp recovery while on 9 and unmounting /persist then going straight to fastboot and flashing 10 work? Just throwing ideas out there. If someone thinks it will work I can try it this after noon after work.
[Google Pixel 3 XL Guides, News, & Discussion] nikhilnangia:
I think it is part of vendor.img since you will find it in mnt/vendor/persist/

Can someone confirm this theory?
[Google Pixel 3 XL Guides, News, & Discussion] santod040:
Correct, although due to lack of s-off, only unlocked bootloader, it can't be done via fastboot.

It would be zeroed out/erased via ADB.

I can give an example of the command used on a previous device, but you will need to adapt the /path for the proper one for the Pixel 3XL.

You can verify the correct path(get your partition list and mount points) using ADB as well.
[Google Pixel 3 XL Guides, News, & Discussion] nikhilnangia:
Thank you. Yes, please do share the commands (for the path and for erasing).

Although, i believe, the path is as follows:

/root/mnt/vendor/persist/
[Google Pixel 3 XL Guides, News, & Discussion] santod040:
That is not its logical path on disk.

That may be where you see it appear, but that is not it's "true path".

I was going to ask someone to pull this info yesterday, but now seems a good time.

So, someone needs to adb into a rooted Pixel 3xl and pull the proper mount points and partition names.

The combination of a couple different commands, should give all info needed.

We are looking for the partitions by-name path.

There are many pages on XDA and the web that show the different methods for getting this info.

Here is a random example I just saw, though there may be better pages with more explanation.

https://www.cnblogs.com/shangdawei/p/4514128.html

This is one:

cat /proc/partitions

and this one, are good places to start

cat /proc/emmc

Usually takes multiple methods, to pull all needed info.

Both the proper name and the path.
[Google Pixel 3 XL Guides, News, & Discussion] nikhilnangia:
Thank you. I'll get back to you in a bit. Perhaps an hour.
[Google Pixel 3 XL Guides, News, & Discussion] santod040:
I found the proper path already for the Pixel3.

I will post the command here shortly.

But it will come with a full warning, that I can't guarantee the outcome, due to the fact that I won't be unlocking my bootloader, just for the sake of testing this resolution...

Please be aware of that and understand that.

I accept no responsibility for anything anyone else willingly chooses to do to their device.
[Google Pixel 3 XL Guides, News, & Discussion] Fuzzy13:
Got tired of messing with 10 so I went and flashed the last 9 release before 10 and It's stuck at the G logo with the progress bar animation. 15 minutes later and still nothing. Sigh. 10 has been nothing but a nightmare so far so IF i can get back to 9, I'm staying there.

Can someone give me some quick advice to get past the G animation?
[Google Pixel 3 XL Guides, News, & Discussion] alpinista82:
Hello,

persist is not a part of vendor.img. I used simg2img to mount vendor.img and didn't find it. Then I checked where it gets mounted from.

/mnt/vendor/persist gets mounted from /dev/block/sdf2. Wouldn't it be possible to dd the contents of that partition from a phone that is not affected by the bug?

Since my phone is not affected I took an image of that partition: https://drive.google.com/open?id=10EmaYc4uRvgnHAreFv7xhN7TA4LtulqY

So if anybody wants to give it a try (no guarantees, only try this if you know what your doing). If you don't know what your doing, but like taking an incalculable risk ;), here is the command:

dd if=/path/to/persist.img of=/dev/block/sdf2 (you obviously have to become root before).

md5sum of persist.img: 1c95bddfeaad12b0a18841bc439ed752
[Google Pixel 3 XL Guides, News, & Discussion] ultimatepichu:
Hold up, guys.

I'm on sensors-working Pie right now. My mnt/vendor/persist/sensors/registry/registry shows exact copy of those I pulled from sensors-not-working Android 10. This should mean the files in partition /persist persisted correctly, pun intended. :p

This also means that it is indeed a hardware issue? unless someone with working Q is willing to go to working Pie to verify the registry.
[Google Pixel 3 XL Guides, News, & Discussion] nikhilnangia:
No, it does not mean that. The persist you have right now is exactly the same as the one on 10 for you because the persist partition stays exactly like that (hence the name persist).

The one you have is problematic: it works on 9, but the same one does not work on 10.
[Google Pixel 3 XL Guides, News, & Discussion] nikhilnangia:
Thank you for your investigation. Quick question: instead of copying your persist.img to the proper path, what if i just erase my persist partition using the command [MENTION=1331268]santod040[/MENTION] will share. And then, i flash the android 10 factory image again. Would that not flash the persist partition, too? Or am I mistaken?
[Google Pixel 3 XL Guides, News, & Discussion] nikhilnangia:
Can you confirm you did a full wipe flash of Pie without removing the "-w" from the script? That should do it for you, but will erase everything off your memory.
[Google Pixel 3 XL Guides, News, & Discussion] santod040:
<<<>>> untested <<<>>>

This was what I tested and what worked on another device (NOT A PIXEL 3)

The path is the same here, as it was on that device and the method

"should"

yield the same positive results.

I have not verified that it works, or doesn't work on this phone.

So, you are taking a RISK at testing this out yourself, until it's been confirmed to work or not.

I take absolutely no responsibility for what any user chooses to willingly do to their own device.

You have been warned that the outcome of doing this, is currently unknown, and you are the driver behind the wheel and take full responsibility for your own decisions and actions.

I am fairly confident that this will either help those who are effected, or have little to no results.

I do not expect sudden death(bricking) to occur, but that doesn't mean it can't or won't.

I have read everything above, just give us the command we need to use.

Device should be booted into Twrp Recovery, to perform the following ADB command.

Unless there is some other known way to issue the command on this device, without booting into system

(I don't know all of this devices ins and outs, 1st phone I haven't modified in about 13 years or so)

PLEASE BE AWARE, THIS IS UNTESTED

adb shell

dd if=/dev/zero of=/dev/block/bootdevice/by-name/persist

After this, please flash full factory image for Android 10.

GOOD LUCK!!! :good:
[Google Pixel 3 XL Guides, News, & Discussion] nikhilnangia:
Thank you, Sir.

If I'm understanding correct, /dev/zero will overwrite persist with all 0s, thus, effectively, erasing the partition. Correct?

Two quick questions:

1. Should this be done on Android 9 or 10? I am currently on 9 and if i do this on 9, i will flash 10 right after.

2. After this, if i flash the factory image, will that re-write the persist partition as needed to work correctly?

Thank you again for your time. It is greatly appreciated!!
[Google Pixel 3 XL Guides, News, & Discussion] FcukBloat:
maybe, and i repeat MAYBE, i know

someone who is returning is p3xl so could maybe try this for us without worrying of the result. I'm contacting him, if interested will let you know what he says;)
[Google Pixel 3 XL Guides, News, & Discussion] santod040:
You're welcome, hope it helps. :good:

Correct

1. Shouldn't matter, on 9 is fine, then flash 10

2. Correct
[Google Pixel 3 XL Guides, News, & Discussion] Fuzzy13:
I didn't. But luckily I was able to flash 10 and get back up so I'm going to backup a few things before i go the -W route.

Thank you so much.

I wanna say thank you also to all the ones diligently working on this sensors issue. I've been following this thread and you guys are awesome. Can always count on Android users to step up when Google steps backwards so thank you.
[Google Pixel 3 XL Guides, News, & Discussion] alpinista82:
Hi,

could you please elaborate? You're zeroing out the entire persist partition by running that command. How does the data get back in there? Do you know where the data is located in the factory image? I couldn't find it in the image but that doesn't necessarily mean that the files aren't there as I couldn't mount vbmeta.img and others on my pc (they seem to contain raw data and I don't know what to do with those). Thanks.
[Google Pixel 3 XL Guides, News, & Discussion] David B.:
I definitely want to try this, but I thought TWRP did not support Android 10 yet.
[Google Pixel 3 XL Guides, News, & Discussion] santod040:
That would be all the more reason to have to do it on 9 and then flash 10.

The way I see it, users were having to downgrade anyway, to get back full functionality.
[Google Pixel 3 XL Guides, News, & Discussion] FcukBloat:
if you guys are interested, i confirm the guy could help trying your solutions, he doesn't mind as he will return his phone!

so if you're hesitant as you could break your phones, just let me know exactly what he should do ;)
[Google Pixel 3 XL Guides, News, & Discussion] slothdabski:
I built vanilla aosp for crosshatch and no sensors worked on it either
[Google Pixel 3 XL Guides, News, & Discussion] David B.:
I tried using TWRP with Android 10 to do this and I think it actually may have worked.

Here it the output from the dd command.

dd: /dev/block/bootdevice/by-name/persist: No space left on device
81921+0 records in
81920+0 records out
41943040 bytes transferred in 2.113 secs (19849995 bytes/sec)
[Google Pixel 3 XL Guides, News, & Discussion] FcukBloat:
and sensors? :p
[Google Pixel 3 XL Guides, News, & Discussion] David B.:
Still flashing so I do not know yet.
[Google Pixel 3 XL Guides, News, & Discussion] nikhilnangia:
Keeping one hand's fingers crossed and the other's in a box of popcorn. Thank you for trying this out.
[Google Pixel 3 XL Guides, News, & Discussion] FcukBloat:
cool you are so fast! :o so you tried stock Q and had same problem with the sensors?

and out of curiosity apart from sensors you got already most things working on aosp Q? :o
[Google Pixel 3 XL Guides, News, & Discussion] David B.:
You're welcome! Bad news though. It did not work. :(
[Google Pixel 3 XL Guides, News, & Discussion] santod040:
That's disappointing [emoji17]

Thanks for trying.

Sorry it didn't help.

Wouldn't hurt to try it from 9, where they are working though and then flash 10...just for S & G.
[Google Pixel 3 XL Guides, News, & Discussion] David B.:
What I find really concerning is that when I navigate to /mnt/system/vendor now, the folder is completely empty. There is nothing inside it at all.
[Google Pixel 3 XL Guides, News, & Discussion] FcukBloat:
if you have other tests let me know the other guy could do some tests for us :)

---------- Post added at 05:05 PM ---------- Previous post was at 04:59 PM ----------

because David tried from Q?

if so, my friend can try from P!
[Google Pixel 3 XL Guides, News, & Discussion] santod040:
Which is why I think going back to 9 is possibly crucial to the process.

The command should likely be performed from there, where things are working.

If you go back to 9 now, do sensors work again and are those files repopulated?

What about just fastboot flashing the vendor.img file for 10?

fastboot flash vendor_a vendor.img

fastboot flash vendor_b vendor.img

Again, I have not been modifying this device, so you guys here know more about that stuff then I do, I think...
[Google Pixel 3 XL Guides, News, & Discussion] ultimatepichu:
erm. do the same thing but from pie.

edit: ah you already knew.
[Google Pixel 3 XL Guides, News, & Discussion] David B.:
I can try going back to 9 to do it, but wouldn't that screw up my device?
[Google Pixel 3 XL Guides, News, & Discussion] FcukBloat:
wait i have my friend trying now from P ;)
[Google Pixel 3 XL Guides, News, & Discussion] nikhilnangia:
If I were you, here is what I would do, in order:

1. Clean install 9 and confirm all is working. This should re-write your persist partition (ideally). And no, this will NOT mess up your device. The phone booted just fine even without persist files right now as you can see.

2. Clean install 10 and test sensors

If all of that still does not give you the persist files back, let us know. I have another solution you can try:

you can simply dd persist files from another user's phone on here (someone posted their persist.img a few posts back)
[Google Pixel 3 XL Guides, News, & Discussion] David B.:
I wish him luck! I am trying as well. Hopefully I don't regret it.
[Google Pixel 3 XL Guides, News, & Discussion] alpinista82:
Well, guess why? You just zeroed out the entire partition (/dev/lock/sdf2).
[Google Pixel 3 XL Guides, News, & Discussion] bggold:
I dont care if this device gets screwed up getting a replacement monday.

I flashed pie and rooted.

booted with twrp 3.2.3-5 new ones would not take adb command.

I get this error: dd: /dev/block/bootdevice/by-name/persist: write error: No space left on device

Thanks
[Google Pixel 3 XL Guides, News, & Discussion] alpinista82:
As I pointed out before: the contents of /persist are not included in vendor.img, and I am starting to doubt that they are included in any of the images of the factory image. (at least egrep wouldnt give me any binary matches)
[Google Pixel 3 XL Guides, News, & Discussion] David B.:
It really feels like they are not. So I am doing a fresh install of the last Pie image. What do I do from there. I do the dd thing and install 10 with a full wipe?
[Google Pixel 3 XL Guides, News, & Discussion] santod040:
Which is why I stand by it probably needing to be performed in Pie, then do the Android 10 upgrade.

That was the process on my device where I used this process before.

We had to downgrade to Nougat, dd the partition, then upgrade to Oreo.

I was also never able to find an actual persist.img in any of the RUU's/factory images for that phone either.

But the process did work (in that case). But the downgrade WAS a necessary part of the process.
[Google Pixel 3 XL Guides, News, & Discussion] alpinista82:
After flashing Pie check if there is anything in /persist. If not you could try the image I posted above (check md5sum to ensure everything was transferred properly). The image was taken from my phone running Android 10 and not affected by the bug. If there were changes to that partition going from Pie to 10 I don't know - but since you messed up your phone already it wont really matter.

---------- Post added at 06:36 PM ---------- Previous post was at 06:34 PM ----------

So what you are basically saying is that you didn't really know what you were doing and where the files in /persist were coming from after writing all zeroes to the corresponding partition.
[Google Pixel 3 XL Guides, News, & Discussion] FcukBloat:
guys he is trying from pie, but dd command doesn't work. you know why?
[Google Pixel 3 XL Guides, News, & Discussion] David B.:
What error is he getting?
[Google Pixel 3 XL Guides, News, & Discussion] santod040:
I said there was/is no "persist.img" is what I said.
[Google Pixel 3 XL Guides, News, & Discussion] David B.:
I was seeing some strange behavior even after wiping and reinstall Pie (cell service dead and no WiFi), so I am flashing my Pie nandroid backup now and will work with that.
[Google Pixel 3 XL Guides, News, & Discussion] nikhilnangia:
Let's all be respectful to each other - especially to those who are trying to help. He said it a million times - it is untested. He simply shared a solution that worked for many others a while back.

I really think that error is 'fake.' ie it does not mean that the command did not work. Can someone else confirm this?
[Google Pixel 3 XL Guides, News, & Discussion] David B.:
That depends on what the error is. What does it say? Can you get an exact copy of the error?
[Google Pixel 3 XL Guides, News, & Discussion] santod040:
Error in ADB:

I'll just leave this here and be on my way now.... :rolleyes:

Best wishes!
[Google Pixel 3 XL Guides, News, & Discussion] FcukBloat:
it was written in his message:

I get dd: /dev/block/bootdevice/by-name/persist: write error: No space left on device

---------- Post added at 05:52 PM ---------- Previous post was at 05:52 PM ----------

so he can use the zip instead of using adb? correct?
[Google Pixel 3 XL Guides, News, & Discussion] David B.:
Oh sorry. My bad. This thread is getting long and it's hard to keep track of what's going on.

---------- Post added at 12:53 PM ---------- Previous post was at 12:53 PM ----------

yes
[Google Pixel 3 XL Guides, News, & Discussion] nikhilnangia:
To clarify for all, this script when flashed on TWRP writes the persist partition with 0s (ie. erases it completely). We are still waiting to see if the persist partition can be re-written using a factory image, so please try at your own risk and make sure you backup all your partitions using the nandroid feature (including the persist partition, if possible)
[Google Pixel 3 XL Guides, News, & Discussion] Fuzzy13:
You've done so much and we all appreciate it.
[Google Pixel 3 XL Guides, News, & Discussion] bggold:
I just flashed the zip from twrp with PIE. I want to confirm do I clean or dirty flash 10?

Thanks
[Google Pixel 3 XL Guides, News, & Discussion] santod040:
Clean
[Google Pixel 3 XL Guides, News, & Discussion] nikhilnangia:
Persist Folder

For people who cannot restore their persist folder, I am attaching a zip file that contains all my persist directory files.

Device: Pixel 3XL running Android 9, however, the sensors for me did not work on Android 10.

But this should help you if you're unable to get your persist files back after erasing them.
[Google Pixel 3 XL Guides, News, & Discussion] bggold:
will do report back shortly

---------- Post added at 10:07 AM ---------- Previous post was at 10:02 AM ----------

Nope sensors still dead. Hit me up if you need me to test any other ideas. Don't have to send this one back for a week.
[Google Pixel 3 XL Guides, News, & Discussion] nikhilnangia:
Thank you!! Can you confirm your persist directory was re-written when you clean installed 10?
[Google Pixel 3 XL Guides, News, & Discussion] bggold:
Can you assist me in checking? Not sure how to.

Thanks