WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Help to complie kernel  (Read 3638 times)

Offline zbs888

  • Newbie
  • *
  • Posts: 42
Help to complie kernel
« on: December 30, 2021, 12:59:09 AM »
Dear sir,the orig vmlinuz64 is 4.9M,5.4.3-tinycore64 is 9.2M
After complie kernel:
tar linux-5.4.3-patched.txz,,cp config-5.4.3-tinycore64 .config,,make oldconfig,,make menuconfig,,add ip_vs ,kernel crash ,ipv6,,make bzImage

finaly ,i got this:
vmlinuz64 is 5.1M,5.4.3-tinycore64 is 3.0G
Did I do anything wrong?The size 5.4.3-tinycore64 is tooooooooo big
« Last Edit: December 30, 2021, 01:08:26 AM by zbs888 »

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 11044
Re: Help to complie kernel
« Reply #1 on: December 30, 2021, 03:28:16 AM »
It's not clear what size you mean.
The only barriers that can stop you are the ones you create yourself.

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14817
Re: Help to complie kernel
« Reply #2 on: December 30, 2021, 03:47:57 AM »
Did you compile ip_vs into the kernel “=y” or as a module “=m”?

Offline zbs888

  • Newbie
  • *
  • Posts: 42
Re: Help to complie kernel
« Reply #3 on: December 30, 2021, 07:29:07 PM »
It's not clear what size you mean.
sorry,sir
i mean the lib/modules 's size is tooooo big
i just add kernel crash,ipvs,netfilt
my operation wrong on something

Offline zbs888

  • Newbie
  • *
  • Posts: 42
Re: Help to complie kernel
« Reply #4 on: December 30, 2021, 07:31:04 PM »
Did you compile ip_vs into the kernel “=y” or as a module “=m”?
ip_vs as module
kernel crash as kernel
netfilter as module
Although i didn't find how to use kernel crash command kdump

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 11044
Re: Help to complie kernel
« Reply #5 on: December 31, 2021, 03:01:46 AM »
lib/modules usually gets post-processed. Remove the generated files modules.*, gzip modules, and sort to extensions. Since you're changing enough to make modules potentially incompatible, you may as well keep everything instead of making extensions.
The only barriers that can stop you are the ones you create yourself.

Offline zbs888

  • Newbie
  • *
  • Posts: 42
Re: Help to complie kernel
« Reply #6 on: December 31, 2021, 04:00:44 AM »
lib/modules usually gets post-processed. Remove the generated files modules.*, gzip modules, and sort to extensions. Since you're changing enough to make modules potentially incompatible, you may as well keep everything instead of making extensions.
Dear sir,i had a new question.
Before i compile the tiny kernel ,i can use 'linux /boot/vzlinuz64' 'initrd /boot/init' to boot,after i compile the new kernel ,it show 'Kernel panic-not syncing: VFS: unable to mount root fs on unknown-block',must add root=/dev/sda1 after linux /boot/vzlinuz64 to boot.
What should i do next.
« Last Edit: December 31, 2021, 04:02:39 AM by zbs888 »

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14817
Re: Help to complie kernel
« Reply #7 on: December 31, 2021, 09:22:37 AM »
If you're lucky, you can use the existing init.rd and vmlinuz and make an extension out of the ip_vs module you compiled.

Offline polikuo

  • Hero Member
  • *****
  • Posts: 724
Re: Help to complie kernel
« Reply #8 on: December 31, 2021, 10:01:50 AM »
There's a sorter.sh script to make life easier.

https://github.com/tinycorelinux/sorter

Offline zbs888

  • Newbie
  • *
  • Posts: 42
Re: Help to complie kernel
« Reply #9 on: January 03, 2022, 07:21:16 PM »
If you're lucky, you can use the existing init.rd and vmlinuz and make an extension out of the ip_vs module you compiled.
Dear sir,
Before i compile the tiny kernel ,i can use 'linux /boot/vzlinuz64' 'initrd /boot/init' to boot,after i compile the new kernel ,it show 'Kernel panic-not syncing: VFS: unable to mount root fs on unknown-block',must add root=/dev/sda1 after linux /boot/vzlinuz64 to boot.
Can you give me some advice?

Offline zbs888

  • Newbie
  • *
  • Posts: 42
Re: Help to complie kernel
« Reply #10 on: January 03, 2022, 07:22:22 PM »
There's a sorter.sh script to make life easier.

https://github.com/tinycorelinux/sorter
Thanks,i'll trying to separate some modules.

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 11044
Re: Help to complie kernel
« Reply #11 on: January 04, 2022, 04:07:08 AM »
The root-fs error is because you're missing a proper initrd.
The only barriers that can stop you are the ones you create yourself.

Offline zbs888

  • Newbie
  • *
  • Posts: 42
Re: Help to complie kernel
« Reply #12 on: January 04, 2022, 07:24:07 PM »
The root-fs error is because you're missing a proper initrd.
Thanks for your reply,but i still don't know.
The orig kernel and initrd work fine,no root=/dev/sda1 string.
I just using .config to compile a new kernel ,just add crash and ip_vs module, replace the orig kernel to reboot,can't find the root-fs..
The orig kernel(5.4.3) had some special setting for root-fs or initrd?

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 11044
Re: Help to complie kernel
« Reply #13 on: January 05, 2022, 05:47:38 AM »
The new initrd must contain the new modules.
The only barriers that can stop you are the ones you create yourself.