Trying to run the Mi Note 10 port on Mi Note 10 Lite

Is it possible to create a port for Xiaomi Mi Note 10 Lite (toco)? The Hardware is very similar.

Well sure it is possible, but I might not be able to do it.

My shallow understanding of android building is that you need a system (lineage 17.1 in this case), a “vendor” and a “device tree”. And most importantly for SailfishOS adaptation, the “kernel” sources.

For context: the “device” tree for tucana was created by alibei by changing toco to tucana (link). This tells how similar the devices are indeed.

The “vendor” is not built, the original partition from xiaomi is used.

The “kernel”: when I started the port was not built, Alibei used the pre-built kernel from MIUI. Later, he switched to some open lineage xiaomi “sm6150” branch I don’t remember. Before that was a thing, I took a stab and adapted the one from Xiaomi_Kernel_OpenSource called tucana Q. Adapting meant copying some drivers in techpack (audio?) and some others (wlan) in drivers/staging. You can see all my steps (including the wrong ones) here. The source of the things I copied is in the same “MiCode” github organization.

So technically yes, one can retrace the steps and do the same for the toco kernel. It does sound like it’s the same device with a different camera, so you could also try to just “replace tucana with toco” in the kernel - there are at least these places where name matters - but probably it would be better to use the lineage xiaomi sm6150 kernel if there’s a lineage 17.1 version and patch it for hybris with my config changes.

If you want to take a shot on building I can provide my build notes - basically append them to the Readme if there’s interest.

Also, the droid-* repos would probably need switching s/tucana/toco/g…

(Hmm maybe if just the last part would be done would be enough? Like with all the tama devices…?)

1 Like

Sorry for delay with response.
Here is comparison between Xiaomi Mi Note 10 Lite and Xiaomi Mi Note 10:

Yes, it’s look like a the same device with a different camera.
My phone model is M2002F4LG. I have 6GB RAM 64GB ROM version.

Yes, I very intrested in porting and testing SailFish OS to toco. But maybe my knowledge in this area not enough.
Maybe you can assist me with porting, I ready to start trying porting.
It may be possible to compile the kernel separately and add it to your ready base?
As you mentioned earlier same think like with the tama devices?

First, I am away from the external drive where the build resides at the moment.

But let us make a test, kernel first:
In this rpm https://repo.sailfishos.org/obs/nemo:/devel:/hw:/xiaomi:/tucana/sailfish_latest_aarch64/aarch64/droid-hal-tucana-img-boot-0.0.6-202211032058.aarch64.rpm there’s a hybris-boot.img.

Assuming you already have the bootloader unlocked, without any changes to your device, can you:

  • boot in fasboot mode (vol-up + power) - or is it vol-down?
  • from the PC: fastboot boot hybris-boot.img
  • test if you can connect to telnet 192.168.2.15 2323 ?

If it doesn’t boot but rather reboots very fast, from the original OS it reboots into, can you post the /sys/fs/pstore/console-ramoops contents in a pastebin link?

(L.E. notice in the same rpm how the updater scripts tests for tucana - this is why I need to go the tama route, but let’s see if it is worth first)

No, the bootloader is not unlocked, I will do it. Yes, phone without any changes, it is a new device.

-I extracted hybris-boot.img from droid-hal-tucana-img-boot-0.0.6-202211032058.aarch64.rpm

I’ll let you know, when I unlock bootloader and try hybris-boot.img

Ok. Another thing that’s needed is finding an Android 10 ROM (such as from xiaomi.eu but another custom rom would also do) and get the vendor.img for that version, as I doubt the one I backed up would work on toco.

Yes, phone without any changes, it is a new device

What I was trying to say is that the fastboot boot command would not change your phone.
Unlocking will, however

My Mi Note 10 Lite have stock 12.0.2.0 (QFNEUXM) firmware (Android 10 ROM)
Please let me know, if needed some additional details about my phone/firmware. Here two screenshot from current/stock ROM.


According to information from screenshots stock/original ROM file should be miui_TOCOEEAGlobal_V12.0.2.0.QFNEUXM_763475e07c_10.0.zip (Mi Note 10 Lite EEA MIUI V12.0.2.0.QFNEUXM Update | XM Firmware Updater)

I can unlock my phone on next week, in Mi Unlock Tool is a some timer.

1 Like

Yes, I expected the delay. That’s one of the reasons I would not recommend Xiaomi now, though the hardware is usually pretty good.

The current Android 10 could work, we’ll se about that.

Also, you need to find a TWRP or OrangeFox advertised to work for toco (in those 160+ hours;)

@silentindark I’ve asked admins to split this into a new topic and continue in this new thread.

I think that I found TWRP and OrangeFox
TWRP Q (Android 10) Vendor:
https://sourceforge.net/projects/androidhq254/files/Toco/Recovery/TWRP/Q%20(Android%2010)%20Vendor/

OrangeFox Q (Android 10) Vendor:
https://sourceforge.net/projects/androidhq254/files/Toco/Recovery/OrangeFox/Q%20(Android%2010)%20Vendor/

What you thinks about this images? Or I should use another one?

Should be ok, let’s see them in action when you finish unlocking.

The phone is unlocked:



Ready to continue

Ok, let me try to imagine some installation steps.

  1. Test that the kernel boots → In fastboot mode,

    • from the PC: fastboot boot hybris-boot.img
    • test if you can connect to telnet 192.168.2.15 2323
      This does not install the kernel.
  2. you already found a custom ROM such as Lineage or Lineage-based, or at least a xiaomi.eu? version - that would help for example with not replacing TWRP or OrangeFox on boot as the original firmware may do. If you have a such ROM, based on Android 10, try to install that first and test the hardware works. This might not be required.

  3. Install TWRP or OrangeFox and boot into recovery mode.

  4. Boot into recovery mode (vol-up + power if I recall correctly). Enable ADB shell and push the tar.gz. file found in one of the releases zip here
    3.1 Clear/format /data from TWRP or OrangeFox UI
    3.2 adb push sailfishos-tucana-release-$xyz.tar.gz /data/ (replace $xyz with what you have)
    3.3 adb shell
    3.4 mkdir -p /data/.stowaways/sailfishos
    3.5 tar --numeric-owner -xvzf sailfishos-tucana-release-$xyz.tar.gz -C /data/.stowaways/sailfishos
    The last step just unpacked the rootfs where the boot image tries to find it. Clearing /data from now on will also clear the rootfs so you have to redo steps 3.1-3.5 if so

  5. (This step can be done before 3 too) Reboot into fastboot, and flash the kernel `fastboot flash boot hybris-boot.img)

  6. Reboot “normally” - no vol up/down. Connect the cable to see on your PC if dmesg lists Mer Boat Loader when USB is connected. Regardless, if you are lucky, you should see the Ahoi! Welcome to Sailfish screen after some time (>1 minute).

Please ask for details mentioning the step number, maybe I have not sufficiently explained or got something wrong.

2 Likes
  1. For this step if you don’t have another ROM you should use fasboot to back up boot, system and vendor at least
1 Like

Step 0. Test that the kernel boots → In fastboot mode,
From PS(PowerShell)
image


Telnet report that can’t connect.
It means that kernel is not suitable, right? Or I do something wrong?

Not neccesarily - if you would have connected it would have meant it is suitable, but otherwise, there may be other causes for it to not work.

Since you are on Windows, the question is - does it detect a new USB device and is that a networking one and if yes, does it get an IP? If all are true except getting an IP address then manually set an IP like 192.168.2.14 (not 15) and mask 255.255.255.0
Also try disconnecting and reconnecting the cable.

Another thing to try is on exactly the next boot (which can be in TWRP/OFox since that can already be installed) to grab through adb shell the /sys/fs/pstore/ files. Those are not real files but memory mapped from the previous boot, and they should have a dmesg-equivalent log.

1 Like

No problem, I can you Linux
Step 0. Test that the kernel boots → In fastboot mode,
From terminal
image
After execution command “fastboot boot hybris-boot.img” the screen on the phone goes dark, and it looks lite that phone is turned off. Power button is turned on the phone back to Android.

That screen behavior is not good. So try

on exactly the next boot (which can be in TWRP/OFox since that can already be installed) to grab through adb shell the /sys/fs/pstore/ files. Those are not real files but memory mapped from the previous boot, and they should have a dmesg-equivalent log.