2025-06-08 21:01:24 +03:00
2025-05-31 12:23:27 +03:00
2025-05-28 13:50:37 +03:00
2025-05-17 03:30:31 +03:00
2025-06-08 21:01:24 +03:00
2025-05-30 22:08:49 +03:00
2025-05-31 21:09:50 +03:00
2025-05-31 21:09:50 +03:00

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:

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:
  1. Download MiFlashTool
  2. Unpack firmware.tgz to some folder and copy its path
  3. Launch MiFlash.exe and paste the path of firmware folder to that lonely input entry
  4. Click refresh, then flash button
  5. 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

  1. Build images
pmbootstrap init
pmbootstrap install
  1. 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
  1. Reboot
fastboot reboot

See also

Contributing

If you would like to contribute to the project, feel free to fork the repository and submit a pull request.

Description
PostmarketOS Xiaomi Angelican port
Readme 20 MiB
Languages
Shell 92%
Nix 8%