Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
make menuconfig vs genkernel --menuconfig all
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
st834
Tux's lil' helper
Tux's lil' helper


Joined: 23 Jun 2022
Posts: 98

PostPosted: Tue Dec 13, 2022 9:20 am    Post subject: make menuconfig vs genkernel --menuconfig all Reply with quote

Hello,

1.I am trying to build a kernel manually, without genkernel, following the instructions standard instructions

Code:
make menuconfig
make
make modules_install
make install


I take the standard .config file from the kernel source directory. I don't remove anything from it and I always get a non-working kernel which stops loading immediately after

Code:
Loading Linux linux ...
Loading initial ramdisk ...


Initrams I do with dracut as shown on the gentoo website

2.When I build my kernel with genkernel --menuconfig all, also without adding anything to the configuration, which is in .config, the kernel works.

I noticed that the kernel configuration file that is copied to /boot when using genkernel --menuconfig all turns out to be 2 times larger (~200K) than the first case (~100K)

I was grateful for the advice on how to build a working kernel without genkernel. What operation does genkernel do that I am missing?

Thanks
Back to top
View user's profile Send private message
Banana
Moderator
Moderator


Joined: 21 May 2004
Posts: 1891
Location: Germany

PostPosted: Tue Dec 13, 2022 9:30 am    Post subject: Reply with quote

Well, just building a kernel without any modification will quike likely result in a non working one.

I followed the main install handbook from the wiki: https://wiki.gentoo.org/wiki/Handbook:AMD64 and it always worked.

BUT, you need to to some research. It is not everyhing in the handbook, since there are a lot of possibilities and hardware. So you need some basic information about your setup and then look for the dedicated driver and kernel support.
_________________
Forum Guidelines

PFL - Portage file list - find which package a file or command belongs to.
My delta-labs.org snippets do expire
Back to top
View user's profile Send private message
Goverp
Advocate
Advocate


Joined: 07 Mar 2007
Posts: 2202

PostPosted: Tue Dec 13, 2022 10:19 am    Post subject: Re: make menuconfig vs genkernel --menuconfig all Reply with quote

st834 wrote:
...
I noticed that the kernel configuration file that is copied to /boot when using genkernel --menuconfig all turns out to be 2 times larger (~200K) than the first case (~100K)

I was grateful for the advice on how to build a working kernel without genkernel. What operation does genkernel do that I am missing?

Thanks

genkernel --menuconfig appears to start from a different point than the shipped kernel configuration in /usr/src/linux (I don't use genkernel, so I can't say what it's initial config is).
So copy the genkernel config file from /boot to .config in /usr/src/linux, and then do "make oldconfig" just for safety in case genkernel does something odd with its configs.
_________________
Greybeard
Back to top
View user's profile Send private message
st834
Tux's lil' helper
Tux's lil' helper


Joined: 23 Jun 2022
Posts: 98

PostPosted: Tue Dec 13, 2022 10:19 am    Post subject: Reply with quote

Thank you very much for your response !

I follow this guide too and in addition to the parameters I set in .config I set the recommended parameters for systemd (https://wiki.gentoo.org/wiki/Systemd). This makes the kernel behave as shown above.

I think it's not about any kernel parameter but about the difference between manual and genkernel kernel build definitions. Maybe genkernel does not use .config from the kernel source tree but uses the .config of an already loaded working kernel?
Back to top
View user's profile Send private message
carcajou
Apprentice
Apprentice


Joined: 10 Jun 2008
Posts: 248

PostPosted: Tue Dec 13, 2022 10:31 am    Post subject: Reply with quote

Can you post here how do you build initramfs with dracut? Maybe you are missing something in kernel configuration that genkernel puts inside initramfs, but dracut does not do.
Back to top
View user's profile Send private message
st834
Tux's lil' helper
Tux's lil' helper


Joined: 23 Jun 2022
Posts: 98

PostPosted: Tue Dec 13, 2022 10:41 am    Post subject: Re: make menuconfig vs genkernel --menuconfig all Reply with quote

Goverp wrote:

genkernel --menuconfig appears to start from a different point than the shipped kernel configuration in /usr/src/linux (I don't use genkernel, so I can't say what it's initial config is).
So copy the genkernel config file from /boot to .config in /usr/src/linux, and then do "make oldconfig" just for safety in case genkernel does something odd with its configs.



Thank you very much for your answer.

Yes, I read about that too.

Question: does this mean that the configuration supplied with the source tree is fundamentally unworkable (because, the failure of the kernel at the stage

Code:
Loading Linux linux ...
Loading initial ramdisk ...


I think is not related to a wrong hardware configuration) ?
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


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

PostPosted: Tue Dec 13, 2022 10:51 am    Post subject: Reply with quote

st834,

genkernel provides its own fully modular .config file. It does not use the default provided with the kernel.
Neither are good places to start if you want to build your own kernel.

The kernel provided default is probably not useful on your hardware. The genkernel default is fully modular, so it must have a matching initrd to provide the kernel modules required to mount boot.

Your
Code:
Loading Linux linux ...
Loading initial ramdisk ...
messages tell that the boot loader worked.
As there were no further messages, it suggests that your kernel is missing a console output driver.

Read the PC Boot Process so you understand a little about how things get started.
It also covers at a very high level, why kernel options need to be set in certain ways to avoid the use of an initrd.

This 2006 post has the correct method but the detail has changed a lot since then.
There are a lot more options to review now. You will end up starting with a non working .config and eventually, going through it all.
The good news is that when it breaks - it will - you fix it, not start over.
_________________
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
APolozov
Apprentice
Apprentice


Joined: 28 Sep 2006
Posts: 194
Location: Voronezh, Russia

PostPosted: Tue Dec 13, 2022 11:23 am    Post subject: Reply with quote

IMHO best way to creating custom kernel config for newbie gento user is:
1. make mrproper && make alldefconfig
2. make localyesconfig OR make localmodconfig
Rebuild kernel: make && make modules_install install && grub-mkconfig -o /boot/grub/grub.cfg && emerge -1 @module-rebuild
and try reboot to it. If it working, tune kernel config to your own necessary options with make menuconfig
_________________
Excuse my bad English, I only study it.
Back to top
View user's profile Send private message
pietinger
Moderator
Moderator


Joined: 17 Oct 2006
Posts: 5377
Location: Bavaria

PostPosted: Tue Dec 13, 2022 11:41 am    Post subject: Re: make menuconfig vs genkernel --menuconfig all Reply with quote

st834 wrote:
Question: does this mean that the configuration supplied with the source tree is fundamentally unworkable [...] ?

In most cases, yes. Because it misses some modules you will need if using modern hardware (e.g. ahci). If you want to configure your kernel from scratch (and you want learn what in your kernel does which job) I recommend my article: https://wiki.gentoo.org/wiki/User:Pietinger/Tutorials/Manual_kernel_configuration
Back to top
View user's profile Send private message
st834
Tux's lil' helper
Tux's lil' helper


Joined: 23 Jun 2022
Posts: 98

PostPosted: Tue Dec 13, 2022 12:57 pm    Post subject: Reply with quote

Thank you for your answer !

I have done all this many times, but unfortunately I have not come to a working .config , which is the main reason why I wrote here.

I'll try to build the kernel again today.

Tell me what the console output drivers look like, if they are framebuffer drivers I already included them in the kernel but with the same result

Thanks !
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


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

PostPosted: Tue Dec 13, 2022 1:40 pm    Post subject: Reply with quote

st834,

Yes, they are the framebuffer drivers but only VESA, EFI and Simple. No others.

There is a wart here too. You will also be including the DRM driver that your video card needs.
Make that a module, not built in. If its built in and broken, because some or all of the firmware is missing, the kernel may switch to it before the framebuffer drivers can output anything.

With it modular and broken, the console will output something then stop when the kernel switches to the broken driver.
_________________
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
pietinger
Moderator
Moderator


Joined: 17 Oct 2006
Posts: 5377
Location: Bavaria

PostPosted: Tue Dec 13, 2022 1:54 pm    Post subject: Reply with quote

st834 wrote:
I'll try to build the kernel again today.

If you have no success, then give us your last .config (best with wgetpaste) and your output of "lspci -k" after booting with our minimal-install-CD. Hopefully we can identify then what is missing ;-)
Back to top
View user's profile Send private message
st834
Tux's lil' helper
Tux's lil' helper


Joined: 23 Jun 2022
Posts: 98

PostPosted: Tue Dec 13, 2022 2:15 pm    Post subject: Reply with quote

I thank you for your answers !

I need a little time to try out all the solutions I received here today.

I will let you know the results.

Thank you very much !
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


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

PostPosted: Tue Dec 13, 2022 2:16 pm    Post subject: Reply with quote

st834,

Its not as simple as 'building the kernel'

Take step back and decide if you need an initrd or not. If you decide its not required, that places constraints on how you configure the kernel.
Read my link about the PC Boot Process above.
It also provides broad outlines of the sorts of drivers you need and why.
_________________
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
st834
Tux's lil' helper
Tux's lil' helper


Joined: 23 Jun 2022
Posts: 98

PostPosted: Tue Dec 13, 2022 2:43 pm    Post subject: Reply with quote

Of course i read the link you sent me.

I don't know if initramfs is needed for me or not. i don't use separate /usr and /var, but use the btrfs file system.

I would of course try without initramfs first

Thanks !
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


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

PostPosted: Tue Dec 13, 2022 3:12 pm    Post subject: Reply with quote

st834,

I'm not sure if root on a BTRFS subvolume needs an intitrd to mount as root or not.
The internet says you need some extra kernel parameters but if you are already doing that, that's not news.
_________________
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
st834
Tux's lil' helper
Tux's lil' helper


Joined: 23 Jun 2022
Posts: 98

PostPosted: Fri Dec 23, 2022 10:05 pm    Post subject: Reply with quote

Hi !

I have read all the articles and specifically the framebuffer article https://wiki.gentoo.org/wiki/Framebuffer .

Now in contrast I get almost the same thing, but only, the screen clears and becomes completely blank, the lines about loading the kernel and initramfs disappear.

By the chaos of the function key illumination, I can understand that the kernel is loaded in some way, but no messages are visible as before.

But I think the cause lies in the area of framebuffer settings and I would be grateful for tips on how to diagnose it more accurately.

Thanks.
Back to top
View user's profile Send private message
pietinger
Moderator
Moderator


Joined: 17 Oct 2006
Posts: 5377
Location: Bavaria

PostPosted: Mon Dec 26, 2022 3:18 pm    Post subject: Reply with quote

st834,

do you need help anymore ? If yes, please read my last post in this thread and give us more informations. If not, you can edit the title of your first post and add a [Solved] ;-)
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