3

I want to workaround a vendor bug in an Android 5.0 phone (chinese, MTK, no proper source)

Problem is due to a bug in some binary, /data is not properly released on

vold.decrypt=trigger_shutdown_framework

and

vold.decrypt=trigger_reset_main

As a result, /data does not unmount (even if fuser -m and lsof report no process "holding" it)

A workaround is to use busybox to do a "busybox umount -l /data", encryption goes to proceed fine then, but you can't do it over ADB every time you want to DEcrypt your phone (remember, bug manifests for trigger_reset_main too!)

So, my idea was to change init.rc along the lines of

on property:vold.decrypt=trigger_reset_main
    start forcedata
    class_reset main

on property:vold.decrypt=trigger_load_persist_props
    load_persist_props

on property:vold.decrypt=trigger_post_fs_data
    trigger post-fs-data

on property:vold.decrypt=trigger_restart_min_framework
    class_start main

on property:vold.decrypt=trigger_restart_framework
    class_start main
    class_start late_start

on property:vold.decrypt=trigger_shutdown_framework
    start forcedata
    class_reset late_start
    class_reset main

And then declare a service

# CUSTOM FORCEDATA SERVICE
service forcedata /system/bin/sh /forcedata.sh
    disabled
    oneshot

And put an forcedata.sh file in ramdisk which basically contains the busybox umount -l /data thing

BTW, Lolipop, nastily, no longer allows you to push messages to logcat, so debugging this one is becoming extra-hard

Problem: The script doesn't run at all.

I suspect it is due to Selinux shenanigans, but can't verify for sure (logcat does not appear to contain useful pointers)

Did anyone here have success with running .sh scripts via init.rc modification under Lolipop, and if so, how do you do that ?

P.S.: Using Carliv to un/re pack the boot.img

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.