-
Notifications
You must be signed in to change notification settings - Fork 336
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can't flash userdata on motorola-harpia #343
Comments
can you try
If you're using a prebuilt img.xz then you need to |
Thanks, I tried the simg2img utility and the -S switch. It made no difference but if I try MUCH smaller values, such as 32K, it does get several chunks through before it hangs again, up to a number of chunks that seems to scale pretty linearly with the chunk size, as if the hang is triggered after a certain amount of data has been transferred. Is there a way to have fastboot pause between each chunk of userdata, like in case a buffer somewhere is being overrun or something - that's my first instinct anyway. Since I don't see a switch for that in fastboot --help I'm thinking maybe I'll try to compile fastboot from source and see if I can manually hack one in. I forgot to mention in the OP that I have also tried running usbdump in another terminal while running fastboot, and I can see lots of data go by which stops dead at the point of hang and then just never recovers with no further traffic over the USB, I've even left it overnight. At that point the lk2nd UI on the phone is still responsive, but no further fastboot commands work at all (instant hang after enter w/ no output), even commands which previously worked, until I power-cycle the phone or select "Restart Bootloader" from the lk2nd menu. I also noticed the "fastboot -w" command this time, which does appear to work as expected as long as there hasn't been a hang that boot, as well as commands such as "fastboot reboot bootloader". I'm happy to run whatever commands would help or troubleeshoot code (I'm a C/C++ programmer), I just don't know very much about Android or any of the associated tools to really know where to start. See attached command log. |
Okay, I hacked fastboot to add a 2.5 second delay before sending each chunk, no change:
Then I started adding lots more debug prints, and was able to determine the following stack trace:
It hangs somewhere beneath write_fd_chunk probably where fastboot is calling into a function pointer Is there a method to get verbose output or debug mode etc to start something similar for lk2nd (of course I could follow the README.md to build from source but I'm not sure if there's an existing recommended method to output any debug to make that useful)? |
First of all, could you try building lk2nd from After that you can build the same branch with additional I suspected the fastboot thread hangs/dies for some reason on the device side somehow, which is why I suggested -S to make sure it's not incorrect ram setup (i.e. device tries to write a chunk more than has ram allocated for) but it seems like it's neither that nor any kind of a watchdog if you say it dies after specific size written to the devcie ignoring the delays... |
I used to have this problem on Samsung Galaxy Grand Prime (samsung-gprimeltexx) with lk2nd 0.15 (it would flash just enough for the kernel and initramfs, but resulted in a corrupt root fs), but with lk2nd 17.0 it works just fine. |
I am following the PostmarketOS install instructions for my unlocked Motorola Moto G4 Play (harpia).
Everything was going fine until it comes time to flash the actual OS:
At that point it just hangs for a very long time, then finally times out. I've tried multiple times and with different images, etc.
Posting this here because my understanding is that lk2nd is reimplementing the fastboot protocol and thus is what's actually talking to fastboot when I run that command.
Unfortunately, I don't know much about Android so have no idea how to attempt to gather more information. I did try giving the -v switch but that didn't add any interesting output.
Also since this phone has a SD card slot and one of the PostmarketOS wiki pages mentions the SD as an alternative to flashing the OS to userdata, I am planning to try just dd-ing the image directly to an SD card, but I am not clear if lk2nd will try to boot an SD or not.
The text was updated successfully, but these errors were encountered: