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/telegram: @meexreay. Also you can find more about me on my site: meex.lol
Roadmap
- Kernel compiling
- Kernel booting
- Debug shell
- Loading logo
- PMOS starting
- SSH (use
ssh 172.16.42.1
) - Display + Toucscreen (i3wm works)
- Framebuffer and UI
How to install
Run these commands to add the device to pmaports:
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 prepare a phone
Unlock bootloader
Here is described the unofficial method with mtkclient
Drivers
- For Windows:
Install usb drivers:
-
For 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 the phone, hold vol+ and vol- at same time and connect usb cable
# i did it with test point, but it isnt required at all
Flash stock firmware
It is recommended to flash stock firmware before doing anything.
Download Firmware (MIUI v12.0.16.0) and unpack it
- For 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
- For Linux/MacOS:
Install Windows and follow the guide above
TODO: Write how to do that on linux
Disable vbmeta
fastboot flash vbmeta vbmeta_disabled.img
fastboot flash vbmeta_system vbmeta_disabled.img
fastboot flash vbmeta_vendor vbmeta_disabled.img
How to flash
- Build images
pmbootstrap init
pmbootstrap install
- Flash partitions
Enter fastboot mode (hold vol- and pwr buttons while turned off), and run these commands:
pmbootstrap flasher flash_kernel # flash kernel to boot
fastboot reboot fastboot # enter fastbootd mode
pmbootstrap flasher flash_rootfs # flash rootfs to userdata
# in some cases its good to flash rootfs to system partition too:
# pmbootstrap flasher flash_rootfs --partition system
- Reboot
fastboot reboot
See also
- xiaomi angelican wiki
- orangefox recovery
- mtkclient
- ubuntu touch installation
- ubports community redmi 9c
- mt6765 wiki
- mtkclient redmi loader
- working mt6765 port (lg-mmh4x)
- xiaomi angelica wiki
- xiaomi dandelion wiki
- postmarket redmi 9a
- linux on redmi 9c/9a in telegram
- 4pda topic about redmi 9c nfc
Contributing
If you would like to contribute to the project, feel free to fork the repository and submit a pull request.