You are not logged in.

#1 2021-03-10 20:24:15

kerman
Member
Registered: 2021-03-10
Posts: 4

Compiling a new kernel

Hello. I'm trying to compile my own kernel for the first time since 2006, and run into some problems + questions.

First of all - the wiki article mentions nothing about 'linux-headers' - do I need to install new headers for 5.11.5 when I already have headers for 5.11.2,
and is it even safe to install these new headers from AUR or will them overwrite the existing and cause problems?
What's the actual role of kernel headers?

Secondly, mkinitcpio gives me multiple 'ERROR: module not found's for stuff I have #commented out in .config.
Why does it ask for these modules, when they are not listed in MODULES=(..)?
My MODULES array has only 'i915', 'asus-nb-wmi' and 'ext4', and it's whining about multiple missing dm_* modules: dm_integrity, dm_mirror, dm_cache,
dm_cache_smq, dm_thin_pool, and usbhid.
The respective entries in the .config are #commented as I said.

I did 'make localmodconfig' with some changes thru menuconfig.

Thirdly, I want to ask about multiple (probably 1000+) 'byref variable will be forcibly initialized' notes during compilation - is this to be expected?

Thanks!

Offline

#2 2021-03-10 20:37:23

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,597
Website

Re: Compiling a new kernel

I recommend that you use the PKGBUILD from the kernel package as a starting place.  https://github.com/archlinux/svntogit-p … inux/trunk


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#3 2021-03-10 20:40:26

loqs
Member
Registered: 2014-03-06
Posts: 17,308

Re: Compiling a new kernel

kerman wrote:

First of all - the wiki article mentions nothing about 'linux-headers' - do I need to install new headers for 5.11.5 when I already have headers for 5.11.2,

You need matching headers installed for each kernel you want to build out of tree modules for.

kerman wrote:

and is it even safe to install these new headers from AUR or will them overwrite the existing and cause problems?

Is the custom package you built named linux the same as the package from core?  Otherwise the package should not conflict / replace.

kerman wrote:

Secondly, mkinitcpio gives me multiple 'ERROR: module not found's for stuff I have #commented out in .config.
Why does it ask for these modules, when they are not listed in MODULES=(..)?
My MODULES array has only 'i915', 'asus-nb-wmi' and 'ext4', and it's whining about multiple missing dm_* modules: dm_integrity, dm_mirror, dm_cache,
dm_cache_smq, dm_thin_pool, and usbhid.

You are using the lvm2 hook?

kerman wrote:

Thirdly, I want to ask about multiple (probably 1000+) 'byref variable will be forcibly initialized' notes during compilation - is this to be expected?

Please post at least a sample of such messages.

Online

#4 2021-03-10 20:59:36

kerman
Member
Registered: 2021-03-10
Posts: 4

Re: Compiling a new kernel

Focrible initializations example: https://0x0.st/-Zmk.txt I get tons of these.

Yes, I am using lvm2 hook.

The custom package is named linux-5.15.5 and stock kernel is 5.15.2.

Offline

#5 2021-03-10 21:07:50

loqs
Member
Registered: 2014-03-06
Posts: 17,308

Re: Compiling a new kernel

Not seen those warnings on my kernel builds.
I would advise against using the same package name as the package in core as it prevents having both installed.

Online

#6 2021-03-10 21:19:30

kerman
Member
Registered: 2021-03-10
Posts: 4

Re: Compiling a new kernel

loqs wrote:

Not seen those warnings on my kernel builds.
I would advise against using the same package name as the package in core as it prevents having both installed.

Yeah, thanks for the advise. I'll rename it to something else before Syuing new kernel.

Any idea about those compiler note messages? I couldn't find anything useful googling this, but they definitely seem a little 'off'.
It may even give that note to every single variable/struct in the kernel code, or so it seemed like.

Offline

#7 2021-03-10 21:25:54

loqs
Member
Registered: 2014-03-06
Posts: 17,308

Re: Compiling a new kernel

I would hazard a guess it is related to CONFIG_GCC_PLUGIN_STRUCTLEAK_BYREF or CONFIG_GCC_PLUGIN_STRUCTLEAK_BYREF_ALL.

Online

#8 2021-03-10 21:44:02

kerman
Member
Registered: 2021-03-10
Posts: 4

Re: Compiling a new kernel

Oh, yes! I have CONFIG_GCC_PLUGIN_STRUCTLEAK_BYREF_ALL=y.
I tried to find some information about "ASAN" (CONFIG_KASAN), is it some form of protection from memory leaks?
I read that *byref_all=y and kasan=y causes hazardous stack sizes of kernel functions when together.
https://patchwork.kernel.org/project/li … d@arndb.de

Wiki article about kernel building also does not mention using 'strip' which is used in PKGBUILD.
Man says it 'discards symbols' - is it to make the image smaller, no functional significance (other than maybe for debugging)?
What kind of symbols does this mean?

Last edited by kerman (2021-03-10 21:47:08)

Offline

#9 2021-03-10 22:33:24

loqs
Member
Registered: 2014-03-06
Posts: 17,308

Re: Compiling a new kernel

kerman wrote:

Man says it 'discards symbols' - is it to make the image smaller, no functional significance (other than maybe for debugging)?

Exactly.

kerman wrote:

What kind of symbols does this mean?

As an example of an library that has not been stripped see:

objdump -W /usr/lib/libc.so.6

Online

Board footer

Powered by FluxBB