[Toybox] Getting Toybox into Android before the NetBSD userland wins out

Rob Landley rob at landley.net
Fri Oct 31 09:47:35 PDT 2014



On 10/31/14 00:29, Isaac Dunham wrote:
> On Fri, Oct 31, 2014 at 01:22:47AM +0000, Jason Spiro wrote:
>> About a month ago, I wrote:
>>
>>> Splendid!  [...] I've filed a feature request in the Android public issue 
>>> tracker.  I estimate that it could take a couple of days until it finally 
>>> gets assigned to Elliott Hughes, and then a couple more days until he 
>>> replies.
>>
>> The Android folks have replied.  More work will be required before Toybox can 
>> get into Android.  Please see the relevant feature-request discussion, reply 
>> there, then click the "star" icon to get updates in your email inbox in the 
>> future.
>>
>> Please see the discussion at:
>>
>>         http://b.android.com/76861
>>
>> Kind regards,
>> -- 
>> Jason Spiro:  computer consultant.

I added a comment:

https://code.google.com/p/android/issues/detail?id=76861#c5

>>From what I see, we need to make utmpx.h, shadow.h, and pty.h optional.
>
> pty.h is minimal: disable telnetd (pending) and part of netcat.
> 
> utmpx.h is something I've been wanting an excuse to disable.
> It means turning off w, who, and the user count in uptime.
> (There's also a lot of stuff in pending that will get turned off.)

There's already compile time probes in scripts/getconfig.sh, which
produces generated/Config.probed. Each probe has a config symbol and an
associated "try to compile and link this" C file (as a here document).
If the C compiles, the symbol is y, otherwise n.

These config symbols have no selection text after them so they don't
show up in menuconfig, but they can be used in dependencies to hide
commands that can't build on this system.

Note we can't RUN any of these programs we build in the probe, because
cross compiling. It's all 'does this compile or not', which is
admittedly a bit limiting...

> shadow.h bites; it means we'll need to disable su, passwd, login, and
> (pending) sulogin.
> I suppose that the Android authentication system will be completely different.

Yeah, I've wanted to test stuff against bionic's authetication for a
while. I believe they use some kind of database. (Well ok, the horrible
TI fork of android that Polycom used had stubs for most of the user
access functions that printed "this is not implemented" when you called
them. But that was circa 2011 so maybe it's better now.)

This is also why I've been uncomfortable with lib/password.c function
update_password() which parses colon-separated text. Android bought into
the Windows "system registry" concept, and seems to believe that a
binary relational database with a global namespace is somehow a good
idea. I'm not sure /etc/passwd applies.

> Since I'm eager to see utmpx made optional, I'll be sending in a compile-time
> probe for utmpx shortly. (I have the test written, but have not tried it
> or hooked it up.)

I actually hit that recently trying to build nommu stuff with a
circa-2009 toolchain. Turns out uClibc only grew utmpx.h around 4 years
ago. (Just because it's in posix-2008 doesn't mean uclibc would support
it in 2009...)

> And while I'm in the process of mucking around with that, I might as well
> add compile probes for shadow.h and pty.h.

I need to set up an AOSP build environment again. I had one in 2011 but
between the Chris Dibona tweet I linked to in the above bugzilla reply
and the rise of musl, I didn't move it to any of my current machines.
(It requires 30 gigs for a minimal build and 100 for a full build, and
my netbook has like 12 gigs free. Plus it wants me to install a jdk and
I don't really want to get any of Oratroll on me these days...)

> There was an old patch queue related to Android support that seems to have
> not gotten applied, but large portions of it have been rendered irrelevant.
> 
> http://lists.landley.net/pipermail/toybox-landley.net/2012-March/000288.html
> (path 0/10).

Someday I must be Georgi a beer. I keep dropping his patches on the floor...

> Thanks,
> Isaac Dunham

Rob

 1414774055.0


More information about the Toybox mailing list