Based on the package/apps/Terminal implementation. I'll switch them over shortly. This also lets us build the toybox version of netcat. Change-Id: Ia922a100141a67409264b43b937eeca07b21f344