You are not logged in.

#1 2020-12-26 08:24:16

fire100265
Member
Registered: 2020-10-05
Posts: 95

[Solved] How are my custom kernel images bigger than official ones?

Hi,
I am genuinely curious as to why this happens. I use a custom kernel alongside the official linux package. Somehow, my custom kernel's initramfs images are 2 times bigger than the official kernel ones despite the custom one being smaller in every way. Does anyone know why this is the case? For the record, I use the same mkinitcpio configuration for both kernels.

Last edited by fire100265 (2020-12-26 11:53:42)

Offline

#2 2020-12-26 09:05:05

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 76,024

Re: [Solved] How are my custom kernel images bigger than official ones?

despite the custom one being smaller in every way

Is it?
Did you compare the size of the kernel modules you add to the initramfs?

Online

#3 2020-12-26 09:06:26

fire100265
Member
Registered: 2020-10-05
Posts: 95

Re: [Solved] How are my custom kernel images bigger than official ones?

Yes I did. I checked /lib/modules and the official one is much bigger.

Offline

#4 2020-12-26 11:21:27

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 25,231

Re: [Solved] How are my custom kernel images bigger than official ones?

That doesn't really answer the question, neither your initramfs nor the official kernels initramfs should include all modules but just the ones necessary for booting.

Offline

#5 2020-12-26 11:27:14

fire100265
Member
Registered: 2020-10-05
Posts: 95

Re: [Solved] How are my custom kernel images bigger than official ones?

I know about that. The custom kernel's initramfs is very close to the size of its fallback image. About 3MB off. I don't know why this is the case.

Last edited by fire100265 (2020-12-26 11:27:22)

Offline

#6 2020-12-26 11:32:18

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 76,024

Re: [Solved] How are my custom kernel images bigger than official ones?

seth wrote:

Did you compare the size of the kernel modules you add to the initramfs?

Hint: debug symbols…

Last edited by seth (2020-12-26 11:32:38)

Online

#7 2020-12-26 11:37:59

fire100265
Member
Registered: 2020-10-05
Posts: 95

Re: [Solved] How are my custom kernel images bigger than official ones?

Now that you mention it, I found these lines in .config:

CONFIG_DEBUG_KERNEL=y
CONFIG_UNUSED_SYMBOLS=y

Is this the reason?

Offline

#8 2020-12-26 11:39:01

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 76,024

Re: [Solved] How are my custom kernel images bigger than official ones?

Maybe. Maybe not.

seth wrote:

Did you compare the size of the kernel modules you add to the initramfs?

Online

#9 2020-12-26 11:42:12

fire100265
Member
Registered: 2020-10-05
Posts: 95

Re: [Solved] How are my custom kernel images bigger than official ones?

I think I got the answer. The problem was those 2 lines in my previous reply and the module sizes. The modules are bigger in my custom kernel than in the Arch one. Am I right?

Offline

#10 2020-12-26 11:50:14

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 76,024

Re: [Solved] How are my custom kernel images bigger than official ones?

If the modules are bigger that that's the most likely cause of your bigger initramfs and the most likely cause for that is that you've debugging enabled.

You should™ have gotten a prompt for this during the configuration, though…

https://cateee.net/lkddb/web-lkddb/DEBUG_KERNEL.html
https://cateee.net/lkddb/web-lkddb/UNUSED_SYMBOLS.html

Now you need to decide which options you want/need.

Online

#11 2020-12-26 11:53:25

fire100265
Member
Registered: 2020-10-05
Posts: 95

Re: [Solved] How are my custom kernel images bigger than official ones?

Thank you. I didn't get a prompt for disabling symbols and debugging when making .config. I'll mark the thread as Solved now.

Offline

Board footer

Powered by FluxBB