UBports Robot Logo UBports Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login

    What's the return of systemd-detect-virt on your device ?

    Scheduled Pinned Locked Moved Unsolved Support
    1 Posts 1 Posters 28 Views 1 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
      Reply
      • Reply as topic
      Log in to reply
      This topic has been deleted. Only users with topic management privileges can see it.
      • G Offline
        gpatel-fr
        last edited by

        Hello

        Following the recent post by @mariogrip enumerating among the problems of UT the impossibility to turn off dev mode, I can repro this problem (I think that I use the same device, a Fairphone 5).

        I have looked at this problem and seen that this is not a new occurence of the solved issue caused by a code problem in Lomiri settings: the setting is done effectively as returned by

        gdbus call --system --dest com.meego.usb_moded --object-path /com/meego/usb_moded --method com.meego.usb_moded.get_config

        clearing the switch the mode in settings set the mode to mtp instead of mtp_adb as intended.
        However, after rebooting, the mode is again mtp_adb.

        There is a systemd service called force-adb that is running at startup and calls the script /usr/libexec/force-adb, in this script there is this line:

        # In the emulator, we always want to first have the ADB on
        elif systemd-detect-virt --quiet --vm; then
            force_adb_to=1
        
        

        calling systemd-detect-virt returns on the FP5 returns:

        vm-other

        In the systemd sources, I have seen that the code is testing /proc/device-tree/hypervisor/compatible and if there is no value at this address it goes on to test other kinds of virtualization and if nothing match return finally VIRTUALIZATION_NONE. Obviously since we are running on a real phone, this is the desired value.
        Other code routes, when no other virtualization is detected, are NOT leading to VIRTUALIZATION_NONE but to VIRTUALIZATION_VM_OTHER.

        That's the reason why the FP5 can't change the Adb mode.

        Now my question: if you have a phone other than a Fairphone 5, can you check on this systemd-detect-virt utility and see if it returns 'vm-other' (bad !) or 'none' (correct) ?

        If the FP5 is the only one suffering from this problem this is a device issue.
        If all Qualcomm devices (the /proc/device-tree/hypervisor/compatible value is qcom,haven-hypervisor-1.0qcom,haven-hypervisorsimple-bus) have this problem, it's a general problem that must be fixed in the /usr/libexec/force-adb script.

        Bonus question: does anyone knows a way to find in which deb package can be found a given file, like this force-adb script ? On normal Ubuntu, apt-file makes it easy, but here we don't have it.

        Thanks for helping to advance the Fairphone cause !

        1 Reply Last reply Reply Quote 0
        • First post
          Last post