Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
First time kernel config - any advice?
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
braz2kuk
n00b
n00b


Joined: 26 Apr 2007
Posts: 60

PostPosted: Thu Mar 14, 2019 4:52 pm    Post subject: First time kernel config - any advice? Reply with quote

Hi all,

I have a fully functional working i3 system with Nvidia using OpenRC so far so good I’m
Happy.

The only thing I haven’t done manually is configure my kernel I used genkernel, I’m now thinking I’d like to build my own after what I feel is a slow boot time and lots of modules being loaded.

However looking though a config there seems to be hundreds of options, and I’m not sure what I need and don’t need, I’ve run lspci and had a look but can’t fathom what I should be focusing on or pulling out, I don’t have any unusual hardware more recent hardware.

Is there anything I can read / look at to help better understand or any pointers? I essentially don’t want to break my system after I’ve spent so long getting it right, I’m really liking it so far it’s been a challenge but I’m happy.

Thanks
Back to top
View user's profile Send private message
Jaglover
Watchman
Watchman


Joined: 29 May 2005
Posts: 7251
Location: Saint Amant, Acadiana

PostPosted: Thu Mar 14, 2019 8:51 pm    Post subject: Reply with quote

Kernel is the OS. You can't expect custom configuration to be simple, there is no magic wand you can wave which will read your mind and set up your kernel. You either learn it (lots of learning) or you leave it. Handling hardware is only one part of kernel tasks, there is much more functionality you may want and even more functions and features you may not want. If you feel ready start with 'make allnoconfig', then start enabling features you need. This is not one hour task. May take days, every brain needs rest. In case you pull through the results are rewarding, knowledge wise. If you give up then boot your genkernel and admit the grapes are sour.
_________________
Please learn how to denote units correctly!
Back to top
View user's profile Send private message
Blind_Sniper
Tux's lil' helper
Tux's lil' helper


Joined: 20 Apr 2018
Posts: 110

PostPosted: Fri Mar 15, 2019 8:00 am    Post subject: Reply with quote

Start with
Code:
make defconfig

it gives you default config which suitable in most cases.
Build kernel with that config and try to boot. If you cannot boot - add missed options (usually sata drivers) to config and try again.
Once you booted - continue with tinkering your config by removing modules which your hardware doesn't use.
It's an easiest way to build minimal kernel


Another one option is
Code:
make localmodconfig

it creates config depending on currently loaded modules.
Connect hardware you're planning to use e.g. USB sticks (USB2 and USB3) and run command.
Back to top
View user's profile Send private message
Verdazil
n00b
n00b


Joined: 14 Feb 2019
Posts: 47
Location: One small country ...

PostPosted: Fri Mar 15, 2019 8:29 am    Post subject: Reply with quote

I suggest a different approach (I always use it myself), unlike previous users. Follow the step-by-step instructions from this guide and you will get a kernel with basic settings that will allow you to boot: https://wiki.gentoo.org/wiki/Kernel/Gentoo_Kernel_Configuration_Guide
Then you can add hardware&&software-specific options into your kernel.
_________________
GA-Z170X-UD3 / i7-6700K / DDR4 32GB / Radeon RX 570 / TL-WDN4800 / Samsung SSD 850 EVO 250 Gb + WD Green WDC 2 Tb / BenQ BL2711U + LG TV 42LF650V
Back to top
View user's profile Send private message
Makersmarx
n00b
n00b


Joined: 16 Feb 2019
Posts: 14
Location: Costa Rica

PostPosted: Fri Mar 15, 2019 12:32 pm    Post subject: Reply with quote

I am also a new user and what I have been doing to ensure I have a working system is running genkernel --menuconfig all this allows me to remove the obvious stuff ex. Intel graphic support etc, without screwing up so bad I cant boot immediately. I have only been using gentoo for about 2 months, but figure running this a bit more and keeping notes I will progress and do this from scratch.
_________________
Pura Vida
Back to top
View user's profile Send private message
braz2kuk
n00b
n00b


Joined: 26 Apr 2007
Posts: 60

PostPosted: Fri Mar 15, 2019 2:36 pm    Post subject: Reply with quote

Guys,

Thanks for all the help, I’ve now configured and booted my own kernel and all is good.

One thing though on first boot I got a kernel panic, due to not having built an initramfs, I then had to emerge genkernel and use this to generate one.

Is it possible to build your own initramfs?

Thanks in advance
Back to top
View user's profile Send private message
Verdazil
n00b
n00b


Joined: 14 Feb 2019
Posts: 47
Location: One small country ...

PostPosted: Fri Mar 15, 2019 2:50 pm    Post subject: Reply with quote

braz2kuk wrote:
Is it possible to build your own initramfs?
This is usually not necessary. Initramfs is built into the kernel by default.
_________________
GA-Z170X-UD3 / i7-6700K / DDR4 32GB / Radeon RX 570 / TL-WDN4800 / Samsung SSD 850 EVO 250 Gb + WD Green WDC 2 Tb / BenQ BL2711U + LG TV 42LF650V
Back to top
View user's profile Send private message
kite14
Apprentice
Apprentice


Joined: 07 Nov 2006
Posts: 199
Location: Pordenone/Italy

PostPosted: Fri Mar 15, 2019 2:56 pm    Post subject: Reply with quote

braz2kuk wrote:
Guys,

Thanks for all the help, I’ve now configured and booted my own kernel and all is good.

One thing though on first boot I got a kernel panic, due to not having built an initramfs, I then had to emerge genkernel and use this to generate one.

Is it possible to build your own initramfs?

Thanks in advance


I don't use it myself, but I can point you to the wiki's guide about making your own custom initramfs → https://wiki.gentoo.org/wiki/Custom_Initramfs
This guide describes how to build an initramfs whitout using any tools like genkernel or Dracut
Back to top
View user's profile Send private message
Blind_Sniper
Tux's lil' helper
Tux's lil' helper


Joined: 20 Apr 2018
Posts: 110

PostPosted: Fri Mar 15, 2019 3:00 pm    Post subject: Reply with quote

braz2kuk wrote:


Is it possible to build your own initramfs?


You can build kernel which doesn't require initramfs. Just select appropriate option when configuring kernel. BTW why did you decide that the kernel panic was caused by lack of initramfs? Usually it occurs due to lack of sata driver or misconfigured fstab (wrong root partition)
Back to top
View user's profile Send private message
kite14
Apprentice
Apprentice


Joined: 07 Nov 2006
Posts: 199
Location: Pordenone/Italy

PostPosted: Fri Mar 15, 2019 3:17 pm    Post subject: Reply with quote

My 2 cents about building your own kernel.
Start with Pappy's kernel seed: these are preconfigured, generic .config files which must be completed with the configuration of your own hardware list. This resource → http://kernel-seeds.bloodnoc.org/working.html explains what is all about (it's a bit outdated, but still relevant and extremely interesting). You can download an updated kernel seed from this thread → https://forums.gentoo.org/viewtopic-t-1051430-postdays-0-postorder-asc-start-100.html
Back to top
View user's profile Send private message
braz2kuk
n00b
n00b


Joined: 26 Apr 2007
Posts: 60

PostPosted: Fri Mar 15, 2019 4:53 pm    Post subject: Reply with quote

Verdazil wrote:
braz2kuk wrote:
Is it possible to build your own initramfs?
This is usually not necessary. Initramfs is built into the kernel by default.


I did wonder this I’m using UEFI and my root partition is ext4, all this and support for my boot partition VFAT was built into the kernel so I was surprised when it didn’t boot, it mentioned something about not being able to mount root.

Hence why I thought potentially I needed an initramfs

Any ideas what I could have been missing?
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


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

PostPosted: Fri Mar 15, 2019 6:32 pm    Post subject: Reply with quote

braz2kuk,

The kernel never mounts the boot partition during the boot process. If it could do that, you wouldn't need a boot loader.
The boot loader makes its own arrangements to load the kernel and optionally, the initrd, then jumps to the kernel start address.
Its just the kernel and initrd in RAM now.

The kernel decompresses itself, initalises the built in code and if there is an initrd, mounts that as root.
With no initrd, it mounts the real root filesystem directly.

Your error message
Quote:
... mentioned something about not being able to mount root.
will have said Kernel Panic! Unable to mount the rootfs unknown-block(x,y).

We need the last part of the message, x and y are the kernel major and minor device numbers.
Indirectly, they point to what went wrong.
_________________
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
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