Setup 1 unlock bootloader
Reference: https://www.miui.com/unlock/index.html
Notice:
miflush_unlock
requires a windows os- If the unlock tool does not recognize the phone, you need to install the driver manually in the device manager, select the path miflush_unlock/driver.
- Download Xiaomi Official Unlock Tool (
miflush_unlock
): https://www.miui.com/unlock/download.html - Run miflush_unlock.exe, login to Xiaomi account
- Go to “Settings -> Developer Options -> Device Unlocked Status” to bind your xiaomi account and device.
- Enter Bootloader mode manually (after powering off the computer, press and hold the Power On and Volume Down buttons at the same time).
- Connect your phone via USB and click the “Unlock” button
Setup 2 Download android sdk
https://developer.android.google.cn/tools/releases/platforms?hl=en
macos can be installed using homebrew,brew install android-platform-tools
- Download android platform-tools
- Configuring Environment Variables
Setup 3 Download PostmarketOS images
https://images.postmarketos.org/bpo/v23.12/xiaomi-vince/phosh/20240327-0824/
Decompression command:xz --decompress xxx.xz
- 20240327-0824-postmarketOS-v23.12-phosh-22.3-xiaomi-vince-boot.img.xz
- 20240327-0824-postmarketOS-v23.12-phosh-22.3-xiaomi-vince-lk2nd.img.xz
- 20240327-0824-postmarketOS-v23.12-phosh-22.3-xiaomi-vince.img.xz
Setup 4 Write images to phone
Notice: Run
fastboot devices
to make sure your device is detected.
# 1. flush lk2nd
fastboot flash boot 20240327-0824-postmarketOS-v23.12-phosh-22.3-xiaomi-vince-lk2nd.img
# 2. wait for the reboot to complete
fastboot reboot
# 3. flush boot
fastboot flash boot 20240327-0824-postmarketOS-v23.12-phosh-22.3-xiaomi-vince-boot.img
# 4. flush os
fastboot flash userdata 20240327-0824-postmarketOS-v23.12-phosh-22.3-xiaomi-vince.img
# 5. wipe the system partition
fastboot erase system
# 6. reboot
fastboot reboot
If all goes correctly, you should now be running postmarketOS! Enjoy!
Setup 5 Login your OS
username: user
password: 147147
PIN Code: 147147
Finally
Replace /etc/apk/repositories
with the following
http://mirrors.tuna.tsinghua.edu.cn/postmarketOS/master
http://mirrors.tuna.tsinghua.edu.cn/alpine/edge/main
http://mirrors.tuna.tsinghua.edu.cn/alpine/edge/community
Update Mirror
sudo apk update
sudo apk upgrade -a
Optimization [optional]
- Disable GUI:
Reduce memory usage by 700m
# disable
sudo rc-update del tinydm
sudo reboot
# enable
sudo rc-update add tinydm default
- Disable modemmanager
Reduce memory usage by 100m
Notice:ModemManager
is used to control mobile broadband (2G/3G/4G) devices and connections
# disable
sudo rc-update del modemmanager
# enable
sudo rc-update add modemmanager default
- Disable firewall
sudo service nftables stop
sudo rc-update del nftables
- Disable pulseaudio
Reduce memory usage by 700m
# disable
echo "autospawn = no" > $HOME/.config/pulse/client.conf
pkill -f pulseaudio
# enable
rm -f $HOME/.config/pulse/client.conf
sudo service pulseaudio start