Ok, after much stracing and env printing, I found this variable ENV=/usr/libexec/openssh/load_developer_profile
which lead me to believe that script was supposed to be executed.
After much back and forh why is it not (again, logging from it) and seeing that the emulator device did execute it…
I just switched from gnu-bash
back to busybox-symlinks-bash
and… deployment started to work
On all my devices I had gnu-bash, turns out.
Basically if you run ENV=/path/to/some/script bash
with busybox, the script gets sourced. Not with bash though. Unless your shell is /bin/sh
, in which case it is.
My local man sh
says
ENV This variable, when and only when an interactive shell is invoked, shall be subjected to parameter expansion (see Section 2.6.2, Parameter Expansion) by the shell, and the resulting value shall be used as a pathname of a file containing shell commands to execute in the current environment. The file need not be executable. If the expanded value of ENV is not an absolute pathname, the results are unspecified. ENV shall be ignored if the real and effective user IDs or real and effective group IDs of the process are different.