Skip to content

After the whole backup over EDL, PICO OS refuses to keep USB debugging #172

Backlog

Description

@Xenolphthalein

As an owner who chose to keep USB debugging on during Restore to stock, I want PICO OS to keep it after a restore that
writes my whole backup over EDL, so that the next install finds the headset without me turning USB debugging on
again.

Now: a restore of a headset another data folder had installed went through EDL mode (the owner's key restarted it
there). It wrote the whole backup back with PICO OS's debug start (cycle --restore-all --debug-start, phoenix at
main, Windows 11). PICO OS's first start answered on adb, but storing the choice failed:

adb shell "settings put global development_settings_enabled 1 && setprop persist.vendor.usb.config mtp,adb && sync && echo stored"
setprop: failed to set property 'persist.vendor.usb.config' to 'mtp,adb'

The restore then said that USB debugging did not stay on, and after the stock boot image went back, adb listed nothing.
The same command stored the choice in earlier restores that went back through overpressure's recovery. That debug
start is written by the recovery; this one by device restore-all --image boot=… over EDL. The whole backup over EDL
with the debug start ran on hardware for the first time here. Not known yet: why setprop is refused (SELinux, the
property's owner, or the first start's state at that moment) and whether a retry later in the first start succeeds.

Acceptance criteria

  • Why setprop persist.vendor.usb.config is refused after the restore over EDL is known.
  • With Keep USB debugging on, PICO OS answers on adb after that restore's end, as after a restore through the
    recovery.
  • The restore through the recovery keeps working the same way.
  • Host tests for what changes; the restore over EDL checked on the headset.

Activity

  1. added
    installer
    on Dec 2, 2026
  2. Xenolphthalein commented on Dec 3, 2026

    @Xenolphthalein
    ContributorAuthor

    Found and fixed.

    Why setprop is refused. The whole backup over EDL writes the stock bootloader with everything else, so PICO OS's first start runs under it, with SELinux enforcing, and that refuses adb's shell the vendor's USB property:

    avc: denied { set } for property=persist.vendor.usb.config ... scontext=u:r:shell:s0 tcontext=u:object_r:vendor_usb_prop:s0 tclass=property_service permissive=0
    init: Unable to set property 'persist.vendor.usb.config' to 'mtp,adb' ... SELinux permission check failed
    

    Through overpressure's recovery the first start runs under the engineering bootloader, where PICO OS starts permissive, and the same command stores it. On the development headset with the same boot image and the same data, only the bootloader differed: stock gives Enforcing and the refusal, engineering gives Permissive and rc=0. The debug start itself took either way (unlocked, orange, ro.force.debuggable=1).

    The fix. With the debug start, the whole backup over EDL now writes the engineering bootloader in place of the stock one (device restore-all --image abl=..., checked against its hash first, nothing written otherwise), as the restore through the recovery leaves it for that start; Write the stock bootloader then writes the backup's boot and bootloader back, as before. The restore also downloads the unlock files first now: the backup over EDL needs the loader, and this start the engineering bootloader.

    On the headset (Windows): cycle --restore-all --debug-start with the fix; PICO OS's first start Permissive, USB debugging stored (stored); cycle --restore-only; PICO OS's own start afterwards with the stock bootloader (Enforcing, no debug properties) answers adb, persist.sys.usb.config=mtp,adb, adb_enabled and development_settings_enabled 1.

    • Why setprop persist.vendor.usb.config is refused after the restore over EDL is known.
    • With Keep USB debugging on, PICO OS answers on adb after that restore's end (its steps run by hand: the cycle, the store, the bootloader step).
    • The restore through the recovery keeps working the same way: its code is unchanged; not run again on the headset.
    • Host tests for what changes; the restore over EDL checked on the headset.
  3. Xenolphthalein commented on Dec 3, 2026

    @Xenolphthalein
    ContributorAuthor

    Landed on main in 768a916 (#191). Left open: the restore through overpressure's recovery run once more on the headset (its code is unchanged).

  4. Xenolphthalein commented on Dec 3, 2026

    @Xenolphthalein
    ContributorAuthor

    The restore through overpressure's recovery, rerun on the development headset (Windows) with phoenix main (768a916): overpressure restore from the installed system, Keep USB debugging on chosen. It went through the recovery (the backup over EDL skipped): PICO OS's system, fresh data and its recovery written, PICO OS's first start finished by itself with USB debugging stored, then its stock bootloader written back.

    PICO OS's own start afterwards (Enforcing, no debug properties, orange) answers adb: persist.sys.usb.config=mtp,adb, adb_enabled and development_settings_enabled 1.

    • The restore through the recovery keeps working the same way.

    Every criterion is met.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    installer

    Type

    Fields

    Stage

    Awaiting release

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions