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

I don’t see system_root mounting in the last log, did you have to mount it manually? Maybe get another log after you fix the other three partitions…

I have four *.mount scripts

output
'# vendor.mount

[Unit]
Description=Droid mount for /vendor
Before=local-fs.target systemd-modules-load.service

[Mount]
What=/dev/mapper/dynpart-vendor
Where=/vendor
Type=ext4
Options=ro,barrier=1,discard
'# Options had SELinux context option:

'# Default is 90 which makes mount period too long in case of
'# errors so drop it down a notch.
TimeoutSec=10

[Install]
WantedBy=local-fs.target

'# From ./out/target/product/toco/vendor/etc/fstab.default :
'# vendor

'# cat system.mount
[Unit]
Description=Droid mount for /system
Before=local-fs.target systemd-modules-load.service

[Mount]
What=/system_root/system
Where=/system
Type=none
Options=bind
'# Options had SELinux context option:

'# Default is 90 which makes mount period too long in case of
'# errors so drop it down a notch.
TimeoutSec=10

[Install]
WantedBy=local-fs.target

'# From ./device/xiaomi/tucana/rootdir/etc/fstab.qcom :
'# /dev/sda25

'# cat system_root.mount
[Unit]
Description=Droid mount for /system
Before=local-fs.target systemd-modules-load.service

[Mount]
What=/dev/mapper/dynpart-system
Where=/system_root
Type=ext4
Options=ro,barrier=1
'# Options had SELinux context option:

'# Default is 90 which makes mount period too long in case of
'# errors so drop it down a notch.
TimeoutSec=10

[Install]
WantedBy=local-fs.target

'# From ./device/xiaomi/tucana/rootdir/etc/fstab.qcom :
'# /dev/sda25 / ext4 ro,barrier=1,discard wait,avb
/usr/lib/systemd/system #

'# cat product.mount
[Unit]
Description=Droid mount for /product
Before=local-fs.target systemd-modules-load.service

[Mount]
What=/dev/mapper/dynpart-product
Where=/product
Type=ext4
Options=ro,barrier=1,discard
'# Options had SELinux context option:

'# Default is 90 which makes mount period too long in case of
'# errors so drop it down a notch.
TimeoutSec=10

[Install]
WantedBy=local-fs.target

'# From ./out/target/product/FP4/vendor/etc/fstab.default :
'# product

Fresh logs from last boot
https://paste.fo/raw/d0d7dfd38e5f

restart at 16:09:42
https://paste.fo/raw/a974dd73320f

Again, I don’t see system_root mounting before droid-hal-init. Is it linked under local-fs.target.wants as here?

less /usr/lib/systemd/system/dmsetup.service
~ # less /usr/lib/systemd/system/dmsetup.service 
[Unit]
Description=Setup dynamic partitions
Before=system.mount system_root.mount vendor.mount product.mount local-fs.target systemd-modules-load.service droid-hal-init.service
DefaultDependencies=no

[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/bin/bash /usr/bin/droid/dmsetup.sh

[Install]
WantedBy=droid-hal-init.service

Maybe need to modify hybris-boot (tucana mount points · sailfishos-on-tucana/hybris-boot@46750e9 · GitHub)?

for toco
    "toco")
        sed -i \
            -e 's block/bootdevice/by-name/abl sde36 ' \
            -e 's block/bootdevice/by-name/ablbak sde37 ' \
            -e 's block/bootdevice/by-name/aop sde16 ' \
            -e 's block/bootdevice/by-name/aopbak sde17 ' \
            -e 's block/bootdevice/by-name/apdp sde8 ' \
            -e 's block/bootdevice/by-name/bk01 sda4 ' \
            -e 's block/bootdevice/by-name/bk02 sda5 ' \
            -e 's block/bootdevice/by-name/bk03 sda6 ' \
            -e 's block/bootdevice/by-name/bk04 sda7 ' \
            -e 's block/bootdevice/by-name/bk05 sda10 ' \
            -e 's block/bootdevice/by-name/bk06 sda13 ' \
            -e 's block/bootdevice/by-name/bk07 sda15 ' \
            -e 's block/bootdevice/by-name/bk08 sda20 ' \
            -e 's block/bootdevice/by-name/bk09 sda22 ' \
            -e 's block/bootdevice/by-name/bk31 sdd1 ' \
            -e 's block/bootdevice/by-name/bk32 sdd3 ' \
            -e 's block/bootdevice/by-name/bk33 sdd5 ' \
            -e 's block/bootdevice/by-name/bk41 sde5 ' \
            -e 's block/bootdevice/by-name/bk43 sde24 ' \
            -e 's block/bootdevice/by-name/bk44 sde30 ' \
            -e 's block/bootdevice/by-name/bk45 sde40 ' \
            -e 's block/bootdevice/by-name/bk47 sde50 ' \
            -e 's block/bootdevice/by-name/bk51 sdf3 ' \
            -e 's block/bootdevice/by-name/bk52 sdf4 ' \
            -e 's block/bootdevice/by-name/bluetooth sde27 ' \
            -e 's block/bootdevice/by-name/boot sde49 ' \
            -e 's block/bootdevice/by-name/cache sda29 ' \
            -e 's block/bootdevice/by-name/catecontentfv sde29 ' \
            -e 's block/bootdevice/by-name/catefv sde19 ' \
            -e 's block/bootdevice/by-name/cateloader sde32 ' \
            -e 's block/bootdevice/by-name/cdt sdd2 ' \
            -e 's block/bootdevice/by-name/cmnlib sde20 ' \
            -e 's block/bootdevice/by-name/cmnlib64 sde22 ' \
            -e 's block/bootdevice/by-name/cmnlib64bak sde23 ' \
            -e 's block/bootdevice/by-name/cmnlibbak sde21 ' \
            -e 's block/bootdevice/by-name/core_nhlos sde51 ' \
            -e 's block/bootdevice/by-name/cust sda31 ' \
            -e 's block/bootdevice/by-name/dbg sda3 ' \
            -e 's block/bootdevice/by-name/ddr sdd4 ' \
            -e 's block/bootdevice/by-name/devcfg sde14 ' \
            -e 's block/bootdevice/by-name/devcfgbak sde15 ' \
            -e 's block/bootdevice/by-name/devinfo sda17 ' \
            -e 's block/bootdevice/by-name/dip sde28 ' \
            -e 's block/bootdevice/by-name/dsp sde48 ' \
            -e 's block/bootdevice/by-name/dtbo sde45 ' \
            -e 's block/bootdevice/by-name/exaid sda30 ' \
            -e 's block/bootdevice/by-name/frp sda9 ' \
            -e 's block/bootdevice/by-name/fsc sdf2 ' \
            -e 's block/bootdevice/by-name/fsg sdf1 ' \
            -e 's block/bootdevice/by-name/gsort sde44 ' \
            -e 's block/bootdevice/by-name/hyp sde42 ' \
            -e 's block/bootdevice/by-name/hypbak sde43 ' \
            -e 's block/bootdevice/by-name/ifaa sde46 ' \
            -e 's block/bootdevice/by-name/imagefv sda27 ' \
            -e 's block/bootdevice/by-name/keymaster sde25 ' \
            -e 's block/bootdevice/by-name/keymasterbak sde26 ' \
            -e 's block/bootdevice/by-name/keystore sda8 ' \
            -e 's block/bootdevice/by-name/limits sde4 ' \
            -e 's block/bootdevice/by-name/logdump sda24 ' \
            -e 's block/bootdevice/by-name/logfs sda14 ' \
            -e 's block/bootdevice/by-name/logo sde47 ' \
            -e 's block/bootdevice/by-name/metadata sda19 ' \
            -e 's block/bootdevice/by-name/minidump sda25 ' \
            -e 's block/bootdevice/by-name/misc sda11 ' \
            -e 's block/bootdevice/by-name/modem sde52 ' \
            -e 's block/bootdevice/by-name/modemst1 sdf5 ' \
            -e 's block/bootdevice/by-name/modemst2 sdf6 ' \
            -e 's block/bootdevice/by-name/msadp sde9 ' \
            -e 's block/bootdevice/by-name/multiimgoem sde1 ' \
            -e 's block/bootdevice/by-name/multiimgqti sde2 ' \
            -e 's block/bootdevice/by-name/oem_misc1 sda18 ' \
            -e 's block/bootdevice/by-name/oops sda16 ' \
            -e 's block/bootdevice/by-name/persist sdf7 ' \
            -e 's block/bootdevice/by-name/persistbak sdf8 ' \
            -e 's block/bootdevice/by-name/qupfw sde6 ' \
            -e 's block/bootdevice/by-name/qupfwbak sde7 ' \
            -e 's block/bootdevice/by-name/rawdump sda26 ' \
            -e 's block/bootdevice/by-name/recovery sda28 ' \
            -e 's block/bootdevice/by-name/secdata sde3 ' \
            -e 's block/bootdevice/by-name/splash sda21 ' \
            -e 's block/bootdevice/by-name/spunvm sde41 ' \
            -e 's block/bootdevice/by-name/ssd sda2 ' \
            -e 's block/bootdevice/by-name/storsec sde11 ' \
            -e 's block/bootdevice/by-name/super sda23 ' \
            -e 's block/bootdevice/by-name/switch sda1 ' \
            -e 's block/bootdevice/by-name/toolsfv sde35 ' \
            -e 's block/bootdevice/by-name/tz sde38 ' \
            -e 's block/bootdevice/by-name/tzbak sde39 ' \
            -e 's block/bootdevice/by-name/uefisecapp sde33 ' \
            -e 's block/bootdevice/by-name/uefisecappbak sde34 ' \
            -e 's block/bootdevice/by-name/uefivarstore sde18 ' \
            -e 's block/bootdevice/by-name/userdata sda32 ' \
            -e 's block/bootdevice/by-name/vbmeta sde10 ' \
            -e 's block/bootdevice/by-name/vbmeta_system sde12 ' \
            -e 's block/bootdevice/by-name/vbmeta_vendor sde13 ' \
            -e 's block/bootdevice/by-name/vm-data sda12 ' \
            -e 's block/bootdevice/by-name/xbl sdb2 ' \
            -e 's block/bootdevice/by-name/xbl_config sdb1 ' \
            -e 's block/bootdevice/by-name/xbl_configbak sdc1 ' \
            -e 's block/bootdevice/by-name/xblbak sdc2 ' \
            "$@"
        ;;

I will add last logs
https://paste.fo/raw/587e4713be1c

I’m pretty sure that fixup mountpoints from hybris-boot is only used for boot image and systemd mount unit creation. So we just need to figure out the correct systemd mounts online, on your device, and I’ll think about how to apply them in an update later.

Currently you are missing (because it was not necessary and worked by accident) the dependency from local-fs to mount system_root at least. That is one of the ln commands I pointed out is needed in my previous post.

File system_root.mount present in both /usr/lib/systemd/system/local-fs.target.wants/ and /usr/lib/systemd/system/ directories.
https://paste.fo/raw/a5f77ba87a1d

Not agree with you, because I have changed file /usr/lib/systemd/system/vendor-dsp.mount
Here was tucana setup “What=/dev/sde47” and I changed it to sde48 (toco)
After reboot, when I execute command, then I can see mounted “/vendor/dsp”
'# df -h
Filesystem Size Used Available Use% Mounted on
/dev/sde48 59.0M 22.8M 34.9M 40% /vendor/dsp

Logs from last boot:
https://paste.fo/raw/33fa32711473

Now mounted:
/dev/sde27 64.0M 704.0K 63.3M 1% /vendor/bt_firmware
/dev/sde48 59.0M 22.8M 34.9M 40% /vendor/dsp
/dev/sde52 319.9M 124.4M 195.5M 39% /vendor/firmware_mnt

I don’t understand why do you still dont get Mounting Droid mount for /system_root. That is an important piece (You can see it in my log from post #71)

Not agree with you, because I have changed file /usr/lib/systemd/system/vendor-dsp.mount

I did say systemd mount creation.
If you get this working I’ll add toco mounts somehow.

Wait! elros34 points out that your product mount is wrong.
Do you indeed have /dev/mapper/dynpart-product ? I thought only system and vendor.

How I can check, what dynpart-* I have in the device?

ls /dev/mapper/dynpart-* I guess? Or the output of dmsetup.sh
(I see systemd[1]: dmsetup.service: Main process exited, code=exited, status=1/FAILURE in your logs, is it really failing?

On my device /product is just a link to /system/product - I may have unintentionally given the /dev/mapper/dynpart-product_a example before you posted the output from dmsetup.sh

Out of curiosity, what does ls /product give you now? And: can you remove the product.mount and replace /product with just a link to /system/product?

1 Like

'# ls /dev/mapper/dynpart-*
/dev/mapper/dynpart-system /dev/mapper/dynpart-vendor
So I have only two dynpart-system and dynpart-vendor
I removed product.mount, odm_root.mount and system_ext.mount from /usr/lib/systemd/system and /usr/lib/systemd/system/local-fs.target.wants
because its not needed.

'# systemctl -l status dmsetup.service
● dmsetup.service - Setup dynamic partitions
Loaded: loaded (/usr/lib/systemd/system/dmsetup.service; disabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Sat 2024-06-22 17:02:40 EEST; 4h 56min ago
Process: 885 ExecStart=/bin/bash /usr/bin/droid/dmsetup.sh (code=exited, status=1/FAILURE)
Main PID: 885 (code=exited, status=1/FAILURE)

Warning: Journal has been rotated since unit was started. Log output is incomplete or unavailable.

/usr/lib/systemd/system # ls /product
ls: /product: Too many levels of symbolic links

Looks like a loop
/usr/lib/systemd/system # ls -lah /system/product
lrw-r–r-- 1 root root 8 Jan 1 2009 /system/product → /product

/usr/lib/systemd/system # ls -lah /product
lrwxrwxrwx 1 root root 15 Sep 25 2024 /product → /system/product
/usr/lib/systemd/system #

How to fix this?

1 Like

Interesting, it again does not match tucana.
However, post 93 shows you have a product folder in system_root
So you might ln -s /system_root/product product instead.

Yes, I have been fixed it by ln -s /system_root/product product in / directory
and after reboot


df -h
~ # df -h
Filesystem                Size      Used Available Use% Mounted on
/dev/sda32               47.5G      4.5G     43.0G  10% /
/dev/sda32               47.5G      4.5G     43.0G  10% /data
devtmpfs                  2.6G   1004.0K      2.6G   0% /dev
tmpfs                     2.7G         0      2.7G   0% /dev/shm
tmpfs                     2.7G      8.7M      2.7G   0% /run
tmpfs                     2.7G         0      2.7G   0% /sys/fs/cgroup
tmpfs                     2.7G         0      2.7G   0% /tmp
/dev/mapper/dynpart-vendor
                          1.0G   1023.0M         0 100% /vendor
/dev/mapper/dynpart-system
                          2.6G      2.6G         0 100% /system_root
/dev/mapper/dynpart-system
                          2.6G      2.6G         0 100% /system
/dev/sda32               47.5G      4.5G     43.0G  10% /system/lib64/libprocessgroup_setup.so
/dev/sda32               47.5G      4.5G     43.0G  10% /system_root/system/lib64/libprocessgroup_setup.so
/dev/sda32               47.5G      4.5G     43.0G  10% /system/lib64/libprocessgroup.so
/dev/sda32               47.5G      4.5G     43.0G  10% /system_root/system/lib64/libprocessgroup.so
/dev/sda32               58.0M      2.7M     53.4M   5% /persist
/dev/mapper/dynpart-system
                          2.6G      2.6G         0 100% /system_root/product
overlay                  47.5G      4.5G     43.0G  10% /vendor/etc
/dev/sde27               64.0M    704.0K     63.3M   1% /vendor/bt_firmware
/dev/sde48               59.0M     22.8M     34.9M  40% /vendor/dsp
/dev/sde52              319.9M    124.4M    195.5M  39% /vendor/firmware_mnt
/dev/sdf7                58.0M      2.7M     53.4M   5% /mnt/vendor/persist
/dev/sdf7                58.0M      2.7M     53.4M   5% /persist
/dev/sda32               47.5G      4.5G     43.0G  10% /system/etc/ld.config.29.txt
/dev/sda32               47.5G      4.5G     43.0G  10% /system_root/system/etc/ld.config.29.txt
/dev/block/loop0        836.0K    808.0K     12.0K  99% /apex/com.android.tzdata@292500001
/dev/block/loop0        836.0K    808.0K     12.0K  99% /apex/com.android.tzdata
/dev/block/loop1         95.9M     95.9M         0 100% /apex/com.android.runtime@1
/dev/block/loop1         95.9M     95.9M         0 100% /apex/com.android.runtime
/dev/block/loop2          5.3M      5.2M         0 100% /apex/com.android.media@292000301
/dev/block/loop2          5.3M      5.2M         0 100% /apex/com.android.media
/dev/block/loop3          1.6M      1.6M         0 100% /apex/com.android.resolv@290000000
/dev/block/loop3          1.6M      1.6M         0 100% /apex/com.android.resolv
/dev/block/loop4          5.1M      5.0M         0 100% /apex/com.android.conscrypt@290000000
/dev/block/loop4          5.1M      5.0M         0 100% /apex/com.android.conscrypt
/dev/block/loop5        232.0K     36.0K    192.0K  16% /apex/com.android.apex.cts.shim@1
/dev/block/loop5        232.0K     36.0K    192.0K  16% /apex/com.android.apex.cts.shim
/dev/block/loop6         20.9M     20.9M         0 100% /apex/com.android.media.swcodec@292200001
/dev/block/loop6         20.9M     20.9M         0 100% /apex/com.android.media.swcodec
tmpfs                   554.4M     28.0K    554.4M   0% /run/user/100000
5 Likes

Congrats! :fireworks:

Let’s see what works and what not, and then I’ll prepare an image with your changes, when I have the time.

3 Likes

Trank you very much for your help with launching tucana fw on toco!
I wiil test what works and what not, and definitely let you known.
In the previous post, in the “About product” screenshot, you can see one IMEI, but my device is a dual SIM device. There should be two IMEI’s.
It comes from tucana, right? Your device have only one SIM card?
How it is possible to fix?
Updated: Fixed, maybe restart helped

2 Likes

TEST PLAN:

Core functionality:
Display/Touch - Works
Wifi - Works
GSM Calls - Not tested yet
Cellular Data - not tested yet
Sound - not tested yet
Camera Pics - not tested yet
Video playback - not tested yet

More features that make the port complete:
Camera recording - not tested yet
Bluetooth - not tested yet
Vibration - not tested yet
Multiple cameras - not tested yet
MTP - not tested yet
Fingerprint on Display - not tested yet
Double-tap to wake - Works

Sensors:
GPS - not tested yet
Compass - not tested yet
Accelerometer - not tested yet
Proximity - not tested yet
Light - not tested yet
NFC - not tested yet

2 Likes

Camera doesn’t work.

This is very bad news as it is the proeminent change between the devices. You have a file like this in /etc, named droid-config-t5/sparse/etc/dconf/db/vendor.d/jolla-camera-hw.txt at master · sailfish-on-fxtecpro1/droid-config-t5 · GitHub - maybe try to add some imageResolution that is matching what toco's camera has natively (just the

[apps/jolla-camera/primary/image]
imageResolution='4000x3000'

part). Then dconf update as root.

About multi SIM: I do have 2 IMEIs on tucana. I think it works accidentally. For example, in this file droid-config-tucana/sparse/usr/share/csd/settings.d/hw-settings.ini at master · sailfishos-on-tucana/droid-config-tucana · GitHub (just as before, ignore sparse/ as that your root or / folder) there’s SIM=1, maybe it should be 2.

Also, do you have this file

# cat /etc/ofono/ril_subscription.d/dual-sim.conf
[ril_1]
transport=binder:name=slot2
name=slot2
ecclistFile=/run/ofono/ril.ecclist1
2 Likes