Sorry to invade discussion but i’m trying to add SU on Marshmallow AOSP rombuild.
I’m using user build and enabled selinux permissive on it.
i have made also ro.secure=0 ro.debuggable=1 and security.perf_harden=0 (Not sure if needed)
I have also modified to change the su permissions in fs_config.c
I managed to get this work with this guide so that when flashing rom SuperSu ask for updating su binary and after that su works.
I then cleaned work area to verify build by deleting out dir and recompiled. No go anymore.
I did build eng build to see if problem was that user build but still i get no SU installed.
AOSP doesn’t seem to have init.d support by default so 99SuperSUDaemon doesn’t get run.
if i run command from 99SuperSUDaemon, SuperUser then notifies that su must be updated and after that it’s working.
i tried to make service to init.rc which would run /system/xbin/daemonsu --auto-daemon & command but then SeLinux kicks in even it’s Permissive.
Now i got it. It seems that i have previously used eng build in some phase and then moved back to user build so something was in build area to enable root. When cleaned it stopped working.
for the daemonsu i change my init.rc scipt to look like this.
service daemonsu /system/xbin/daemonsu --auto-daemon &
class main
user root
seclabel u:r:su:s0
You need to modify some files the path of external/sepolicy
I think it need to add more permissions support for SU
You can try to add the permissions for SU step by step.
Example:
If you saw the permission information in printing log like this.