Fastboot weird behaviour on a few actions

Hi, I’m Alex, new Fairphone user but long time *nix and derivates enthusiast.

I just got my hands on a new (lucky me!) FP4 and immediately installed UT on it with plans to dualboot pmos from sdcard, later on.

UT installation went alright…ish. There were some hiccups but I disregarded them. While the UBPorts app was chugging away, the phone stalled in fastboot, accepting the commands only after interacting with it’s physical buttons.

All in all, I did install UT and all is well with it, and things are as expected from the highly experimental OS point of view but, I started preparing the PostmarketOS installation on a SD card and then, the odd fastboot behavior became obvious:

Many times, the phone does not execute the commands from the first, second or even third consecutive issuing but it does conform eventually. Like [code]fastboot getvar current-slot[/code]

Without touching cables or the phone, and not doing anything else except re-run the exact command, after complaining a few times, it does display the active slot.

But most of the times it gives [code]getvar:current-slot FAILED (remote: ‘unknown command’)[/code]

And not just with this particular command. Basically any other fastboot command I issue is on a hit-and-miss basis.

Also, when trying to load a kernel image just to RAM and not flash it, It either reboots and hangs with a tiny message in the upper-left “press any key to shutdown” or just switches slots by itself and boots slot_a (trying to boot pmos from slot_b but I’ll take that discussion to pmos, not here)

any thoughts how to debug this fastboot oddity? Never experienced this on any other phones I played with…

TLDR: fastboot commands are executed sometimes and sometimes not, without changing anything. Yes, I tested other cables and USB ports. just repeating the same command over and over results in some 30% rate of success.

Hi,

First of all it’s normal that you must interact physically with the phone during the installation of a custom ROM. IIRC it’s at the lock/unlock bootloader stage that. It’s a security measure from Android.

That said, what you said about the hit-and-miss of benign commands is certainly something to look at.

What’s the previous OS of the FP4? Is it the first foray into custom ROM for the phone?

Still got my thinking cap on here.
Keep a detailed record of everything you do.
My first reaction was to think this is the sort of effect you might see with a buggy keylogger…

Hello!

Did you went for Focal 20.04 or for Noble 24.04? The second one is a little more buggy because still in development, tough almost ready for a stable release from what I read recently :slight_smile:

I tried once and didn’t succeed in booting on the SD card. If you manage to do that I’ll be happy to follow your instructions :smiley:

Hmm, never encountered that… Did you try a different cable? Did fastboot devicesalways returned the device when the other fastboot commands didn’t react?

I have the same (and consistant) behaviour with TWRP image, as I reported here. I’m not able to fastboot boot twrp.img (it just reboot and nothing) while flashing fastboot flash recovery twrp.img works flawlessly…

So, to answer @koumilak and @oli.sax the phone never saw another OS or update other than factory Android 11. UT20 was supposed to be flashable only from an Android11 OS.

Booted the phone for the 1st time, went to settings/developer/allow unlocking, got the code from fairphone and proceeded to unlock and flash UT. Went from UT 20 stable to the transition version to UT24, meanwhile. (not bad!) The fastboot simptoms exhibited since it was still on stock rom, I just didn’t registered them, mentally, then.

fastboot always returns device serial number. It’s just the commands and their returns…

And trying to boot a boot image (kernel+initrd) almost always results in a hanging fastboot and it says it sent the image alright after hard-reboot but the phone is just booting slot_a after that reboot.

I did manage to flash a boot image to slot_b and confirmed it was written correctly by comparing what is on the actual partition and in my boot.img. At the moment the phone promptly reboots to slot_a after attempting a slot_b boot.

It’s actually nice to have full access to all storage from UT. I can read and write any of the OS&FW partitions… dump them and analyze them on a pc…

As I say earlier I have same behaviour with several img, a.o. TWRP…

The only one image that is loading fine is the Android boot.img patched with magisk (for root).

My interpretation is : you flash on slot b an image that the FP4 cannot boot, it tries unsucessfully then switch back to slot a (this is intended in case of incorrect update, so that it falls back to the previous slot).

To confirm my intuition, you could flash your boot img on both slots, and try to power on the system. If it fails we are sure that the (Postmarket OS?) boot img is failing (it was my case when I tried on SD card; even if with the full system installer PmOS booted fine)

Then reflash the UT boot.img on both slots if you want to go back to the previous state :slight_smile: (You can download it on UT site or backup it beforehand with TWRP)

By the way, yesterday I had to boot a magisk patched image to fix the SELinux issue UT installation causes on some sensors. I did a complete reflash with the latest Android available.

First fastboot command hanged the phone with the “press any key to shutdown” message.

Second attempt went just fine.

My favorite thing in the field of computers is when I do the same thing twice and get different results :slight_smile:

I did observe that the most efficient way to get fastboot commands to go thru is to disconnect the phone, execute the command and re-connect when “waiting for any device”.