[Toybox] [PATCH] modinfo -b, -k with tests

idunham at lavabit.com idunham at lavabit.com
Thu Jun 27 08:04:13 PDT 2013


Attached is a patch that adds -b and -k to modinfo, with tests.
Output of -b differs from module-init-tools by one slash (apparently,
they add a / after basedir, then append /lib/modules/...)
I don't know a better way to test that -k <other_kernel version>
works. 
-b might be better tested using a symlink to /.


I'm also including a small fix for -F (a test got inverted) and
using snprintf to avoid a potential buffer overflow.


On Wed, Jun 26, 2013 at 10:35:08PM -0500, Rob Landley wrote:
> ======quoted message from lamiaworks <lamiaworks at skymesh.com.au>,
> subject "[PATCH] Re: modinfo..."======
> >On 06/22/2013 06:49 AM, toybox-request at lists.landley.net wrote:
> >>
> >>On Wed, Jun 19, 2013 at 11:44:08PM -0500, Rob Landley wrote:
> >>>On 06/18/2013 08:55:42 AM, Isaac wrote:
> ...
> >>Thanks for the answer; I missed that, probably due to trying to read
> >>rather late.
> >>I have a patch that assumes that the presence of the string
> >>".ko" indicates
> >>use of a path to a module (*.ko.xz and similar included, but not
> >>supported).
> >>
> >>While I am not aware of any rules forbidding a module like
> >>"barf.ko.ko",
> >>an strace of module-init-tools modinfo indicates that they If -b
> >>is given, use an image of the module tree. use similar logic.
> >>
> >>It adds 6 lines, with 41 bytes increase in binary size (GCC 4.4,
> >>glibc/dynamic and musl/static, according to make
> >>baseline/bloatcheck).
> >>I'm not sure if the void->int change was needed, though it does
> >>keep GCC
> >>quiet. But perror_exit; -> perror_msg; return; was needed.
> >>
> >>Thanks,
> >>Isaac Dunham
> >
> >Looking from puppy linux, the -d is in module-init-tools version 3.16,
> 
> Except I thought he was talking about -b? (Base path?)
> 
> >I also think it's used within kmod (replaces module-init-tools)
> >especially when
> >working with eudev so for those changing over it may be worth adding.
> 
> I'm definitely interested in making eudev work. That said, the
> submitter withdrew the original -b patch and I haven't got a test
> case for it so I dunno what doing it right looks like...
> 
> >regards
> >scsijon
> 
> Rob

-------------- next part --------------
A non-text attachment was scrubbed...
Name: modinfo-bk.diff
Type: text/x-diff
Size: 2622 bytes
Desc: not available
URL: <http://lists.landley.net/pipermail/toybox-landley.net/attachments/20130627/8d117960/attachment-0007.diff>


More information about the Toybox mailing list