4.0 KiB
PostmarketOS for Xiaomi Angelican (Redmi 9C NFC)
This port also might work on angelica (without NFC) and other phones on MT6765 processors (like Redmi 9A). If you want to develop it together, or maybe you have a working port, please write me in discord: @meexreay. Also you can find more about me on my site: meex.lol
Roadmap
- Kernel compiling
- Kernel booting
- PMOS booting
- ...
How to install
git clone https://github.com/MeexReay/pmos-xiaomi-angelican.git
cd pmos-xiaomi-angelican
source extract-paths.sh
ln -s $PWD/linux-xiaomi-angelican $PMAPORTS/device/testing
ln -s $PWD/device-xiaomi-angelican $PMAPORTS/device/testing
How to flash
Firstly, you need to unlock bootloader (See section below).
If you have already manipulated partitions, it is recommended to flash MIUI back, and flash PMOS above it.
Flash with prebuilt images
Enter fastboot mode (hold vol- and pwr buttons while turned off), and run this command:
cd prebuild && ./flash.sh
Flash manually
- Build images
pmbootstrap init
pmbootstrap install
- Disable VerifiedBoot and flash boot partition
Enter fastboot mode (hold vol- and pwr buttons while turned off), and run this commands:
fastboot flash vbmeta prebuilt/vbmeta_disabled.img
fastboot flash vbmeta_system prebuilt/vbmeta_disabled.img
fastboot flash vbmeta_vendor prebuilt/vbmeta_disabled.img
pmbootstrap flasher flash_dtbo
pmbootstrap flasher flash_kernel
- Flash system
fastboot reboot fastboot # enter fastbootd mode
fastboot delete-logical-partition product # make system partition bigger
pmbootstrap flasher flash_rootfs # flash system
How to flash stock firmware
It is recommended to flash stock firmware before doing anything.
Download Firmware and unpack it
Windows
- Download MiFlashTool
- Unpack firmware.tgz to some folder and copy its path
- Launch MiFlash.exe and paste the path of firmware folder to that lonely input entry
- Click refresh, then flash button
- That's all, close the window
Linux/MacOS
Install Windows and follow the guide above
TODO: Write how to do that on linux
How to unlock bootloader
Drivers
Windows
Install usb drivers:
Linux/MacOS
TODO: write about usb drivers, but they seem to be preinstalled
Unlocking
git clone https://github.com/bkerler/mtkclient
cd mtkclient
pip -r install requirements.txt
git clone https://github.com/coloredmarble/redmi_9a_mtkclient
cp redmi_9a_mtkclient/* .
python mtk.py da seccfg unlock --preload preloader_k62v1_64_bsp.bin --loader n.bin
# power off phone, hold vol+ and vol- at same time and connect usb cable
# i did it with test point, but it isnt required
Debugging
Initramfs inspecting works! Press vol- button and try this command:
telnet 172.16.42.1
# picocom -b 115200 /dev/ttyACM0
See also
- xiaomi angelican wiki
- mtkclient
- ubuntu touch installation
- booting troubleshooting
- coloredmarble/redmi_blossom
- xiaomi angelica wiki
- xiaomi dandelion wiki
Contributing
If you would like to contribute to the project, feel free to fork the repository and submit a pull request.