[Toybox] Proposal: Add ucsicontrol (USB Type-C UCSI utility) to toybox

Rob Landley rob at landley.net
Fri Oct 2 21:13:14 UTC 2026


On 10/2/26 16:03, Rob Landley wrote:
> On 9/8/26 17:48, Rob Landley via Toybox wrote:
>>>>> Are you planning to release ucsicontrol in android tree ( https:// 
>>>>> android.googlesource.com/platform/external/toybox/) ?
>>>>
>>>> That's an Elliott question.
>>>
>>> the semi-auto updating infrastructure currently only supports github
>>> (which has helpful [rest] apis), so we're on "whatever's in github".
>>
>> I can work on cutting a release this month, and push the release 
>> version to github. (It's coming up on 3 months anyway, https:// 
>> landley.net/ toybox/faq.html#releases says quarterly releases...)
> 
> I haven't forgotten, just... cutting a release always takes longer than 
> I expect. (The extra regression testing, whole tree git diff to see what 
> I haven't checked in, going through the git log to assemble release 
> notes, building binaries for all the targets... it always finds loose 
> ends.)

Speaking of which: Elliott, is android going to need:

--- a/lib/lib.c
+++ b/lib/lib.c
@@ -1289,7 +1289,7 @@ struct passwd *bufgetpwnamuid(char *name, uid_t uid)
    unsigned size = 256;

    // Free cache list if time changes. (stat() cheap due to dentry cache)
-  if (!stat("/etc/passwd", st) && passtime!=st->st_mtime) {
+  if (!IS_ANDROID && !stat("/etc/passwd", st) && passtime!=st->st_mtime) {
      passtime = st->st_mtime;
      while (pwuidbuf) free(llist_pop(&pwuidbuf));
    }
@@ -1338,7 +1338,7 @@ struct group *bufgetgrnamgid(char *name, gid_t gid)
    unsigned size = 256;

    // Free cache list if time changes. (stat() cheap due to dentry cache)
-  if (!stat("/etc/group", st) && grptime!=st->st_mtime) {
+  if (!IS_ANDROID && !stat("/etc/group", st) && grptime!=st->st_mtime) {
      grptime = st->st_mtime;
      while (grgidbuf) free(llist_pop(&grgidbuf));
    }

Because I suspect your selinux logging is gonna throw a wobbly on trying 
to stat something out of /etc to see if it's there. After the first time 
there should be negative dcache entries returning a pretty quick answer 
from the syscall, but for all I know the security whitelisting could 
have binder turn failures into microkernel-style IPC which sounds 
expensive even if ignored...?

Rob

P.S. It was a TODO item left over from the ${x at P} \u thing I asked Chet 
about, which in bash it's cached at startup time and can't be changed 
without re-execing the shell, which seemed wrong...


More information about the Toybox mailing list