Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Kernel & Hardware
  • Search

First-time kernel configuration.

Kernel not recognizing your hardware? Problems with power management or PCMCIA? What hardware is compatible with Gentoo? See here. (Only for kernels supported by Gentoo.)
Post Reply
Advanced search
16 posts • Page 1 of 1
Author
Message
Leonardo.b
Guru
Guru
Posts: 314
Joined: Sat Oct 10, 2020 9:24 pm

First-time kernel configuration.

  • Quote

Post by Leonardo.b » Thu Oct 29, 2020 3:39 pm

Following the official guide from the Gentoo wiki I completed my first manual kernel configuration.
The system boots correctly, but many hardware components still doesn't work, or doesn't work well.

For example, the touchscreen/touchpad is not recognized. The fan system behaves in a strange way. A small led upon <F6> button (volume off), doesn't turn on.
I want to fix it. From where should I start?

I'll appreciate if someone would be able to give me a general advice about how to handle this kind of problems - or to send me to the related documentation, if it exists.
Top
pietinger
Moderator
Moderator
Posts: 6620
Joined: Tue Oct 17, 2006 5:11 pm
Location: Bavaria

  • Quote

Post by pietinger » Thu Oct 29, 2020 4:14 pm

The best you can do is google with the prefix: "gentoo wiki", for example: "gentoo wiki touchscreen".

A list of wiki pages you should visit is here (its my german installation guide - but you need only the links):

https://forums.gentoo.org/viewtopic-t-1 ... ight-.html
Top
NeddySeagoon
Administrator
Administrator
User avatar
Posts: 56080
Joined: Sat Jul 05, 2003 9:37 am
Location: 56N 3W

  • Quote

Post by NeddySeagoon » Thu Oct 29, 2020 4:23 pm

Leonardo.b,

This 2005 overview is still correct as far as configuration goes.

The /kernel seeds is a far more detailed guide.
Its methods are still correct.

As ever, the hard bit is discovering all the bits you need. Drivers in the the kernel are made up like the layers of a cake.
There is a well defined interface between the layers so that they can be mostly reused unchanged.
When new hardware comes along, a new optional bottom layer is all that's required.

Similarly, the other layers can be swapped out as required.
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Top
ff11
l33t
l33t
User avatar
Posts: 665
Joined: Mon Mar 10, 2014 10:24 pm

  • Quote

Post by ff11 » Thu Oct 29, 2020 5:06 pm

What I usually recommend in this situation is: get a liveISO or liveUSB, it can be Gentoo Linux, check that all the hardware is working first, then use its configuration as your seed:

Code: Select all

$ zcat /proc/config.gz > ./my_seed_config 
At least this way, you will have a better chance of your hardware be already 100% working on your the first attempt.
| Proverbs 26:12 |
| There is more hope for a fool than for a wise man that are wise in his own eyes. |
* AlphaGo - The Movie - Full Documentary "I want to apologize for being so powerless" - Lee
Top
Leonardo.b
Guru
Guru
Posts: 314
Joined: Sat Oct 10, 2020 9:24 pm

  • Quote

Post by Leonardo.b » Thu Oct 29, 2020 6:56 pm

This stuff is really useful. I'm going to read what you linked to me, in order to improve my poor, first, configuration. And I'll copy a seed from Gentoo installation medium, as it could help me. Thanks.
Anyway, I still have a couple of questions.

On the wiki there is a list of useful tools made for hardware detection.
I use them to collect the ID of my machine's component.
After that, do I simply check their name in the internet, to find wich kernel configurations are needed?
There are pages like "Linux-Hardware.org" that seems made for this.

And, about the linux kernel documentation: where could I find a more detailed description of each config, if not satisfied by what <H> over menuconfig just displays?
This would be nice, because I could disable a couple of function I don't want (like the laptop going in sleep mode when i pull the screen down, interrupting any compile work).
Otherwise I'll leave it as it is.
Top
pietinger
Moderator
Moderator
Posts: 6620
Joined: Tue Oct 17, 2006 5:11 pm
Location: Bavaria

  • Quote

Post by pietinger » Thu Oct 29, 2020 7:50 pm

Leonardo.b wrote:And, about the linux kernel documentation: where could I find a more detailed description of each config, if not satisfied by what <H> over menuconfig just displays?
If you have a question about a specific kernel parameter you should look into the help and google the parameter name (e.g.: google "linux CONFIG_AUDIT").

If you want a comprehensive survey of your kernel then start with "The Linux kernel user’s and administrator’s guide" you will find in the Linux Kernel documentation:

https://www.kernel.org/doc/html/latest/
Leonardo.b wrote:This would be nice, because I could disable a couple of function I don't want (like the laptop going in sleep mode when i pull the screen down, interrupting any compile work).
You will find the answer where hibernation is described. You just do the reverse action (= not enabling): https://wiki.gentoo.org/wiki/Suspend_and_hibernate
Last edited by pietinger on Thu Oct 29, 2020 7:52 pm, edited 1 time in total.
Top
NeddySeagoon
Administrator
Administrator
User avatar
Posts: 56080
Joined: Sat Jul 05, 2003 9:37 am
Location: 56N 3W

  • Quote

Post by NeddySeagoon » Thu Oct 29, 2020 7:52 pm

Leonardo.b,

Its not quite that simple.

Code: Select all

lspci -nnk 
will give you the device and vendor IDs for each device as well as the kernel module in use.
e.g.

Code: Select all

01:00.0 VGA compatible controller [0300]: Advanced Micro Devices, Inc. [AMD/ATI] Baffin [Radeon RX 460/560D / Pro 450/455/460/555/555X/560/560X] [1002:67ef] (rev cf)
	Subsystem: XFX Pine Group Inc. Device [1682:9460]
	Kernel driver in use: amdgpu
The vendor and device ID is the [1002:67ef].
Put
1002:67ef pci linux kernel
into google and the first hit is an auto generated page from the kernel source code.

Something similar works for USB and lsusb

Code: Select all

Bus 007 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Use the vendor and device ID but swap pci to usb in the search string.

This only gets you the bottom layer of the cake.

There is a drawback, well, several drawbacks to starting with the liveCD kernel. Its a fully modular kernel, which means it will require an initrd to boot at all.
Making an initrd is another thing to learn and get right and most users don't need it.
Secondly, the liveCD kernel is supposed to boot anywhere, so its full of junk, it will be junk to you anyway.

The kernel configuration tools are full of helpers, at least one of which will get in your way.
If an option you need depends on another option that is off, the option you need will be hidden. It won't appear is he search either.
The 'z' key toggles the display of hidden options, so you can read the help, to get the Depends on: boolean expression.

Code: Select all

  │ Symbol: CDROM_PKTCDVD [=m]                                       │  
  │ Type  : tristate                                                 │  
  │ Defined at drivers/block/Kconfig:332                             │  
  │   Prompt: Packet writing on CD/DVD media (DEPRECATED)            │  
  │   Depends on: BLK_DEV [=y] && !UML                               │  
  │   Location:                                                      │  
  │     -> Device Drivers                                            │  
  │       -> Block devices (BLK_DEV [=y])                            │  
  │ Selects: CDROM [=y] && BLK_SCSI_REQUEST [=y]                     │  
For example CDROM_PKTCDVD Depends on: BLK_DEV [=y] && !UML and if you choose it , it Selects: CDROM [=y] && BLK_SCSI_REQUEST [=y]
If you turn off BLK_DEV, CDROM_PKTCDVD will be hidden.

Lets digress into how things get started. A boot loader somehow loads the kernel and optional initrd into RAM, then jumps to the kernel start address.
At this point, the kernel is all alone in RAM. To start your PC it has to somehow mount a root filesystem unaided.
That root filesystem can either be the real root filesystem or the initrd, which will become a temporary root filesystem.

If the kernel can mount the real the real root filesystem, you can avoid learning how to make an initrd.
For the kernel to mount the real the real root filesystem, all the required code must be configured as <*>, so that its included in the kernel binary.
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Top
ff11
l33t
l33t
User avatar
Posts: 665
Joined: Mon Mar 10, 2014 10:24 pm

  • Quote

Post by ff11 » Thu Oct 29, 2020 8:33 pm

NeddySeagoon wrote:...
There is a drawback, well, several drawbacks to starting with the liveCD kernel. Its a fully modular kernel, which means it will require an initrd to boot at all.
Making an initrd is another thing to learn and get right and most users don't need it.
Secondly, the liveCD kernel is supposed to boot anywhere, so its full of junk, it will be junk to you anyway.
...
As he said, this is his "First-time kernel configuration", and he is already having issues with hardware identification with the kernel config.
And you are pointing the way we use to do it, but for a beginner who doesn't know how to configure the kernel, nor has memorized what to expect in each category, where the configurations are, it will take a long time to get a usable configuration (maybe even making him give up). And you still discard the basics about initrd, which may not even be necessary, true, but it does have its advantages (and even if it isn't used, users should know about it, to make more conscious choices).
And that is exactly why I recommend starting from a configuration that already works, and has already been tested on the hardware in question, and gradually removing some configs from it, while learning about the various possible configurations, without the urgency of having a system that isn't working (which is exactly the case exposed).
| Proverbs 26:12 |
| There is more hope for a fool than for a wise man that are wise in his own eyes. |
* AlphaGo - The Movie - Full Documentary "I want to apologize for being so powerless" - Lee
Top
NeddySeagoon
Administrator
Administrator
User avatar
Posts: 56080
Joined: Sat Jul 05, 2003 9:37 am
Location: 56N 3W

  • Quote

Post by NeddySeagoon » Thu Oct 29, 2020 8:53 pm

ff11,

There is no danger of having a non working system.
I don't think anyone posting here is advocating wiping out the existing working kernel.
Everyone builds a dud kernel now and again, so everyone keeps several kernels around to choose from on their boot menu.

Very little is required to have a kernel that will boot without an initrd.
Even on those installs that require user space tools to mount root, the intird can be made kernel agnostic so its not rebuilt every kernel update.

A kernel (and userspace) that drives all your hardware the way you like, I agree, can take a long lime. It need not be done in a single sitting though.
The hard bit is getting it to boot at all.
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Top
ff11
l33t
l33t
User avatar
Posts: 665
Joined: Mon Mar 10, 2014 10:24 pm

  • Quote

Post by ff11 » Thu Oct 29, 2020 9:01 pm

NeddySeagoon wrote:ff11,

There is no danger of having a non working system.
I don't think anyone posting here is advocating wiping out the existing working kernel.
Everyone builds a dud kernel now and again, so everyone keeps several kernels around to choose from on their boot menu.

Very little is required to have a kernel that will boot without an initrd.
Even on those installs that require user space tools to mount root, the intird can be made kernel agnostic so its not rebuilt every kernel update.
Yes, but I'm not talking about the technical aspects of the operation, but from the didactic point of view for learning (in a more educational style).
NeddySeagoon wrote:A kernel (and userspace) that drives all your hardware the way you like, I agree, can take a long lime. It need not be done in a single sitting though.
The hard bit is getting it to boot at all.
But this is exactly what many beginners expect. And it may not be ideal to spend a relatively little time (like one or two days), but I know that today, many of them expect it.
| Proverbs 26:12 |
| There is more hope for a fool than for a wise man that are wise in his own eyes. |
* AlphaGo - The Movie - Full Documentary "I want to apologize for being so powerless" - Lee
Top
Leonardo.b
Guru
Guru
Posts: 314
Joined: Sat Oct 10, 2020 9:24 pm

  • Quote

Post by Leonardo.b » Thu Oct 29, 2020 10:01 pm

I've just solved everything in an unexpected way.
I can't confirm -even if guided by the excitement I would- that everything now is working, because I should run some test before to write inaccurate sentences.
But the touchscreen/touchpad definitely are.
Top
Leonardo.b
Guru
Guru
Posts: 314
Joined: Sat Oct 10, 2020 9:24 pm

  • Quote

Post by Leonardo.b » Fri Oct 30, 2020 12:34 am

Ok. That was not only a misunderstanging.
I managed to make the kernel booting correctly under UEFI without initrd.

I didn't used the Gentoo installation medium* seed as base, while I used the command:

Code: Select all

make localmodconfig
That was useful to locate quickly and activate the modules I was missing, and start then with the manual kernel configuration.

So, now my kernel basically works, and it's full equipped without a lot of junk.
I only need to add a couple of missing function, and clean up some unnecessary others.
If for any reason, what I did comport any drawback, please tell me.

And, to conclude: still a question. When I run:

Code: Select all

dmesg | grep -i error
The result isn't void.
So I think is there something I could anyway improve.
How can I read those output?
Where should I look to find (and fix) that errors?



*The Gentoo installation medium is a terrible choice for an HiDPi laptop, because big fonts are missing, and it doesn't connect to wpa wireless; but it is able to reveal an higher number of hardware components than what Ubuntu LIVE does.
Top
Tony0945
Watchman
Watchman
Posts: 5127
Joined: Tue Jul 25, 2006 12:19 am
Location: Illinois, USA

  • Quote

Post by Tony0945 » Fri Oct 30, 2020 12:52 am

Leonardo.b wrote:And, to conclude: still a question. When I run:

Code: Select all

dmesg | grep -i error
The result isn't void.
So I think is there something I could anyway improve.
It isn't that easy, but you're on the right track.
Example:

Code: Select all

~ $ dmesg | grep -i error
[    0.274246] ACPI Error: AE_NOT_FOUND, While resolving a named reference package element - LNKC (20190816/dspkginit-438)
I've got a ton of these and I think it's because of an old BIOS with bad ACPI support. Nothing I can do about that.

But you are on the right track. I used that method to nail down my USB modules. Trial and error, unless someone knows a more refined way.
Top
NeddySeagoon
Administrator
Administrator
User avatar
Posts: 56080
Joined: Sat Jul 05, 2003 9:37 am
Location: 56N 3W

  • Quote

Post by NeddySeagoon » Fri Oct 30, 2020 11:31 am

Leonardo.b,

Play with wgetpaste and put your entire dmesg output onto a pastebin site, then tell us the link.

We need it all and not just the errors an there may well be things missing that should be there.
They are just as important to problem solving as the things that appear in the logs.

We can't spot things missing if you only provide log fragments.

With that, we can give you a few pointers.
Also, some error are harmless, even expected.
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Top
Leonardo.b
Guru
Guru
Posts: 314
Joined: Sat Oct 10, 2020 9:24 pm

  • Quote

Post by Leonardo.b » Fri Oct 30, 2020 2:51 pm

I have uploaded the full otput of the "dmesg" command onto pastebin.
Here you can see it: <expired>.

Now, I was reading some docs about how this command works.
I guess that, for example, that:

Code: Select all

[    1.273920] hp_accel: laptop model unknown, using default axes configuration
[    1.296043] lis3lv02d: unknown sensor type 0x0
[    1.296056] hp_accel: probe of HPQ6007:00 failed with error -22
means that something has gone wrong with the accelerometer.
I guess it could be due the fact that I compiled hp_accel as build-in.
It is a nonsense because the accelerometer isn't necessary to boot.
So I put it as module, now.

Anyway, I'm not able to understand most of the messages.
My approach is rough. I don't know really what I am doing.
I'll appreciate a general advice more than a particular solution to mine configuration's issues.
Top
Leonardo.b
Guru
Guru
Posts: 314
Joined: Sat Oct 10, 2020 9:24 pm

  • Quote

Post by Leonardo.b » Mon Nov 16, 2020 9:46 pm

Ok, I've just finished to set up my kernel - now it works very well.
I've followed your suggestion: I checked everything manually again, and I found a couple of missing functions.
I read all the pages you linked to me.

Also, in a previous post (~2019) I am unable to find anymore, I found someone in trouble with a device named ELAN 04F3:23F4 .
I found it could be an USB touchscreen. Google fails with it.
In that post @NeddySeagoon asked to the user in question, if I don't remember wrong, something like "Is there on your device a key to deactivate the touchscreen? Isn't?"
It is not my case, but I now that a convertible laptop generates some sort of keyboards event when flipping. I also enabled some special buttons.

Code: Select all

CONFIG_TOUCHSCREEN_USB_COMPOSITE
CONFIG_TOUCHSCREEN_USB_ELO
Maybe this can be useful for someone.
Maybe not, but in that case that's not mine problem.

Thanks for the help.
Leonardo
Top
Post Reply

16 posts • Page 1 of 1

Return to “Kernel & Hardware”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy

 

 

magic