Xiaomi Redmi Note 7 (xiaomi-lavender)
![]() Redmi Note 7 | |
Manufacturer | Xiaomi |
---|---|
Name | Redmi Note 7 |
Codename | xiaomi-lavender |
Released | 2019 |
Hardware | |
Chipset | Qualcomm SDM660 Snapdragon 660 (14 nm) |
CPU | 8-core (4x2.2 GHz Kryo 260 & 4x1.8 GHz Kryo 260) |
GPU | Adreno 512 |
Display | 1080 x 2340 |
Storage | 32 (64) Gb |
Memory | 3 (4) Gb |
Architecture | aarch64 |
Software | |
Original software | Android 9, MIUI 10 |
postmarketOS | |
Category | testing |
Pre-built images | no |
postmarketOS kernel | 4.4.153 |
Unixbench Whet/Dhry score | - |
Flashing |
Works |
---|---|
USB Networking |
Works |
Internal storage |
No data |
SD card |
No data |
Battery |
No data |
Screen |
No data |
Touchscreen |
No data |
Multimedia | |
3D Acceleration |
No data |
Audio |
No data |
Camera |
No data |
Camera Flash |
No data |
Connectivity | |
WiFi |
No data |
Bluetooth |
No data |
GPS |
No data |
NFC |
No data |
Modem | |
Calls |
No data |
SMS |
No data |
Mobile data |
No data |
Miscellaneous | |
FDE |
No data |
USB OTG |
No data |
HDMI/DP |
No data |
Sensors | |
Accelerometer |
No data |
Magnetometer |
No data |
Ambient Light |
No data |
Proximity |
No data |
Hall Effect |
No data |
Haptics |
No data |
Barometer |
No data |
Contributors
Maintainer(s)
Users owning this device
- Alexeymin (Notes: Test subject #1)
- Alikates
- Bczeman
- Danct12
- Fann (Notes: 4/64 LineageOS daily driver)
- Hitechshell
- Jcgruenhage (Notes: Temporarily on LineageOS)
- Kalwardin (Notes: Main device, Lineage OS)
- NekoCWD (Notes: 6/64GB LineageOS second phone)
- Perigoso
- Sprite Night (Notes: 4/64 daily driver, bloated battery)
- Vimsky (Notes: Main device, UBports)
How to enter flash mode
Bootloader Unlocking
Like other Xiaomi devices, the user will have to acquire the bootloader unlock key: https://en.miui.com/unlock
The device will not unlock if the device isn't 7 days old (from the time when your device connects to internet and powered on, and linked with Mi Account)
Recovery mode
- Turn the device off (or restart also works)
- Hold volume+ button and power button
- Once you feel vibration and phone turns on, release power button
- Keep holding volume+ until you get to recovery.
Flashing (Download, Fastboot) mode
- Same as recovery, but this time hold the volume- and power keys.
Installation
Flash a working custom Android ROM first
Flash a working custom Android ROM first - it will likely contain all needed custom partition images like vbmeta
or dtbo
(not sure if it's strictly needed). For example this [LineageOS 16.0 ROM]. The situation is a bit hard, because there is no official LineageOS release for this device yet, not even a official TWRP.
WIP
This is still a work-in-progress. If you want to test that kernel boots, backup boot
and system
partitions first. Then checkout my development branch in pmaports (link below in links section), zap & reinit pmbootstrap (pmbootstrap -y zap ; pmbootstrap init
), choosing xiaomi-lavender
as a device; then rebuild every package mentioned in the last commits on my branch (for now: pmbootstrap build --force --arch aarch64 linux-xiaomi-lavender device-xiaomi-lavender postmarketos-mkinitfs
) then proceed as usual (reboot device to fastboot mode, pmbootstrap install ; pmbootstrap flasher flash_kernel ; pmbootstrap flasher flash_rootfs
).
Additional info
Partition list
Device | Label | Size in blocks | Size in bytes | Stock FS |
---|---|---|---|---|
mmcblk0p1 | switch | 8 | 8192 | |
mmcblk0p2 | dpo | 8 | 8192 | |
mmcblk0p3 | fsc | 8 | 8192 | |
mmcblk0p4 | limits | 32 | 32768 | |
mmcblk0p5 | ssd | 32 | 32768 | |
mmcblk0p6 | sec | 20 | 20480 | |
mmcblk0p7 | vbmeta | 64 | 65536 | |
mmcblk0p8 | vbmetabak | 64 | 65536 | |
mmcblk0p9 | storsec | 128 | 128K | |
mmcblk0p10 | storsecbak | 128 | 128K | |
mmcblk0p11 | apdp | 256 | 256K | |
mmcblk0p12 | msadp | 256 | 256K | |
mmcblk0p13 | keystore | 512 | 512K | |
mmcblk0p14 | frp | 512 | 512K | |
mmcblk0p15 | rpm | 512 | 512K | |
mmcblk0p16 | rpmbak | 512 | 512K | |
mmcblk0p17 | hyp | 512 | 512K | |
mmcblk0p18 | hypbak | 512 | 512K | |
mmcblk0p19 | pmic | 512 | 512K | |
mmcblk0p20 | pmicbak | 512 | 512K | |
mmcblk0p21 | cmnlib | 1024 | 1024K | |
mmcblk0p22 | cmnlibbak | 1024 | 1024K | |
mmcblk0p23 | cmnlib64 | 1024 | 1024K | |
mmcblk0p24 | cmnlib64bak | 1024 | 1024K | |
mmcblk0p25 | abl | 1024 | 1024K | |
mmcblk0p26 | ablbak | 1024 | 1024K | |
mmcblk0p27 | dip | 1024 | 1024K | |
mmcblk0p28 | ddr | 1024 | 1024K | |
mmcblk0p29 | toolsfv | 1024 | 1024K | |
mmcblk0p30 | devcfgbak | 1024 | 1024K | |
mmcblk0p31 | devcfg | 1024 | 1024K | |
mmcblk0p32 | tz | 4096 | 4096K | |
mmcblk0p33 | tzbak | 4096 | 4096K | |
mmcblk0p34 | mdtpsecapp | 4096 | 4096K | |
mmcblk0p35 | mdtpsecappbak | 4096 | 4096K | |
mmcblk0p36 | keymaster | 1024 | 1024K | |
mmcblk0p37 | keymasterbak | 1024 | 1024K | |
mmcblk0p38 | bluetooth | 1024 | 1024K | vfat |
mmcblk0p39 | lsti | 2048 | 2048K | |
mmcblk0p40 | xbl | 3584 | 3584K | |
mmcblk0p41 | xblbak | 3584 | 3584K | |
mmcblk0p42 | misc | 4096 | 4096K | |
mmcblk0p43 | devinfo | 8192 | 8192K | |
mmcblk0p44 | logfs | 8192 | 8192K | |
mmcblk0p45 | fsg | 8192 | 8192K | |
mmcblk0p46 | modemst1 | 8192 | 8192K | |
mmcblk0p47 | modemst2 | 8192 | 8192K | |
mmcblk0p48 | dsp | 16384 | 16.0M | vfat |
mmcblk0p49 | bk1 | 24576 | 24.0M | |
mmcblk0p50 | mdtp | 32768 | 32.0M | |
mmcblk0p51 | bk2 | 16384 | 16.0M | |
mmcblk0p52 | dtbo | 8192 | 8192K | |
mmcblk0p53 | dtbobak | 8192 | 8192K | |
mmcblk0p54 | splash | 65536 | 64.0M | |
mmcblk0p55 | persist | 32768 | 32.0M | ext4 |
mmcblk0p56 | persistbak | 32768 | 32.0M | ext4 |
mmcblk0p57 | logdump | 65536 | 64.0M | |
mmcblk0p58 | modem | 196608 | 192M | vfat |
mmcblk0p59 | rawdump | 131072 | 128M | |
mmcblk0p60 | boot | 65536 | 64.0M | |
mmcblk0p61 | recovery | 65536 | 64.0M | |
mmcblk0p62 | cache | 262144 | 256M | ext4 |
mmcblk0p63 | system | 3670016 | 3584M | ext4 |
mmcblk0p64 | vendor | 2097152 | 2048M | ext4 |
mmcblk0p65 | cust | 851968 | 832M | ext4 |
mmcblk0p66 | userdata | 22802415 | 21.7G | encrypted (dm-0) |
mmcblk0rpmb | 4096 |
Android Verified Boot (vbmeta)
This device is using Android Verified Boot ( https://android.googlesource.com/platform/external/avb/+/refs/tags/android-vts-8.0_r11/README.md ) so you may need to flash vbmeta
partition with vbmeta.img
from LineageOS zip or downloaded separately (from https://androidfilehost.com/?fid=1395089523397954291 for example); or we need to find a way to generate it with avbtool
and flash it during installation somehow. (add pmbootstrap flasher flash_vbmeta
?)
DTBO partition
This device is using a dedicated partition to store the Device Tree Blob Overlay. Read more at https://source.android.com/devices/architecture/dto/partitions . We need to find a way to flash generated dt.img
to dtbo
partition during installation process. (add pmbootstrap flasher flash_dtbo
?)
Update: looks like dtbo partition is not used during boot by LineageOS's kernel, because it is using appended DTB (CONFIG_BUILD_ARM64_APPENDED_DTB_IMAGE=y
)
Update2: device tree from dtbo partition can still be used by bootloader?
Bootloader cmdline
Stock bootloader is doing nasty things with kernel command line: it passes a lot of arguments that make booting custom OS (like postmarketOS) impossible
Full list of stock command line parameters:
ramoops_memreserve=4M rcupdate.rcu_expedited=1 console=ttyMSM0,115200,n8 androidboot.console=ttyMSM0 earlycon=msm_serial_dm,0xc170000 androidboot.hardware=qcom user_debug=31 msm_rtb.filter=0x37 ehci-hcd.park=3 lpm_levels.sleep_disabled=1 sched_enable_hmp=1 sched_enable_power_aware=1 service_locator.enable=1 swiotlb=1 firmware_class.path=/vendor/firmware_mnt/image loop.max_part=7 androidboot.selinux=permissive buildvariant=eng androidboot.verifiedbootstate=orange androidboot.keymaster=1 root=PARTUUID=2a7f6d6d-1c23-febe-7efb-9ccfa1432ace androidboot.bootdevice=c0c4000.sdhci androidboot.serialno=ac1dde4e androidboot.cpuid=0x39148c8c androidboot.dp=0x0 androidboot.baseband=sdm mdss_mdp.panel=1:dsi:0:qcom,mdss_dsi_nt36672a_tianma_fhdplus_video:config0:1:none:cfg:single_dsi skip_initramfs rootwait ro init=/init androidboot.dtbo_idx=0 androidboot.fpsensor=fpc androidboot.secureboot=1 androidboot.hwc=Global androidboot.hwversion=1.29.0 androidboot.hwlevel=MP androidboot.hwdevice=lavender
ramoops_memreserve=4M
comes from defconfig, next from boot.img, others (starting with first androidboot.
and below) come from bootloader directly.
Harmful kernel command line params from bootloader
Options like root=
, skip_initramfs
make kernel look for a specific partition to mount at /, skipping initramfs, which is incompatible with default booting methods of postmarketOS. That's why some tricky patches are needed, similar to ones used by Zhuowei in Google Pixel port: 1, 2.
Another hack to fix bootloader cmdline params by opendata26: init: ignore bootloader cmdline params for mounts
Some info on skip_initramfs
kernel cmdline parameter: https://forum.xda-developers.com/apps/magisk/pixel-2-pixel-2-xl-support-t3697427/post74361728#post74361728
Lineage OS ROMs/TWRP pstore-ramoops module parameters
/sys/fs/pstore # ls -la /sys/module/ramoops/parameters/ total 0 drwxr-xr-x 2 0 0 0 Jul 20 13:02 . drwxr-xr-x 3 0 0 0 Jul 20 13:02 .. -r-------- 1 0 0 4096 Jul 20 13:02 console_size -rw------- 1 0 0 4096 Jul 20 13:02 dump_oops -rw------- 1 0 0 4096 Jul 20 13:02 ecc -r-------- 1 0 0 4096 Jul 20 13:02 ftrace_size -r-------- 1 0 0 4096 Jul 20 13:02 mem_address -r-------- 1 0 0 4096 Jul 20 13:02 mem_size -rw------- 1 0 0 4096 Jul 20 13:02 mem_type -r-------- 1 0 0 4096 Jul 20 13:02 pmsg_size -r-------- 1 0 0 4096 Jul 20 13:02 record_size /sys/fs/pstore # cat /sys/module/ramoops/parameters/mem_address 2684354560 /sys/fs/pstore # cat /sys/module/ramoops/parameters/mem_size 4194304 /sys/fs/pstore # cat /sys/module/ramoops/parameters/mem_type 0 /sys/fs/pstore # cat /sys/module/ramoops/parameters/ecc 0 /sys/fs/pstore # cat /sys/module/ramoops/parameters/dump_oops 1 /sys/fs/pstore # cat /sys/module/ramoops/parameters/console_size 2097152 /sys/fs/pstore # cat /sys/module/ramoops/parameters/ftrace_size 0 /sys/fs/pstore # cat /sys/module/ramoops/parameters/pmsg_size 2097152 /sys/fs/pstore # cat /sys/module/ramoops/parameters/record_size 0