I had managed, to install rooted Android from Planet following their instructions given here:
https://support.planetcom.co.uk/index.php/Rooted_Android_For_CosmoAfter installation of the rooted Android v25 the update of Magisk to version 22.0 also worked.
Today Magisk "told me", that an update to v22.1 is available.
I tapped on "Install" for the App itself in the Magisk Manager App. That worked well and Magisk on my Cosmo showed version 22.1 for the Magisk app.
Then I tapped "Install" for Magisk (the upper "Install).
This failed. At the required reboot the Cosmo showed a message like "Your device failed verification and will not work properly. You have to unlock the bootloader".
I had decided to install the Planet version of the rooted Android, because it does not require to unlock the bootloader.
After some searching and some thinking it became kind of obvious for me, that the Magisk Manager has modified the "normal boot.img" and not the rooted one. I think, this happened, because the rooted boot image is installed in partition 41 - labeled "EMPTY_NORMAL_BOOT_3" before the installation of the rooted boot image and renamed to "ROOTED_ANDROID" by the Planet recovery installer.
My way to fix the issue:I restored the boot.img from a TWRP backup I had created before.
Reboot - the message regarding "verification / unlock bootloader" was gone.
I booted into the rooted Android. Luckily, this also worked.
Then I copied the "root-boot.img" from the "cosmo-customos-installer" folder on the SD card to /storage/emulated/0/download
I was using the "TotalCommander" file manager app, but this could have been done with every other file manager.
I opened the Magisk Manager and tapped on "Install" for Magisk (the upper "Install).
On the next page I left both checkboxes checked. I don't know, if the first one (Forced ...) is mandatory or important for the following task. But the second checkbox for "Recovery Mode"
must be checked.
Then I tapped on "Next Step".
This opened the next section in Magisk Manager where I could choose "Select and Patch a File".
This immediately opened the Magisk file manager with the focus in the download folder. I tapped on the "root-boot.img" file and then on "Los geht's". I have the German localization of Magisk. In the English version this may be something like "go on" or "Do it".
Magisk Manager was patching the selected "root-boot.img".
The progress was shown in a text console.
The final message was:
Output file is written to
/storage/emulated/0/Download/magisk_patched-22100_wvwcD.img
I rebooted the Cosmo to rooted Android.
With the file manager (TotalCommander) I deleted "root-boot.img" in the "cosmo-customos-installer" folder on the SD card
Then I copied "magisk_patched-22100_wvwcD.img" to the the "cosmo-customos-installer" folder on the SD card and renamed it to "root-boot.img"
Next I rebooted to the Planet recovery.
There I selected
- Install Custom OS on your Cosmo
- Install Rooted Android for Firmware v25
- I selected "ROOTED_ANDROID" as destination
- Reboot system now
Again I booted the Cosmo to rooted Android.
It worked perfectly.
I opened the Magisk Manager app - and - voila - Magisk and the App were both on version 22.1.
I found the necessary background information on this site:
https://topjohnwu.github.io/Magisk/install.html#boot-image-patchingAnd I would be happy, if my text will help somebody to update Magisk on a rooted Cosmo.