[snip]
Speaking of which I've been playing with xbin for the past couple of hours. So anything in /system/xbin is copied to /sbin/supersu/xbin_bind at boot. In effect merging the contents of the 2 directories, with /system/xbin taking precedence if 2 files have the same name. Delete a file, that exists in /system/xbin, it will be restored on a reboot.
That's all fine, once I understand it I can deal with it. The funny thing is that it appears that "BINDSYSTEMXBIN=true" isn't needed. I'm getting the same results both with and without it. (Yes I remembered to reflash supersu when changing it).
As far as locating /data/adb/su I found a way that works (when /data is available).
Code:
. . .
target=$(find /data -name supersu_is_here -print0|xargs -r0 dirname)
if [ -e "$target" ]
then
target=${target}/xbin_bind
else
. . .
TWRP uses busybox so the -r works for xargs
(Note
@osm0sis - used the above to modify your busybox installer. Inserted following line 134 of update-binary. Worked fine)