[Netkit.users] Netkit and Kernel module

Youri Korostelev korostelev.youri at gmail.com
Sat Feb 25 23:35:23 CET 2017


Hello Massimo,

I've been trying to apply your advice, however i'm encountering
difficulties, after downloading, and unpacking the kernel (i followed
the readme, the manual part), i tried to apply the patches and i get
the following error on all the hunks:
youri at Workstation:~/opt/netkit_install/netkit/kernel$    for
CURRENT_PATCH in $NETKIT_HOME/kernel/patches/*.diff; do \
>       patch -p1 < $CURRENT_PATCH; done
patching file arch/um/drivers/Makefile
Hunk #1 FAILED at 17.
1 out of 1 hunk FAILED -- saving rejects to file arch/um/drivers/Makefile.rej
patching file include/linux/genetlink.h
Hunk #1 FAILED at 79.
1 out of 1 hunk FAILED -- saving rejects to file include/linux/genetlink.h.rej
patching file include/linux/if_arp.h
Hunk #1 FAILED at 86.
1 out of 1 hunk FAILED -- saving rejects to file include/linux/if_arp.h.rej
The next patch would create the file include/linux/mpls.h,
which already exists!  Assume -R? [n] y
patching file include/linux/mpls.h
patching file include/linux/netdevice.h
Hunk #1 FAILED at 613.
1 out of 1 hunk FAILED -- saving rejects to file include/linux/netdevice.h.rej
The next patch would create the file include/linux/netfilter/xt_mpls.h,
which already exists!  Assume -R? [n] y
patching file include/linux/netfilter/xt_mpls.h
patching file include/linux/ppp_defs.h
Hunk #1 FAILED at 82.
1 out of 1 hunk FAILED -- saving rejects to file include/linux/ppp_defs.h.rej
patching file include/linux/rtnetlink.h
Hunk #1 FAILED at 274.
1 out of 1 hunk FAILED -- saving rejects to file include/linux/rtnetlink.h.rej
The next patch would create the file include/linux/shim.h,
which already exists!  Assume -R? [n] y
patching file include/linux/shim.h
patching file include/linux/socket.h
Hunk #1 FAILED at 184.
Hunk #2 FAILED at 220.
2 out of 2 hunks FAILED -- saving rejects to file include/linux/socket.h.rej
patching file include/linux/sysctl.h
Hunk #1 FAILED at 231.
Hunk #2 FAILED at 789.
Hunk #3 FAILED at 807.
3 out of 3 hunks FAILED -- saving rejects to file include/linux/sysctl.h.rej
patching file include/net/ip6_fib.h
Hunk #1 FAILED at 21.
Hunk #2 FAILED at 43.
Hunk #3 FAILED at 114.
3 out of 3 hunks FAILED -- saving rejects to file include/net/ip6_fib.h.rej
patching file include/net/ip_fib.h
Hunk #1 FAILED at 19.
Hunk #2 FAILED at 41.
Hunk #3 FAILED at 60.
Hunk #4 FAILED at 141.
(and the list goes on)

Is it usual ?
And I don't see where i should insert the kernel module as a feature
in this kernel while reading the readme (i'm not quite used to making
kernels), could you help me out ?

Thanks a lot

2017-02-14 22:13 GMT+01:00 Massimo Rimondini <rimondin at dia.uniroma3.it>:

> Hi Youri,
>
> what you are trying to achieve is not very easy, considering that some of
> the Netkit components are, unfortunately yet undoubtedly, a bit outdated,
> and this applies also to the kernel.
>
> It is a good choice to build your custom module by relying on an already
> installed kernel source tree but, as you see, you may encounter two
> mismatches:
> - on the kernel release
> - on the kernel target architecture (supposedly the host's)
>
> Instead, I suggest you to download the correct version of the kernel
> sources from https://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.
> 26.tar.xz, recompile it for the User Mode architecture (see the
> instructions at http://wiki.netkit.org/download/netkit-kernel/README),
> then add your custom module to this build.
>
> Regards,
> Massimo
>
>
> Il 14/02/2017 10:56, Youri Korostelev ha scritto:
>
>
> Hello,
>
> I am currently working on netkit for a project,on a ubuntu virtualbox with
> the  2.6.32-74 version.
> I've written a kernel module to hook packets with netfilter, and i'd like
> to load it on my netkit routers.
> However, i get the following error: (Version magic '2.6.32-74-generic SMP
> mod_unload modversions 586 ' should be '2.6.26.5-netkit-K2.8 mod_unload")
> whenever i try the insmod command, since the kernel versions are different.
> I am looking for a way to build my kernel module for the netkit kernel,
> from my host machine.
> Is it possible and how can i do so ? i've tried modifying the makefile in
> usr/src/ but it did not change the issue, maybe i haven't tried the right
> things.
>
> Thanks for you advice and help.
>
>
> The error:
>  [image: Images intégrées 1]
> --
> -------------------------------------------------------------
> Youri Korostelev
> Élève Ingénieur 3ème année
> ​​
> ​, spécialisé en logiciel embarqué
> Telecom Nancy - Université de Lorraine
> Responsable Bar & Staff - Club Intégration (2015)
> Responsable Communication - Club Cinéma (2015)
> Responsable Partenariats - Bureau des élèves
> Responsable Communication -Club Événements
>
> Tél : 06 14 07 95 08
>
>
> _______________________________________________
> Netkit.users mailing listNetkit.users at list.dia.uniroma3.ithttp://list.dia.uniroma3.it/mailman/listinfo/netkit.users
>
>
>
> _______________________________________________
> Netkit.users mailing list
> Netkit.users at list.dia.uniroma3.it
> http://list.dia.uniroma3.it/mailman/listinfo/netkit.users
>
>


-- 
-------------------------------------------------------------
Youri Korostelev
Élève Ingénieur 3ème année
​​
​, spécialisé en logiciel embarqué
Telecom Nancy - Université de Lorraine
Responsable Bar & Staff - Club Intégration (2015)
Responsable Communication - Club Cinéma (2015)
Responsable Partenariats - Bureau des élèves
Responsable Communication -Club Événements

Tél : 06 14 07 95 08


More information about the Netkit.users mailing list