[Toybox] insmod -

enh enh at google.com
Tue Jan 19 14:56:13 PST 2016


although Nexus devices ship with kernel modules disabled (because no
one wants to have to worry about those exploits), they're still used
during bringup. i was asked recently for "insmod -" support (because
the module you want to install is on the host and you want to do
something like "cat module | adb shell insmod -" rather than have to
copy the module across first), but was surprised to see that there's
no way to say "read me a file, allocating the buffer yourself".

insmod currently has

  len = fdlength(fd);
  buf = xmalloc(len);
  xreadall(fd, buf, len);

and there are a few places that call fdlength and then mmap, but
fdlength won't work for stdin.

readfileat won't help because although it'll fall back to guessing
4096 bytes, it won't increase the size of that guess if it turns out
that there's more data.

should i fix readfileat or is this deliberate?

-- 
Elliott Hughes - http://who/enh - http://jessies.org/~enh/
Android native code/tools questions? Mail me/drop by/add me as a reviewer.



More information about the Toybox mailing list