Re: [LEDE-DEV] [PATCH ubox 0/6] kmodloader: add module alias support

2017-01-12 Thread Yousong Zhou
On 13 January 2017 at 03:07, Lucian Cristian  wrote:
> On 11.01.2017 13:54, Yousong Zhou wrote:
>>
>> Aliases are essential information for working with kernel modules.
>> Netfilter
>> subsystem will request for ipt_hashlimit and ip6t_hashlimit respectively
>> when
>> called with
>>
>> xt_request_find_match(NFPROTO_IPV{4,6}, "hashlimit", 1)
>>
>> The kernel __request_module() will then invoke user mode modprobe to load
>> them
>>
>> /sbin/modprobe -q -- ipt_hashlimit
>> /sbin/modprobe -q -- ip6t_hashlimit
>>
>> where ipt_hashlimit and ip6t_hashlimit are aliases of xt_hashlimit
>>
>> The patch depends on another patch in the build system to restore alias
>> info
>> to kernel modules.
>>
>> Yousong Zhou (6):
>>kmodloader: remove redundant glob wildcard char
>>kmodloader: log to kmsg when loading directories of modules
>>kmodloader: modprobe: skip possible command line arguments
>>kmodloader: fix out-of-bound access when parsing .modinfo
>>kmodloader: add module alias awareness
>>kmodloader: make insert_module() idempotent
>>
>>   kmodloader.c | 185
>> +--
>>   1 file changed, 154 insertions(+), 31 deletions(-)
>>
> applied it with minor patch 5 adjustments for ubox  (different version ? )
> and no more warning and some debugging on kmodloader (virtual machine
> tested)

The series is on top of ubox master branch which has a few commits not
included in the package/system/ubox/Makefile version.

>
> [8.141016] kmodloader: 2 modules could not be probed
> [8.141172] kmodloader: dependency not loaded sch56xx-common
> [8.141288] kmodloader: - sch5627 - 1
> [8.141380] kmodloader: - sch56xx-common - 0

If QEMU was being used without sch5627 emulation, then I expect the
above warning is expected behaviour.

Though there is indeed a missing pair of curly braces around the
avl_for_each_element inside main_modprobe().  I will send a v2 patch
series.


>
> I'm using it on x86_64:
>
> free space
>
> before:
>
>
>  41409642 lede-snapshot-r2919-d1daf3f-x86-64-combined-squashfs.img
>  24108138 lede-snapshot-r2919-d1daf3f-x86-64-rootfs-squashfs.img
>2659248 lede-snapshot-r2919-d1daf3f-x86-64-vmlinuz
>
> root@lede:~# df
> Filesystem   1K-blocks  UsedAvailable Use% Mounted
> on
> /dev/root  23552 23552 0 100% /rom
> /dev/loop0  236672 81100  140084  37% /overlay
> overlayfs:/overlay  236672 81100  140084  37% /
>
> after:
>
> 41411458 lede-snapshot-r2919-d1daf3f-x86-64-combined-squashfs.img
>  24109954 lede-snapshot-r2919-d1daf3f-x86-64-rootfs-squashfs.img
>2659248 lede-snapshot-r2919-d1daf3f-x86-64-vmlinuz
>
> root@lede:~# df
>
> Filesystem   1K-blocksUsed   Available Use% Mounted on
> /dev/root  23552  23552 0 100% /rom
> /dev/loop0  236672 81100140084  37% /overlay
> overlayfs:/overlay  236672 81100140084  37% /
>
> Regards

Hmm, I have no idea where does the more than 1KB size increase of
rootfs-squashfs.img come from...  I do not expect it to be caused by
the added alias info...

Thanks for the testing.

Regards

yousong

___
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev


Re: [LEDE-DEV] [PATCH ubox 0/6] kmodloader: add module alias support

2017-01-12 Thread Lucian Cristian

On 11.01.2017 13:54, Yousong Zhou wrote:

Aliases are essential information for working with kernel modules.  Netfilter
subsystem will request for ipt_hashlimit and ip6t_hashlimit respectively when
called with

xt_request_find_match(NFPROTO_IPV{4,6}, "hashlimit", 1)

The kernel __request_module() will then invoke user mode modprobe to load them

/sbin/modprobe -q -- ipt_hashlimit
/sbin/modprobe -q -- ip6t_hashlimit

where ipt_hashlimit and ip6t_hashlimit are aliases of xt_hashlimit

The patch depends on another patch in the build system to restore alias info
to kernel modules.

Yousong Zhou (6):
   kmodloader: remove redundant glob wildcard char
   kmodloader: log to kmsg when loading directories of modules
   kmodloader: modprobe: skip possible command line arguments
   kmodloader: fix out-of-bound access when parsing .modinfo
   kmodloader: add module alias awareness
   kmodloader: make insert_module() idempotent

  kmodloader.c | 185 +--
  1 file changed, 154 insertions(+), 31 deletions(-)

applied it with minor patch 5 adjustments for ubox  (different version ? 
) and no more warning and some debugging on kmodloader (virtual machine 
tested)


[8.141016] kmodloader: 2 modules could not be probed
[8.141172] kmodloader: dependency not loaded sch56xx-common
[8.141288] kmodloader: - sch5627 - 1
[8.141380] kmodloader: - sch56xx-common - 0

I'm using it on x86_64:

free space

before:


 41409642 lede-snapshot-r2919-d1daf3f-x86-64-combined-squashfs.img
 24108138 lede-snapshot-r2919-d1daf3f-x86-64-rootfs-squashfs.img
   2659248 lede-snapshot-r2919-d1daf3f-x86-64-vmlinuz

root@lede:~# df
Filesystem   1K-blocks  UsedAvailable Use% 
Mounted on

/dev/root  23552 23552 0 100% /rom
/dev/loop0  236672 81100  140084  37% /overlay
overlayfs:/overlay  236672 81100  140084  37% /

after:

41411458 lede-snapshot-r2919-d1daf3f-x86-64-combined-squashfs.img
 24109954 lede-snapshot-r2919-d1daf3f-x86-64-rootfs-squashfs.img
   2659248 lede-snapshot-r2919-d1daf3f-x86-64-vmlinuz

root@lede:~# df

Filesystem   1K-blocksUsed   Available Use% Mounted on
/dev/root  23552  23552 0 100% /rom
/dev/loop0  236672 81100140084  37% /overlay
overlayfs:/overlay  236672 81100140084  37% /

Regards


___
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev


[LEDE-DEV] [PATCH ubox 0/6] kmodloader: add module alias support

2017-01-11 Thread Yousong Zhou
Aliases are essential information for working with kernel modules.  Netfilter
subsystem will request for ipt_hashlimit and ip6t_hashlimit respectively when
called with

xt_request_find_match(NFPROTO_IPV{4,6}, "hashlimit", 1)

The kernel __request_module() will then invoke user mode modprobe to load them

/sbin/modprobe -q -- ipt_hashlimit
/sbin/modprobe -q -- ip6t_hashlimit

where ipt_hashlimit and ip6t_hashlimit are aliases of xt_hashlimit

The patch depends on another patch in the build system to restore alias info
to kernel modules.

Yousong Zhou (6):
  kmodloader: remove redundant glob wildcard char
  kmodloader: log to kmsg when loading directories of modules
  kmodloader: modprobe: skip possible command line arguments
  kmodloader: fix out-of-bound access when parsing .modinfo
  kmodloader: add module alias awareness
  kmodloader: make insert_module() idempotent

 kmodloader.c | 185 +--
 1 file changed, 154 insertions(+), 31 deletions(-)

-- 
2.6.4


___
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev