Skip to content

su command failing in addon.d-v2+ scripts #972

@osm0sis

Description

@osm0sis

Describe the bug
KernelSU does not seem to have a way to allow su commands to function when executed from an addon.d script.

Steps to reproduce

  1. Use an A/B device and custom ROM with addon.d support (e.g. Lineage)
  2. Use root to add an addon.d-v2+ (i.e. A/B) script which uses su to /system/addon.d and set chmod 755 it (e.g. 97-dumpimages.sh - unzip from attached 97-dumpimages.sh.zip)
  3. Accept a ROM A/B OTA, let it complete then reboot as instructed
  4. See that the script did not function (e.g. no partition dumps were created in /sdcard/Download)

Log
I piped output from the su command in the script, which confirms it fails with the following:

/postinstall/tmp/addon.d/97-dumpimages.sh[135]: su: inaccessible or not found

Expected behaviour
KernelSU has a com.android.shell entry in the default list to allow adb shell su commands, and should have something similar to allow su commands from the update_engine/backuptool so that addon.d scripts using su can function like they would with Magisk.

I tried enabling root for com.android.shell, and other system packages like android, systemui, Lineage's updater, etc, with no luck, but there must be something that KernelSU can do to allow it.

Smartphone info

  • Device: OnePlus 7T
  • OS: Lineage 20 (Android 13)
  • Version: KernelSU 11191 + Manager v0.6.8 (11238)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions