[Toybox] [PATCH] modprobe: add -d option to specify module directory path(s)

enh enh at google.com
Mon Jan 30 09:59:18 PST 2017


On Sat, Jan 28, 2017 at 3:34 PM, Rob Landley <rob at landley.net> wrote:
>
>
> On 01/25/2017 06:20 PM, enh wrote:
>> On Wed, Jan 25, 2017 at 3:59 PM, Steve Muckle <smuckle at google.com> wrote:
>>> While most systems have their kernel modules, modules.dep etc located at
>>> /lib/modules/`uname -r` this is not always the case.
>>
>> in case it isn't obvious: "...such as on Android".
>
> I figured that out. :)
>
>>> The -d option may be used to specify a nonstandard path for these files.
>>> It may be used more than once to specify multiple directories where
>>> these files may be found.
>>
>> +    TT.dirs->arg = xmalloc(strlen(MODULE_BASE_DIR) + strlen(uts.release) + 1);
>> +    strcpy(TT.dirs->arg, MODULE_BASE_DIR);
>> +    strcat(TT.dirs->arg, uts.release);
>>
>> or xmprintf?
>
> Yeah, and move MODULE_BASE_DIR inline. And while I'm there...
>
> I put a blank space between GLOBALS() filled out by option parsing and
> the ones zeroed on entry.
>
> The dummy() function and TT.debug means the code is always compiled in,
> I switched TT.dbg to if (toys.optflags&FLAG_v) before each one because
> if I want to get the code to drop out at compile time someday (via dead
> code elimination when FLAG_v is zero) I can do that. (But I haven't yet
> moved FLAG_v under TOYBOX_DEBUG because Android doesn't enable
> CFG_TOYBOX_DEBUG so moving FLAG_v under that would be a behavior
> difference for you guys. Thought you used that but double checking it's
> off...)
>
> Speaking of which: CONFIG_TOYBOX_DEBUG enables extra error checking and
> error messages, mostly for things that can only be screwed up by
> modifying the source, not at runtime. It also enables patch -x to show
> the very verbose decisions it's making about what counts as a match. It
> sounds like the kind of thing Android would want to enable anyway. :)

here's the checkin comment that disabled it:

  Date:   Wed, 20 Jan 2016 22:23:26 -0800

  Disable CFG_TOYBOX_DEBUG for now.

  We turned on CFG_TOYBOX_DEBUG so ls would be asan-clean, but that turns out
  to have broken mount for non-root users. So let's turn CFG_TOYBOX_DEBUG off
  for now, but let's also say that ls should always be asan-clean on Android.

  Bug: http://b/26647560

we definitely care about not upsetting the compiler or asan, but with
no-one regularly testing CFG_TOYBOX_DEBUG, it didn't seem worth the
trouble. given how cheap (and "shouldn't happen") most of the checks
are you could just remove the guards... the ps.c in particular seems
odd.

> (I need to fix the option assembly logic so FLAG_x and FLAG_v can be in
> a separate CONFIG option and the help entries get collated properly. It
> worked at one point, I wonder what broke...)
>
> That's probably enough for now, working through the backlog of release
> todo items...
>
> Rob
> _______________________________________________
> Toybox mailing list
> Toybox at lists.landley.net
> http://lists.landley.net/listinfo.cgi/toybox-landley.net



-- 
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