Difference between revisions of "Talk:Compile kernel module"

From ArchWiki
Jump to navigation Jump to search
(Discussion: PKGFILE of core/linux from abs)
(What is the scenario?: re)
Line 25: Line 25:
  
 
::Take a look at the current PKGFILE of core/linux in abs: It just downloads the vanilla sources and applies a single patch ('''change-default-console-loglevel.patch'''). Please correct me if I'm wrong, but it seems to me that a current ARCH kernel is just a plain vanilla kernel with one minor patch applied, which is quite likely not relevant to a module you want to compile here. To sum up, at the moment, compiling a module like outlined in this article will just yield the exact same module as using abs to pull core/linux and then compile the module inside the "patched" arch-linux sources. It would be cool to have a special target in abs, like core/linux-module, which holds a PKGFILE to compile and install only specific modules. -- [[User:Epinephrine|Epinephrine]]
 
::Take a look at the current PKGFILE of core/linux in abs: It just downloads the vanilla sources and applies a single patch ('''change-default-console-loglevel.patch'''). Please correct me if I'm wrong, but it seems to me that a current ARCH kernel is just a plain vanilla kernel with one minor patch applied, which is quite likely not relevant to a module you want to compile here. To sum up, at the moment, compiling a module like outlined in this article will just yield the exact same module as using abs to pull core/linux and then compile the module inside the "patched" arch-linux sources. It would be cool to have a special target in abs, like core/linux-module, which holds a PKGFILE to compile and install only specific modules. -- [[User:Epinephrine|Epinephrine]]
 +
 +
:::I agree with you.  Thanks.
 +
:::Does anyone want to talk about this? If no, I will close this discussion in three days.--[[User:NonerKao|NonerKao]] ([[User talk:NonerKao|talk]]) 12:13, 23 November 2015 (UTC)

Revision as of 12:13, 23 November 2015

What is the scenario?

There are only three cases:

  • re-compile a in-kernel module, in an arch-specific kernel
  • re-compile a in-kernel module, in a customized kernel
  • compile a externel module (no matter what kind of kernel is in use)

While this article, as a tutorial here in ArchWiki with the title "Compile kernel module", should cover the first case, it gives second case only since it acquires the kernel source from kernel.org. However, we may want to stay with the kernel of Archlinux's official one. How do you think about this?

Just for completeness, the third case is easily done by following The Linux Kernel Module Programming Guide. --NonerKao (talk) 10:47, 9 November 2015 (UTC)

I think it doesn't matter from where you get kernel source, process for compiling kernel module is basically same and there are different kernels in AUR so that's still revelant if we cover not only one official Arch kernel. It could be divided in sections so for example if you've stock Arch kernel and other section from AUR or elsewhere. --Davispuh (talk) 16:15, 9 November 2015 (UTC)
If it doesn't matter from where the module's source code comes from (and I agree with that), there is no point in creating different sections based on the origin. -- Lahwaacz (talk) 19:08, 9 November 2015 (UTC)
On the contrary, this page deals only with the 3rd point. For the first two, you'd need to re-compile the entire kernel and we have Kernels/Compilation/Traditional for that. As for the Kernel Module Programming Guide, it is obviously guide for programmers, while this page is targeted at common Arch users. -- Lahwaacz (talk) 19:04, 9 November 2015 (UTC)
actually no, it's for all 3 cases, you've to recompile whole kernel only if module is builtin in which case it's not really a loadable module, and I think first 2 points are meant for kernel modules which are compiled as modules for your current kernel so you can recompile only them and 3rd point is for external modules which aren't included in Linux source code tree like proprietary drivers. --Davispuh (talk) 19:31, 9 November 2015 (UTC)
Well, loadable modules are not really "in-kernel", are they. Also, you can't just compile proprietary drivers. -- Lahwaacz (talk) 19:44, 9 November 2015 (UTC)
I am sorry if I have bothered you in this thread, but I would like to point out that this article is not specific to arch users. For general kernels, this works just fine. However, consider the following usecase:
Currently, the linux package is updated to version 4.2.5-1-ARCH. A user needs to compile a kernel module with the previous 4.2.2-1-ARCH one on his/her system. So I expect this article provide him/her the information "how should I get the officially patched 4.2.2-1-ARCH kernel source tree, without the effort to update linux and download the latest source tree from ABS". This is not clearly mentioned in Kernel either. Is there any simple way to do this such that you don't think it is worth mentioning here? --NonerKao (talk) 04:18, 10 November 2015 (UTC)
Take a look at the current PKGFILE of core/linux in abs: It just downloads the vanilla sources and applies a single patch (change-default-console-loglevel.patch). Please correct me if I'm wrong, but it seems to me that a current ARCH kernel is just a plain vanilla kernel with one minor patch applied, which is quite likely not relevant to a module you want to compile here. To sum up, at the moment, compiling a module like outlined in this article will just yield the exact same module as using abs to pull core/linux and then compile the module inside the "patched" arch-linux sources. It would be cool to have a special target in abs, like core/linux-module, which holds a PKGFILE to compile and install only specific modules. -- Epinephrine
I agree with you. Thanks.
Does anyone want to talk about this? If no, I will close this discussion in three days.--NonerKao (talk) 12:13, 23 November 2015 (UTC)