English

[HOW TO] Flash a custom ROM on FP3 with GSI

Shouldn’t we install Magisk after flashing the GSI image ? I did it a few times and it went well. And also it makes more sense to me (but I’m no expert).

Magisk modify the boot. You need one of its modification to boot a gsi on the FP3 due to a bug in the bootloader. As long as you don’t try to boot to system before flashing the boot partition, it doesn’t really matter the order for magisk and system :wink:

3 Likes

Ok, I understand, thanks.

Here is a little termux app to get notified when a new vendor update is available. It is based on the support page.

3 Likes

I just noticed that Magisk does not support GSI roms:

1 Like

Beeing quite new to twrp I dont understand the above help. I did the following:

sudo ./adb reboot bootloader

Last line is

DEVICE STATE - unlocked

Trying to flash twrp fails with

sudo ./fastboot flash recovery twrp-3.3.1-0_k4y0z-20200202-02-fp3.img 
Sending 'recovery' (28690 KB)                      OKAY [  0.913s]
Writing 'recovery'                                 FAILED (remote: 'partition table doesn't exist')
fastboot: error: Command failed

I see, that the current state of my bootloader is not ok:

(bootloader) slot-retry-count:b:7
(bootloader) slot-success:b:No
(bootloader) slot-active:b:Yes
(bootloader) slot-unbootable:b:No
(bootloader) slot-retry-count:a:7
(bootloader) slot-success:a:No
(bootloader) slot-active:a:No
(bootloader) slot-unbootable:a:No

Now I don’t understand your help from very above. You write “bootloader” but I have no command like this. Are these commands on the phone? How do I execute these?

I tried this:

sudo ./fastboot --set-active=a

The slot a shows up as active. Now I booted from the devices bootloader itself to android, then

 sudo ./adb reboot bootloader

Is this what you mean with “bootloader --set-active=a”?

What is this “bootloader”? Thanks in advance for your help.

I also tried to restart the bootloader from itself with the volume keys, but I never get a system state, where slots a AND b are active. Did I understand something wrong?

There is no recovery partition. You start twrp with fastboot boot and with that twrp you can install twrp into the boot partition. On A/B devices don’t have a recovery partition.

3 Likes

Ok, I now managed to install twrp from within twrp. I also managed to install magisk from within twrp. I will see, if I can document this later with screenshots.

I now have two questions:

  • Again: how do I get both slots active? I now have both active, but I did not boot in between. Is booting neccesary?
  • If I have both slots active will that mean, that I flash the GSI in a way, that I have no fallback? Is this good? What would happen, if I have just one slot active?

Sorry, indeed these are more than two questions. :smiley:

You can’t activate both at the same time. You can only boot from one. Active means you are booting from it.
If it fails to boot for a couple of times, it will automatically change the active slot.
You can always flash the stock rom images.

2 Likes

I now managed to flash an image like this:

fastboot flash system system-quack-arm64-ab-vanilla.img   
Sending sparse 'system' 1/4 (522236 KB)            OKAY [ 16.395s]
Writing 'system'                                   OKAY [  2.374s]
Sending sparse 'system' 2/4 (522236 KB)            OKAY [ 15.559s]
Writing 'system'                                   OKAY [  2.387s]
Sending sparse 'system' 3/4 (522236 KB)            OKAY [ 15.735s]
Writing 'system'                                   OKAY [  2.398s]
Sending sparse 'system' 4/4 (132692 KB)            OKAY [  4.394s]
Writing 'system'                                   OKAY [  0.620s]
Finished. Total time: 59.906s

But when booting I just get a fallen green android bot. Do I have to do anything else, wiping some partition or such?

Also it seems, that I can just use adb to switch of the 30 sec. message, if I have a working androind on my phone- which I don’t have currently.

fastboot -w

Please read the first post in this thread.
And twrp also has adb.

1 Like

Thanks a lot for your help. I finally got it going with ArrowOS (link from above).

This was the main challenge for me, to get an overview about what info is available where and to get deeper into all these tools for me as a newbie. :+1:

They need to have a success, not to be active.

This state can be lost if you try to boot with another system image without disabling AVB 2.0. Disabling AVB 2.0 is done by magisk.

Even if you succeeded booting a gsi, please check if both slots have a working bootloader (bootloader is where you type fastboot cmds):

adb reboot bootloader
fastboot getvar current-slot # AND WRITE DOWN ITS VALUE
fastboot --set-active=a
fastboot reboot bootloader
fastboot  getvar current-slot # YOU NEED TO SEE "a"
fastboot --set-active=b
fastboot reboot bootloader
fastboot  getvar current-slot # YOU NEED TO SEE "b"
#### IF EVERYTHING IS OK
fastboot --set-active={value you wrote before}
fastboot reboot
3 Likes

You’re right I wrote “bootloader” instead of “fastboot” :slight_smile:

1 Like

I’ve got an problem.

Until now, everything works fine, the GSI AOSP Image works really good.
But after updating the vendor partition the phone don’t boot anymore, its now in a state where it only boots into the bootloader and manually boot to twrp with “fastboot boot twrp.img” only fails with a “unknown reason” don’t know what got wrong, but I don’t get it booting.
Both slots were successful before flashing stock-rom and mounting system ro was already checked in TWRP. And after flashing stock-rom I flashed magisk and then the GSI and reboot.

I’ve know checked the state of the slots and they are both unsuccessful and set them active to reset the retry counter works, but it only boot to bootloader.
Have someone an idea, what I can do?

Which image did you use? (plz give the md5 hash)
Do you know which slot did you flash?
And, did you do a data backup?
To get rid of the unknown reason, rebooting in bootloader fastboot reboot bootloader should be enough.

As far as I understood, it doesn’t support it so it can works or not, depend on the GSI and the phone.
Maybe we should give a flashing zip to only set AVB version to 1.0. Then users will try magisk if they want to.

Edit : At least, I understood that problems can come when you install magisk manager and you set it up. I’m pretty sure it’s not with the boot patch

I used the 110 with MD5 428bdfe207aab70fad51fe4da33e8d6c

No I didn’t make a data backup, but its not a problem loosing my data, main thing is to get it booting.

I flashed slot b.

A fastboot reboot bootloader don’t work already tried this, and the a slot also gives the same error :confused:

Weird, I did the exact steps I wrote with the same file.

Is your device have a bootloader on both slots first ?

fastboot --set-active=a 
fastboot reboot bootloader 
fastboot getvar current-slot # YOU NEED TO SEE "a" 
fastboot --set-active=b 
fastboot reboot bootloader 
fastboot getvar current-slot # YOU NEED TO SEE "b"