On many devices the bootloader is locked and you need to unlock it before being able to flash a custom ROM or recovery. Unlocking is therefore also required for installing postmarketOS.
If you forgot whether your device is unlocked already, check whether it displays "device unlocked" at the bottom in flash mode.
Unlocking the bootloader
|Bootloader unlock results in formatted system partition as well as userdata. Make sure you have a backup/official firmware.|
On many devices where the manufacture is generous it is enough to enter
fastboot oem unlock
Others require you to enter a code:
fastboot oem unlock your-code-here
Huawei stopped distributing unlock codes. Tutorials telling you to go to some Huawei website, log in with a Huawei ID and sign the unlocking agreement to get a code will NO longer work. Not even contacting their support.
Some services claim to be able to unlock this device, but they charge money for it (e. g. DC-Unlocker charges 4€). Be careful and try to do research before giving any of these services your money!
Another option is to try brute forcing the code. This takes time and might not work
- WIP Experimental work around which involves replace the entire bootloader & 
- Open Source Solution for Kirin devices
- A bootrom exploit of Huawei Hisilicon Smartphones that could be used to unlock Huawei bootloaders
|it's your last chance to download latest rom via ota update before unlocking bootloader. sony doesn't provide ota update for unlocked devices and there is no way to lock it again|
You just have to enable oem unlocking in developer settings and use fastboot oem unlock afterwards in fastboot mode.