Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Gentoo include external kernel module in module-less kernel
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
alestark
n00b
n00b


Joined: 23 Aug 2016
Posts: 2

PostPosted: Tue Aug 23, 2016 10:53 am    Post subject: Gentoo include external kernel module in module-less kernel Reply with quote

I've built a custom completely non modular kernel (version 4.1.5) on my gentoo.
After this, I recognized that for make my wifi adapter working, I need to build the rtl8188eu module.
I was wondering if there is the possibility to "include" it in the kernel not building it as external module (that I've to load with insmod).
Is there any possibility to do and how can I do it?

Special thanks in advice
Back to top
View user's profile Send private message
Roman_Gruber
Advocate
Advocate


Joined: 03 Oct 2006
Posts: 3806
Location: Austro Bavaria

PostPosted: Tue Aug 23, 2016 11:13 am    Post subject: Reply with quote

there was a kernel option to include binaries, modules or initramfs. you may check that out, its in the upper half of the kernel makemenuconfig options when you browse that.

its a generic advise you may check it out yourself and read the description / check the net when you find something which may work.

i think you may get it to work wiht an initramfs and when you implement that in the kernel.

I have build in the microcode stuff in my kernel (maybe thats a module too)... too lazy to look it up and can t be done in a reasonable time now.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 43178
Location: 56N 3W

PostPosted: Tue Aug 23, 2016 12:03 pm    Post subject: Reply with quote

alestark,

Welcome to Gentoo.

The strict answer to your question in no. External kernel modules cannot be built into the kernel. Often there would be licencing issues.
With a monolithic kernel, even with the module in an initrd, you would still need module loading support in the kernel and I guess that's what you want to avoid.

Migrate to a testing kernel. That will be 4.7.x
Under Staging Drivers, you will find
Code:
< >   Realtek RTL8188EU Wireless LAN NIC driver

Staging Drivers are things in the process of being added and are ready for limited exposure to users. They may or may not work properly
You can build that into the kernel, along wint any firmware it needs.

Make it work as a module first, so you know it works, then rebuild the kernel with it built in once you have completed your testing.
It might even be in your 4.1.5 but that's about 6 months old now. A lot can happen in 6 months.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
Logicien
Veteran
Veteran


Joined: 16 Sep 2005
Posts: 1368
Location: Montréal

PostPosted: Tue Aug 23, 2016 12:13 pm    Post subject: Reply with quote

Hello,

when you compile a support in hard (=y) in the kernel image and it do not work as expected, there are several possible reasons:

- you have not pass the needed Linux parameters for this support via the kernel option for it or via the boot loader.

- the firmware files needed by that support are not available in the kernel image or in an initramfs.

- other possibilities

If you are force to build a support as a module (=m), unless it is need or you want it for the early boot process, you can wait the moment when the real root filesystem is mounted for this support to show up and not include it in an initramfs.

In any case, the needed parameters must be pass to the kernel and the firmware files be available when the support raise up, otherwise, it can fail to do what it must, even if later everything it need will be available.

So, if you must compile rtl8188e as a module, it is because it need a firmware who is not available in the kernel image or in an initramfs at the moment it probe your wireless card. It work as a module because this firmware file is available in the root filesystem at the moment the module probe the hardware, after the real root partition is mounted.
_________________
Paul
Back to top
View user's profile Send private message
alestark
n00b
n00b


Joined: 23 Aug 2016
Posts: 2

PostPosted: Tue Aug 23, 2016 12:33 pm    Post subject: Reply with quote

NeddySeagoon wrote:
alestark,

Welcome to Gentoo.

The strict answer to your question in no. External kernel modules cannot be built into the kernel. Often there would be licencing issues.
With a monolithic kernel, even with the module in an initrd, you would still need module loading support in the kernel and I guess that's what you want to avoid.

Migrate to a testing kernel. That will be 4.7.x
Under Staging Drivers, you will find
Code:
< >   Realtek RTL8188EU Wireless LAN NIC driver

Staging Drivers are things in the process of being added and are ready for limited exposure to users. They may or may not work properly
You can build that into the kernel, along wint any firmware it needs.

Make it work as a module first, so you know it works, then rebuild the kernel with it built in once you have completed your testing.
It might even be in your 4.1.5 but that's about 6 months old now. A lot can happen in 6 months.


Hi and thanks for your help, I'll try with this approach.
One more thing: I've launched
Code:
emerge --ask sys-kernel/gentoo-sources

for having the sources of the 4.1.5, how can I download the sources of the new testing 4.7.x kernel?
Is there a method through emerge, or I have to download the vanilla's one, apply all the patches required and recompile?

Thanks, however, to anyone that answered.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 43178
Location: 56N 3W

PostPosted: Tue Aug 23, 2016 1:20 pm    Post subject: Reply with quote

alestark,

Gentoo supports at least two branches. Known as stable and testing.
Unless you deliberately choose testing packages you will have stable.

Portage provides a way to mix and match at the package level. See the Gentoo Handbook.
You need to be aware of that entire section but the important details start at the heading Mixing stable with testing

Once you get that set up
Code:
emerge --ask sys-kernel/gentoo-sources
will offer to install a newer kernel.
Exactly which one depends on the content of your copy of the portage tree. You may want to update it with
Code:
emerge --sync
before you emerge your new kernel.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum