Reflashing Xperia X with 4.6: issue

Hi!
I am trying to reflash an Xperia X with the latest 4.6.
But flashing fails with this message:

fastboot -s CB512AM1D7 getvar secure
<< secure: no

fastboot -s CB512AM1D7 flash:raw boot hybris-boot.img
Sending ‘boot’ (14202 KB) OKAY [ 0.472s]
Writing ‘boot’ OKAY [ 0.398s]
Finished. Total time: 0.973s

fastboot -s CB512AM1D7 flash userdata sailfish.img001
terminate called after throwing an instance of ‘std::out_of_range’
what(): basic_string::compare: __pos (which is 929728) > this->size() (which is 0)
./flash.sh: line 121: 5369 Aborted (core dumped) $@
Flashing failed (134)

Anyone knows what is wrong?

What fastboot version is this? Consider trying a different one.

3 Likes

android-tools-1:34.0.4-14.fc40.x86_64

Okay Attah was correct.
So on Fedora 40 the android-fastboot version is too new.
I had to remove it: $ sudo dnf remove android-tools

And then download and install the older version, in rpm here:
https://dl.fedoraproject.org/pub/fedora/linux/releases/39/Everything/x86_64/os/Packages/a/android-tools-33.0.3p1-1.fc38.x86_64.rpm

Flashing worked. Solved. Thanks.

4 Likes

I had the same problem at some point. Tricky.

Do you guys have any details on the problem. “Too new” sounds weird. Does that version of fastboot have a regression that is known upstream, or are the files provided by sailfish maybe in fact somehow “too old” for a modern fastboot? After all other fast moving distros will be there soon enough

I suspect it has something to do with Android breaking adb/fastboot compatibility with older versions of itself or older Android images (like SFOS uses).

Always remember: all Google wants is for people to keep buing Android phones after security updates run out.

This is a baseless conspiracy.

The shipped Fedora package is broken because it must be recompiled with -ftrivial-auto-var-init=zero. Upstream is aware of this.

1 Like

lol OK.

But this isn’t the first time there have been issues with adb/fastboot. Check these very forums.