Skip to content
GitLab
    • GitLab: the DevOps platform
    • Explore GitLab
    • Install GitLab
    • How GitLab compares
    • Get started
    • GitLab docs
    • GitLab Learn
  • Pricing
  • Talk to an expert
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
    • Switch to GitLab Next
    Projects Groups Topics Snippets
  • Register
  • Sign in
  • A android
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Issues 609
    • Issues 609
    • List
    • Boards
    • Service Desk
    • Milestones
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
  • Activity
  • Create a new issue
  • Issue Boards
Collapse sidebar
  • LineageOSLineageOS
  • issues
  • android
  • Issues
  • #1850
Closed
Open
Issue created Apr 25, 2020 by Mayeul C.@MayeulC

Sideloading f-droid privileged extension fails on 17.1

Context

  • Reported on F-droid's side
  • Forum thread the issue was initially debugged in
  • Device: Samsung Galaxy S4 with LineageOS 17.1 and same recovery version

Expected Behavior

  1. adb reboot recovery
  2. "Apply update"
  3. adb sideload org.fdroid.fdroid.privileged.ota_2110-mod.zip
  4. Confirm despite the signature verification
  5. Reboot

Current Behavior

Works up to 5. Upon rebooting, the privileged extension doesn't work. Additionally, ADB ceases to work after sideloading.

Possible Solution

I investigated this quite thoroughly. There are a few inconsistencies regarding how things are handled:

  1. Inside the recovery, $PATH is /system/bin
  2. F-droid's OTA mounts /system, relying on the recovery's fstab.
  3. The recovery itself mounts the system partition at /mnt/system when prompted.
  4. Binaries are in /system/system/bin after mounting the /system partition, so they are not found in $PATH, which breaks everything. Additionally, symlinks aren't working TODO
  5. F-droid relies on getprop ro.build.system_root_image returning true to detect the system path as /system/system. It isn't set to true.

Based on those, even though I am unfamiliar with lineage's build system, I'm wondering if the recovery shouldn't be built with ro.build.system_root_image = true. I think it should at least have /system/system/bin set as the $PATH, or as a secondary one, to keep working after mounting system.

As an additionnal note, adding /system/system/bin to the $PATH doesn't work, nor does copying the /system/bin binaries somewhere else beforehand. I don't know why this happens, could be due to a different $LD_LIBRARY_PATH, though I tried setting that to /system/system/lib:

jflte:/ # mount /system
jflte:/ # ls
/system/bin/sh: ls: inaccessible or not found
jflte:/ # echo $PATH
/sbin:/system/sbin:/product/bin:/apex/com.android.runtime/bin:/system/bin:/system/xbin:/odm/bin:/vendor/bin:/vendor/xbin
jflte:/ # export PATH=$PATH:/system/system/bin
jflte:/ # echo $PATH
/sbin:/system/sbin:/product/bin:/apex/com.android.runtime/bin:/system/bin:/system/xbin:/odm/bin:/vendor/bin:/vendor/xbin:/system/system/bin
jflte:/ # ls
/system/bin/sh: /system/system/bin/ls: Too many symbolic links encountered

Steps to Reproduce

  1. Download the latest f-droid OTA zip
  2. Follow instructions from the expected behaviour.

Alternatively:

computer ~ % adb reboot recovery
computer ~ % adb shell
jflte:/ # mount /system
jflte:/ # ls

Additional info:

  • Build number: lineage_jfltexx-userdebug 10 QQ2A.200405.005 e1e00a455b

/device jfltexx /version lineage-17.1 /date 2020-04-20 /kernel 3.4.112-g8c8593f /baseband I9505XXUHPK2 /mods F-Droid

I have read the directions.

Edited Apr 25, 2020 by Mayeul C.
Assignee
Assign to
Time tracking