FP4 Root Access is possible, maybe a bit risky

Yeah, I did :see_no_evil: should have had :coffee: before …
Fixed it, and here’s the link to the patched one.

Now I am at the point where your patched imaged has been “fastbooted”.
Everything seems to work: Sensors are available, booting does not take so long, SD card is available.

After Magisk → install
(x) Direkte Installation
All done – reboot

Result:

  • slow boot
  • no sensors
  • SD card not working

But root access works.

:frowning:

Yeah, your system /boot partition (which Magisk uses as a base to patch for direct installation) is clearly corrupted for some reason.

Since my 175 images seem to work, let’s flash the unpatched one and start a clean Magisk installation.

  • Check the slot you are in with either adb shell getprop ro.boot.slot_suffix or fastboot getvar current-slot
  • fastboot flash boot_[current slot] FPOS-A.175-boot.img, replace current slot with your actual slot
  • Boot and check if everything still works
  • Boot from the patched image and try a direct Magisk installation again

Gives: _a

fastboot flash boot_a FPOS-A.175-boot.img (just one “_” or two)?

From the bootloader (adb reboot bootloader)?

From the bootloader, yeah. fastbootd should be possible as well, but let’s stick to what’s known to work :slightly_smiling_face:

One: boot_a

1 Like

Seems to.
Normal boot time
Sensors available
SD card available

Hey!
It works! Now I have System release 175 rooted.

If you ever happen to be in Berlin make sure to drop a message. You are invited to empty 1…2…3 glasses of beer (or something you like). :beers: :wine_glass:

Thank you for your patience.

3 Likes

Awesome :metal:

Let’s hope all the other partitions are still fine, otherwise I’ll suspect we might be continuing this when the next OTA arrives :crossed_fingers:

Any time, I enjoy debugging :nerd_face: (especially if the outcome is positive)

5 Likes

Hi Hirnsushi, I read your article very carefully, actually I got very far, but was finally not able to flash the boot.img. I tried to flash it on different operating systems but I always get the message:
“Download is not allowed on locked devices”

my Fairphone 4 was bought a in january 2023 and here are the steps I did:

  1. I unlocked devloper options
    01develop

  2. I unlocked “OEM unlocking” via code that was provided by fairphone.com

  3. I enabled USB debugging
    03debug

  4. after that I was able too boot into recovery mode
    04recovery

  5. I entered the fastboot via “recovery mode”
    05fastboot

  6. Strangely enough, I noticed that “Secure Boot” is set to yes even though I have enabled OEM unlocking
    06fastboot

  7. I installed fastboot, adb and android-sdk via repository, I did it on Manjaro Linux, MX Linux 19.4 and MX Linux 21.3

    all efforts lead to the same result: “Download is not allowed on locked devices”

  1. I reinstalled brand new Windows 10 OS on Lenovo X260 laptop and latest version of fastboot, adb and USB drivers for Google and later also Huawai USB drivers.

    These efforts lead to the same result as well.

have you any idea what I am doing wrong?

You are in the wrong fastboot mode, fastbootd instead of the regular old fastboot.

Use adb reboot bootloader or fastboot reboot bootloader to get into the right one. You will need to actually unlock your bootloader if you haven’t already (fastboot flashing unlock), beware that that will wipe your data!
Also why are you trying to flash recovery, that isn’t necessary for root, you shouldn’t flash any images if all you want to do is use Magisk.

Oh and welcome to the community btw :wave:

1 Like

Hello, hirnsushi, thanks for your quick reply, I tried both methods, unfortunately without much of success

here is my output:
2023-01-19_21-20

You are missing a step :point_down:

1 Like

with the second method, I was able to start into the old fastboot version, but was unable to boot my patched image, maybe I should rename it to boot.img…

If you can see that on your phone …

… you are in the right fastboot.

But, you need to first unlock your bootloader if you haven’t already, before you can continue with the Magisk installation.

1 Like

oh man, it worked now, I just booted into my patched image
the problem was:

  1. that I was in fastbootd and not fastboot, to me it wasn’t clear this is not the same
  2. I also din’t realise that I shuould have run: fastboot flashing unlock after unlocking OEM unlock…

:astonished: thanks again

Dump question: Is there any need to patch the boot image again after some time or will this happen somehow automatically? E.g. the boot image itself gets patched during CalyxOS updates and when Magisk will be installed to the Inactive Slot / it will patch the new boot image (eventually Magisk App gets updated in the meanwhile so also the magisk code is updated). Correct?

Outside of OTA updates there is no need to patch the boot image again, if that’s what you’re asking :thinking:

Yeah that’s what I basically asked for.

So let’s say the boot.img code get’s an update (generally Fairphone relevant stuff or by CalyxOS devs), whatever this is in detail (still not a dev ^^). This will probably be included in OTA updates.

If the patched part (Magisk) changes, this will be included in the OTA procedure as well, as we have to install to inactive slot each time after an OTA so the boot-img will be patched and flashed again was well.

You need to restore the boot image anyway before an OTA update, otherwise the update just fails because it’s expecting the hash of the unpatched partition, which you changed by patching it with Magisk (unless the update is a full OTA, that will just overwrite everything).

I’m not sure I fully understand what your question is :thinking:

In general all you have to do for OTA updates are these steps:

No additional maintenance is necessary to keep Magisk working between updates.

Yeah sure I updated my rooted CalyxOS that way several times. It is not about the CalyxOS OTA updates in general or keeping Magisk working.

I just wanted to know/understand/ensure if this also ensures that the program code of the boot-images stays up to date or if there is a need to pick a new one from a factory image (FP OS or CalyxOS) and patch it / flash it again as done when CalyxOS was installed and rooted the first time.

But the answer is No, no need to do such things. Everything keeps up to date and patched during the normal OTA update procedure (the OS itself including the boot image as well as Magisk + it’s part what is patched into the boot image).

Yes, there is no need to follow the initial rooting procedure again, if you use the OTA update steps outlined above.

You can think of it that way: When an OTA update arrives, the new system partitions get written to the slot you aren’t using, either directly (full OTA, large filesize) or by combining your existing partitons with a “patch” (delta OTA, much smaller size).
At the point you install Magisk to the other slot it patches that new and fully updated boot image in the other slot, so your system partitons are always up-to-date, don’t worry :slightly_smiling_face: