It turns out non-Google GSIs (Android 10-12) fail to boot due to
userdata encryption.
Magisk cannot disable encryption on Nokia 2.2.
One must
patch /vendor/etc/fstab.* and then
format userdata to get rid of encryption.
I did it and wrote a script to automate the patching.
I'm now running the latest PHH GSI (Android 12).
Steps (follow at your own risk!)
0. Backup the active slot vendor (optional).
# mount | awk '/ \/vendor /{print $1}' | xargs cat > /sdcard/vendor.img
1. Extract the attached zip, run
su -c sh /path/to/disable_encryption.sh and follow the instructions.
For some reason, I had to repeat the patching several times (rebooting in between) for the change to stick.
Do NOT proceed until the change persists AFTER rebooting.
The script is aware of this and guides through the process.
2.
fastboot --disable-verity --disable-verification flash vbmeta /path/to/stock-vbmeta/image
or
fastboot flash vbmeta /patched/vbmeta/image (from Google)
3.
fastboot flash system /path/to/GSI
4.
fastboot format userdata (more reliable than
erase and
-w)
5.
fastboot reboot
Note: I'm on the latest firmware base (Android 11, November 2021 security patch), but
the patching should work even for those who are on Android 10.