Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Help me get my kernel right [SOLVED]
View unanswered posts
View posts from last 24 hours

Goto page 1, 2  Next  
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
sokrovenno
n00b
n00b


Joined: 23 Aug 2023
Posts: 67

PostPosted: Fri Jan 05, 2024 4:37 pm    Post subject: Help me get my kernel right [SOLVED] Reply with quote

I've been using Gentoo since we got locked into the pandemics, and I did make my own kernel. Yes, now I know that it was not the smartest move, but I learned a lot and that was the point that made me opt for Gentoo. With the years I tried to use a bit of each option that we have available, genkernel, gentoo-kernel-bin, gentoo-kernel, gentoo-sources. Although I did not understand much of what I was doing, I never liked to use kernels I did not build on my own, although they were reliable I felt that my kernels were slightly better in most occasions. So I made my own kernel through gentoo-sources and made small changes in order to get a small footprint since I have little RAM (only 4 Gb). I feel like I almost nailed it, but there are always this question in the back of my mind. Is it alright or is there something I missed?

Using daily I do not notice problems. I feel that somethings may could run a little better, but an overall picture it is ok. But when I try to play games I feel that is something not quite right and I always ask myself, "is it my kernel or is it some program that I didn't compile?

So after these years reading the wiki, and trying things on my own I decided to come here and ask for help

Here is my .config and probably I would have to share my notebook specs.

Is there anyone willing to dive into this rabbit hole and help a stranger to get a kernel right?

I don't know if this is the right place, sorry (for my english) if I posted it in the wrong place.


Last edited by sokrovenno on Sat Jan 20, 2024 9:05 pm; edited 1 time in total
Back to top
View user's profile Send private message
dartleader
Tux's lil' helper
Tux's lil' helper


Joined: 21 Apr 2019
Posts: 128

PostPosted: Fri Jan 05, 2024 4:45 pm    Post subject: Re: Help me get my kernel right Reply with quote

sokrovenno wrote:
Here is my .config and probably I would have to share my notebook specs.


You are definitely going to have to share your computer specs if you want any kind of meaningful help with your kernel. What exactly are you trying to accomplish, running the smallest kernel possible? You may be interested in the options available if you run
Code:
make help
in /usr/src/linux, and look under the "Configuration targets:" heading. Options are included to set options from yes to mod, and mod to no, where possible, etc. It also allows you to save your current kernel config before you start tinkering.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


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

PostPosted: Fri Jan 05, 2024 5:47 pm    Post subject: Reply with quote

sokrovenno,

We will need the output of
Code:
lspci -nnk
to see your PCI hardware.

For USB hardware, connect it all the post the output of
Code:
lsusb

There is no need to do that in one go but we need to see a line for for all your UBB connected hardware, on we may disable something you need.

Lastly, pastebin the entire dmesg output. That will show i2c and ACPI detected hardware, such as your touchpad.
You will want that.

Meanwhile ...
Code:
CONFIG_CPU_SUP_INTEL=y
CONFIG_CPU_SUP_AMD=y
CONFIG_CPU_SUP_HYGON=y
CONFIG_CPU_SUP_CENTAUR=y
CONFIG_CPU_SUP_ZHAOXIN=y
CONFIG_HPET_TIMER=y
You should only need one of those, to support your CPU vendor

How do you load your kernel?
Code:
CONFIG_EFI=y
CONFIG_EFI_STUB=y
CONFIG_EFI_MIXED=y


Don't do
Code:
CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE=y
on a notebook. CPU cooling in small systems is decorative only.
Your CPU may be in thermal throttling before it needs to be.
CONFIG_CPU_FREQ_DEFAULT_GOV_SCHEDUTIL is a good choice but Intel CPUs have others too.
The CPU governor cat be changed at runtime, so by all means include several CPU governors in the kernel.

CONFIG_AMD_NB=y why?
Your system seems to be Intel.

If you don't run Virtual Machines, you don't need
Code:
CONFIG_VIRTUALIZATION=y
CONFIG_KVM=y
CONFIG_KVM_WERROR=y
CONFIG_KVM_INTEL=m


Code:
CONFIG_BINFMT_MISC=y
allows the execution of non native binaries with QEMU. Turn it off if you don't need it.

Unless your system in about 20 years old,
Code:
CONFIG_PCCARD=y
CONFIG_PCMCIA=y
CONFIG_PCMCIA_LOAD_CIS=y
CONFIG_CARDBUS=y
you don't have that hardware.

Likewise
Code:
CONFIG_YENTA=y


Code:
CONFIG_EXTRA_FIRMWARE="i915/kbl_dmc_ver1_04.bin"
where do you load your CPU microcode?
It can be in its own initramfs if you like.

Code:
CONFIG_CDROM=y
does your system have a CDROM

What do you use
Code:
CONFIG_MD=y
for?
Ahh ...
Code:
CONFIG_DM_CRYPT=y


Code:
CONFIG_NETCONSOLE=y
If you don't know what thats for, turn it off because you are not using it.

All these
Code:
CONFIG_NET_VENDOR_*=y
can be off except the ones you need. It does not save any space but makes the .config easier to read.

That's the first 2000 lines of your kernel. We are into device drivers now so need the outputs i asked for above.
_________________
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
sokrovenno
n00b
n00b


Joined: 23 Aug 2023
Posts: 67

PostPosted: Fri Jan 05, 2024 6:03 pm    Post subject: Re: Help me get my kernel right Reply with quote

dartleader wrote:
What exactly are you trying to accomplish, running the smallest kernel possible?


My objectives were:
Smallest kernel footprint possible, since I have small RAM.
All my hardware being supported by the kernel (I think i accomplished this over the years, but still unsure)
Make sure that the kernel support my hardware in the ("best way possible"?) fastest/snappiest way possible and to support my games.
Remove everything that is not necessary to reduce compiling time, since my notebook is not the best.

eg: I used to play Skyrim in this notebook, but since I installed Gentoo I did not got the same experience I used to get before formating and I am never sure if it's my kernel fault or is some program I need to download in order to have a smooth experience. And it's not only steam games or Skyrim, even mednafen for PSX games is droping fps and some delay and although my notebook is not the best, it should run this things okay.

dartleader wrote:
You are definitely going to have to share your computer specs if you want any kind of meaningful help with your kernel


My next question was, how is the best way to share this information with you all, but NeddySeagoon already asked for me to share the some output, so I'll answer this through my answer to him
Back to top
View user's profile Send private message
sokrovenno
n00b
n00b


Joined: 23 Aug 2023
Posts: 67

PostPosted: Fri Jan 05, 2024 6:11 pm    Post subject: Re: Help me get my kernel right Reply with quote

NeddySeagoon,

here is my lspci

here is my lsusb

here is my dmesg
Back to top
View user's profile Send private message
sokrovenno
n00b
n00b


Joined: 23 Aug 2023
Posts: 67

PostPosted: Fri Jan 05, 2024 6:34 pm    Post subject: Reply with quote

NeddySeagoon wrote:

How do you load your kernel?
CONFIG_EFI=y
CONFIG_EFI_STUB=y
CONFIG_EFI_MIXED=y


I'm not sure what it implicates. What do you mean? What am I supposed to do?
I would gladly accept any tips or links

NeddySeagoon wrote:

Don't do

CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE=y
on a notebook. CPU cooling in small systems is decorative only.
Your CPU may be in thermal throttling before it needs to be.
CONFIG_CPU_FREQ_DEFAULT_GOV_SCHEDUTIL is a good choice but Intel CPUs have others too.
The CPU governor cat be changed at runtime, so by all means include several CPU governors in the kernel.


I think I just followed this article
But if I remember correctly, Power Management on intel was pretty bad. Other CPU Governors did not helped to preserve battery and it was weird, slowed down, delayed, sluggish? (sorry, I don't know many terms to describe)


NeddySeagoon wrote:


If you don't run Virtual Machines, you don't need
CONFIG_VIRTUALIZATION=y
CONFIG_KVM=y
CONFIG_KVM_WERROR=y
CONFIG_KVM_INTEL=m


I think I was trying to test virtualization on QEMU, not sure though.

NeddySeagoon wrote:

CONFIG_EXTRA_FIRMWARE="i915/kbl_dmc_ver1_04.bin"
where do you load your CPU microcode?
It can be in its own initramfs if you like.


Actually I'm a little confused how to setup a initramfs, earlier I was searching how to do it correctly, but still not sure how to do it.

NeddySeagoon wrote:

CONFIG_CDROM=y
does your system have a CDROM


CDROM is selected because some of those
Code:

Symbol: CDROM [=y]                                                                                           │ 
  │ Type  : tristate                                                                                             │ 
  │ Defined at drivers/block/Kconfig:91                                                                          │ 
  │   Depends on: BLK_DEV [=y]                                                                                   │ 
  │ Selected by [y]:                                                                                             │ 
  │   - BLK_DEV_SR [=y] && SCSI [=y] && BLK_DEV [=y]                                                             │ 
  │ Selected by [n]:                                                                                             │ 
  │   - GDROM [=n] && BLK_DEV [=y] && SH_DREAMCAST                                                               │ 
  │   - PARIDE_PCD [=n] && BLK_DEV [=y] && PARIDE [=n]                                                           │ 
  │   - CDROM_PKTCDVD [=n] && BLK_DEV [=y] && !UML && SCSI [=y]


Quote:

What do you use CONFIG_MD=y for?
Ahh ...CONFIG_DM_CRYPT=y

Not sure if I should deactivate this.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


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

PostPosted: Fri Jan 05, 2024 7:14 pm    Post subject: Reply with quote

sokrovenno,

From lspci.
Code:
CONFIG_8139TOO=y
CONFIG_8139TOO_PIO=y
are not required. Tey are for older 100MBit cards.

You use
Code:
CONFIG_R8169=y



From lsusb, You have
Code:
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
and no USB1 root hubs,

Code:
CONFIG_USB_OHCI_HCD=y
CONFIG_USB_OHCI_HCD_PCI=y
CONFIG_USB_UHCI_HCD=y
should all be off as you don't have the hardware.

I would turn on
Code:
# CONFIG_USB_EHCI_ROOT_HUB_TT is not set


Code:
Bus 001 Device 004: ID 0cf3:e500 Qualcomm Atheros Communications [unknown]
is a USB connected bluetooth device. It may well be internal to the system.

Code:
Bus 001 Device 002: ID 0c76:161f JMTek, LLC. [unknown]

Is a USB 7.1 headset.

Code:
Bus 001 Device 003: ID 046d:c077 Logitech, Inc. Mouse

Logitech M105 Optical Mouse.
Its not clear if it wired or wireless from reading the internet.

Code:
Bus 001 Device 005: ID 2232:1080 Silicon Motion [unknown]
is your webcam.
It needs uvc in the kernel.

Your USB3 is unused, as yet.
Turn on
Code:
# CONFIG_USB_UAS is not set
Its USB Attached SCSI and gives you DMA, NCQ and all those other good things to USB3 storage but only if its USB3 all the way.

If you have a USB Type C port, turn on
Code:
# CONFIG_TYPEC is not set
as thats the driver for it.

Do you really have a Joystick Interface or a real Serial port?

From dmesg
Code:
[    0.608664] hid-multitouch 0018:03EB:2168.0001: input,hidraw0: I2C HID v1.00 Mouse [ATML3000:00 03EB:2168] on i2c-ATML3000:00
your tochpad is indeed i2c

The serial port driver loads
Code:
[    0.389320] Serial: 8250/16550 driver, 4 ports, IRQ sharing enabled
but it does not find any hardware, so you probably don't need it.
Do you have /dev/ttyS0 to /dev/ttyS3 ?

The microcode driver loads
Code:
[    0.464661] microcode: sig=0x806ea, pf=0x80, revision=0xf4
[    0.464677] microcode: Microcode Update Driver: v2.2.
but says noting about any update.

Code:
[    1.743628] md: Waiting for all devices to be available before autodetect
[    1.744307] md: If you don't use raid, use raid=noautodetect
[    1.744980] md: Autodetecting RAID arrays.
[    1.745639] md: autorun ...
[    1.746304] md: ... autorun DONE.
[    1.828877] EXT4-fs (sda2): mounted filesystem with ordered data mode. Quota mode: none.

That says that you do not have on encrypted root and you need the EXT4 fs driver. You will also need VFAT to be able to update the EFI System Partition.

If you turn off both
Code:
CONFIG_EXT2_FS=y
CONFIG_EXT3_FS=y
You ill see a new option to use the Ext4 driver for Ext2 and Ext3. Turn that on if you need Ext2 and/or Ext3y

Where do you use
Code:
CONFIG_JBD2=y
CONFIG_XFS_FS=y


Do you use
Code:
CONFIG_NFS_FS=y
at all?
Turn off
Code:
CONFIG_NFS_V2=y
s its a security hazard and move to version 3, at least.
_________________
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
sokrovenno
n00b
n00b


Joined: 23 Aug 2023
Posts: 67

PostPosted: Fri Jan 05, 2024 9:31 pm    Post subject: Reply with quote

Hey NeddySeagoon I'm very grateful for your help so far. I have some questions yet though.

NeddySeagoon wrote:

Don't do
CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE=y
on a notebook. CPU cooling in small systems is decorative only.
Your CPU may be in thermal throttling before it needs to be.
CONFIG_CPU_FREQ_DEFAULT_GOV_SCHEDUTIL is a good choice but Intel CPUs have others too.
...

Can you tell me more about it?


I'm not sure what you meant here
NeddySeagoon wrote:
How do you load your kernel?
Code:
CONFIG_EFI=y
CONFIG_EFI_STUB=y
CONFIG_EFI_MIXED=y

are these unnecessary?


NeddySeagoon wrote:
CONFIG_EXTRA_FIRMWARE="i915/kbl_dmc_ver1_04.bin"
It can be in its own initramfs if you like.

I don't know if I'm going out of scope, but could you give me some help how one add it to initramfs? I tried Dracut, should I try something else?

NeddySeagoon wrote:
The microcode driver loads
[ 0.464661] microcode: sig=0x806ea, pf=0x80, revision=0xf4
[ 0.464677] microcode: Microcode Update Driver: v2.2.
but says noting about any update.

Maybe you're right, but I checked the wiki here and based in what it says, it looks similar.
Code:

[    0.000000] microcode: microcode updated early to revision 0xf4, date = 2023-02-23
[    0.410781] microcode: sig=0x806ea, pf=0x80, revision=0xf4
[    0.410799] microcode: Microcode Update Driver: v2.2.


And last but not least, for some reason my Tux logo at kernel boot disappeared. :cry:
Can you help me fix it?

I tried to set
Code:
 CONFIG_FB_SIMPLE = y

but still Tux does not appear
Back to top
View user's profile Send private message
Gentoopc
Guru
Guru


Joined: 25 Dec 2017
Posts: 413

PostPosted: Sun Jan 07, 2024 12:37 am    Post subject: Reply with quote

sokrovenno wrote:


Do I understand your nickname correctly? Aren't you a microcontroller programmer?
Back to top
View user's profile Send private message
sokrovenno
n00b
n00b


Joined: 23 Aug 2023
Posts: 67

PostPosted: Sun Jan 07, 2024 11:20 am    Post subject: Reply with quote

Gentoopc wrote:
Do I understand your nickname correctly?

I don't know what you understood. I think my nickname is a russian word, but I'm not sure.
Now I'm curious, what do you understood from it? :D

Gentoopc wrote:
Aren't you a microcontroller programmer?

No I was just a Metal Gear Solid 3 fan as a kid and this nickname comes from an area where you must defeat a boss called The End.
I don't know why, but this nickname stuck with me through the years and I noticed that it is rarely used as a nickname, so is the first thing I try whenever I try to create an account on something.

If you search on any search engine probably is the first thing that will appear is some MGS3 wiki.
Back to top
View user's profile Send private message
Gentoopc
Guru
Guru


Joined: 25 Dec 2017
Posts: 413

PostPosted: Mon Jan 08, 2024 5:13 am    Post subject: Reply with quote

sokrovenno wrote:



I just knew a forum registrant with that nickname. He was a microcontroller programmer. I thought maybe he used the same nickname here too. that's all. apparently I have a mistake.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


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

PostPosted: Sat Jan 13, 2024 2:02 pm    Post subject: Reply with quote

sokrovenno,

Pastebin your kernel .config file as it is now.
_________________
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
myga
Tux's lil' helper
Tux's lil' helper


Joined: 12 Jun 2023
Posts: 121

PostPosted: Thu Jan 18, 2024 3:10 am    Post subject: Reply with quote

Here are some tips on how I configured mine:

    -> get a list of your hardware (you will need an external storage e.g. USB drive):
    ---> I recommend booting a working distro such as EndeavourOS.
    ---> and run the command "dmesg > /PATH/TO/USB/DRIVE/liveCD.log".
    ---> copy the currently running system's (EndeavourOS) config to a USB drive by running "cp /boot/config-$(uname -r) /PATH/TO/USB/DRIVE/liveCD_kern_config" or "zcat /proc/config.gz > /PATH/TO/USB/DRIVE/liveCD_kern.config".

    --> boot into your Gentoo installation.
    ---> based on the hardware info you gathered above, start disabling any configurations in the kernel that you don't have the hardware for.
    ---> for me specifically, I got rid of anything AMD because I don't use that hardware.
    ---> the other config files you collected can be used to tune your kernel and get things working such as sound, card readers, etc.


Good luck.
Back to top
View user's profile Send private message
sokrovenno
n00b
n00b


Joined: 23 Aug 2023
Posts: 67

PostPosted: Thu Jan 18, 2024 1:24 pm    Post subject: Reply with quote

NeddySeagoon,

.config
dmesg in case it is necessary.

I tried to remove all options you have told me, but for some reason some of them were necessary. So I removed one by one until things were right.
Back to top
View user's profile Send private message
pietinger
Moderator
Moderator


Joined: 17 Oct 2006
Posts: 5372
Location: Bavaria

PostPosted: Thu Jan 18, 2024 3:38 pm    Post subject: Reply with quote

sokrovenno,

I have checked your files. Here are my comments:

Code:
1.
CONFIG_EXPERT=y
2.
CONFIG_PROFILING=y
CONFIG_TRACEPOINTS=y
3.
# CONFIG_X86_CPU_RESCTRL is not set
4.
CONFIG_X86_EXTENDED_PLATFORM=y
5.
CONFIG_EFI_MIXED=y
6.
CONFIG_HZ_1000=y
7.
CONFIG_KEXEC=y
8.
CONFIG_CPU_FREQ_DEFAULT_GOV_SCHEDUTIL=y
9.
CONFIG_X86_ACPI_CPUFREQ=y
10.
# CONFIG_INTEL_IDLE is not set
11.
CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
12.
# CONFIG_TRANSPARENT_HUGEPAGE is not set
13.
# CONFIG_LRU_GEN is not set
14.
# CONFIG_NETFILTER_ADVANCED is not set
15.
# CONFIG_HOTPLUG_PCI_PCIE is not set
16.
# CONFIG_PCIE_DW_PLAT_HOST is not set
17.
CONFIG_ATA_PIIX=y
CONFIG_PATA_AMD=y
CONFIG_PATA_OLDPIIX=y
CONFIG_PATA_SCH=y
18.
CONFIG_I2C_I801=m
CONFIG_I2C_ISCH=m
CONFIG_I2C_ISMT=m
CONFIG_I2C_PIIX4=m
19.
# CONFIG_I2C_DESIGNWARE_PCI is not set
20.
# CONFIG_SENSORS_DRIVETEMP is not set
CONFIG_SENSORS_CORETEMP=y
21.
# CONFIG_LPC_ICH is not set
CONFIG_LPC_SCH=y
CONFIG_MFD_INTEL_LPSS_PCI=y
22.
CONFIG_DRM_SIMPLEDRM=y
# CONFIG_FB_VESA is not set
# CONFIG_FB_EFI is not set
23.
CONFIG_USB_EHCI_HCD=y
CONFIG_USB_UHCI_HCD=y
24.
CONFIG_TYPEC=y
25.
# CONFIG_INTEL_IDMA64 is not set
26.
CONFIG_EEEPC_LAPTOP=y
27.
# CONFIG_IRQ_REMAP is not set
28.
CONFIG_EXT2_FS=y
CONFIG_EXT3_FS=y
29.
CONFIG_QUOTA=y
30.
# CONFIG_EXFAT_FS is not set
# CONFIG_NTFS_FS is not set
31.
CONFIG_NETWORK_FILESYSTEMS=y
32.
CONFIG_SECURITY_SELINUX=y
CONFIG_INTEGRITY=y
# CONFIG_SECURITY_YAMA is not set
# CONFIG_SECURITY_LANDLOCK is not set
33.
# Accelerated Cryptographic Algorithms for CPU (x86)


1. YES ;-)
2. Do you really need/use it ? ... save memory ...
3. Enable it
4. Disable it
5. I dont think your thinkpad is so old; you dont need it
6. Dont forget: This is for every core; you have 4 cores => 4 x 1000 = 4.000 interrupts/sec. I recommend 300
7. Do you really need/use it ? ... save memory ...
8. Good. For a notebook "powersave" is also good.
9. You dont need it. Your CPU has "hwp" and uses only Intel P-State
10. Enable it.
11. Change it to 65.536
12. I recommend it (performance!) see also in my link below
13. I recommend it (performance!) see also in my link below
14. You will need it if you make a firewall with some "better" rules (e.g. CONFIG_NETFILTER_XT_MATCH_OWNER=y)
15. If your really have USB-C (-> 24) you will need it !
16. You have a designware controller; maybe you will need this additionally
17. I dont believe you need this (you have SATA AHCI and no CD-ROM)
18. You need ONLY CONFIG_I2C_I801=y (you have an Intel machine)
19. see 16.
20. Maybe you want Drivetemp also ? (I am using both because I have also an Intel machine)
21. I dont think you need SCH; if you need ICH you must check with 1. Booting a LiveCD and 2. Check with "lsmod" - see also my links below
22. Disable SIMPLEDRM and enable both FB
23. Do you really have such old USB ? Check with 1. Booting a LiveCD and 2. Check with "lsmod" - see also my link below
24. see 15
25. Maybe you need it. Check with 1. Booting a LiveCD and 2. Check with "lsmod" - see also my links below
26. ... I dont think so ... :lol:
27. ENABLE IT !
28. Usually you dont need it because EXT4 driver supports also EXT2 and EXT3 ... save memory ...
29. Do you really need/use it ? ... save memory ...
30. Sometimes you get an USB-stick from a friend who has Windows ... enabling it as module doesnt hurt ... ;-)
31. Do you have a file-server in your network ? If no, disable it and save memory
32. Do you really use SELINUX ? And I dont believe you are using IMA. Disable both ... AND ... enable YAMA and LANDLOCK
33. You dont have enabled any module here ... IF ... If you really need some cryprographics modules (in all the other submenus) THEN it is wise to enable the ACCELERATED modules ALSO - see also my links below

At the moment you are using an initramfs (built with dracut). For what do you need it ? Is your root partition encrypted ? If yes, okay you need an initramfs. If not, .... why ? ... When you configure your kernel yourself you can build all what you need into the kernel - CPU microcode and firmware files are loaded from initramfs at the moment ... but you can do it yourself too ->

https://wiki.gentoo.org/wiki/User:Pietinger/Tutorials/Manual_kernel_configuration#Driver_needs_Firmware
https://forums.gentoo.org/viewtopic-t-1065464.html

Maybe you want read also:
https://wiki.gentoo.org/wiki/User:Pietinger/Tutorials/Manual_kernel_configuration
https://wiki.gentoo.org/wiki/User:Pietinger/Tutorials/Manual_Configuring_Kernel_Version_6.1
https://wiki.gentoo.org/wiki/User:Pietinger/Tutorials/Kernel_Hardening_with_KSPP
_________________
https://wiki.gentoo.org/wiki/User:Pietinger
Back to top
View user's profile Send private message
grknight
Retired Dev
Retired Dev


Joined: 20 Feb 2015
Posts: 2004

PostPosted: Thu Jan 18, 2024 3:48 pm    Post subject: Reply with quote

pietinger wrote:

Code:
30.
# CONFIG_EXFAT_FS is not set
# CONFIG_NTFS_FS is not set


30. Sometimes you get an USB-stick from a friend who has Windows ... enabling it as module doesnt hurt ... ;-)

Always prefer CONFIG_NTFS3_FS over CONFIG_NTFS_FS. At least you can use it to write to devices without blowing the FS up.
Back to top
View user's profile Send private message
mrbassie
l33t
l33t


Joined: 31 May 2013
Posts: 833
Location: Go past the sign for cope, right at the sign for seethe. If you see the target you've missed it.

PostPosted: Thu Jan 18, 2024 3:49 pm    Post subject: Reply with quote

sokrovenno wrote:
NeddySeagoon,

.config
dmesg in case it is necessary.

I tried to remove all options you have told me, but for some reason some of them were necessary. So I removed one by one until things were right.


Your dmesg reports
Code:
Intel(R) Core(TM) i3-7020U


Which according to a quick search is kabylake.

Code:
CONFIG_X86_INTEL_PSTATE:                                                                                                                                       │ 
  │                                                                                                                                                                │ 
  │ This driver provides a P state for Intel core processors.                                                                                                      │ 
  │ The driver implements an internal governor and will become                                                                                                     │ 
  │ the scaling driver and governor for Sandy bridge processors.                                                                                                   │ 
  │                                                                                                                                                                │ 
  │ When this driver is enabled it will become the preferred                                                                                                       │ 
  │ scaling driver for Sandy bridge processors.                                                                                                                    │ 
  │                                                                                                                                                                │ 
  │ If in doubt, say N.


So you I think you can disable it. I may be wrong. It could be that it ought to say sandybridge and later.

EDIT: pasted the wrong thing.
_________________
I spent a christmas in Vienna twenty something years ago. It was a beautiful city. Everyone was so friendly.


Last edited by mrbassie on Thu Jan 18, 2024 3:58 pm; edited 2 times in total
Back to top
View user's profile Send private message
pietinger
Moderator
Moderator


Joined: 17 Oct 2006
Posts: 5372
Location: Bavaria

PostPosted: Thu Jan 18, 2024 3:55 pm    Post subject: Reply with quote

grknight wrote:
Always prefer CONFIG_NTFS3_FS over CONFIG_NTFS_FS. At least you can use it to write to devices without blowing the FS up.

I like it when it is read only ... ;-)
_________________
https://wiki.gentoo.org/wiki/User:Pietinger
Back to top
View user's profile Send private message
pietinger
Moderator
Moderator


Joined: 17 Oct 2006
Posts: 5372
Location: Bavaria

PostPosted: Thu Jan 18, 2024 3:57 pm    Post subject: Reply with quote

mrbassie wrote:
So you I think you can disable it.

This is wrong. I have checked his dmesg before my analyze and he has a newer Intel CPU WITH "hwp", so he needs P-State:
Code:
[    0.441707] intel_pstate: Intel P-state driver initializing
[    0.441864] intel_pstate: HWP enabled


P-State is for ALL Intel CPUs which are newer than 4th generation. So, I must use it also for my RaptorLake (Gen.13).
_________________
https://wiki.gentoo.org/wiki/User:Pietinger


Last edited by pietinger on Thu Jan 18, 2024 3:59 pm; edited 1 time in total
Back to top
View user's profile Send private message
mrbassie
l33t
l33t


Joined: 31 May 2013
Posts: 833
Location: Go past the sign for cope, right at the sign for seethe. If you see the target you've missed it.

PostPosted: Thu Jan 18, 2024 3:59 pm    Post subject: Reply with quote

You posted that right while I was editing my post. Anyway I stand corrected.
_________________
I spent a christmas in Vienna twenty something years ago. It was a beautiful city. Everyone was so friendly.


Last edited by mrbassie on Thu Jan 18, 2024 4:00 pm; edited 1 time in total
Back to top
View user's profile Send private message
pietinger
Moderator
Moderator


Joined: 17 Oct 2006
Posts: 5372
Location: Bavaria

PostPosted: Thu Jan 18, 2024 4:00 pm    Post subject: Reply with quote

mrbassie wrote:
You posted that right while I was editing my post.

Yes ... sorry ... I was too fast ... :lol:

All good ! :D
_________________
https://wiki.gentoo.org/wiki/User:Pietinger
Back to top
View user's profile Send private message
mrbassie
l33t
l33t


Joined: 31 May 2013
Posts: 833
Location: Go past the sign for cope, right at the sign for seethe. If you see the target you've missed it.

PostPosted: Thu Jan 18, 2024 4:01 pm    Post subject: Reply with quote

You did it again :lol:
_________________
I spent a christmas in Vienna twenty something years ago. It was a beautiful city. Everyone was so friendly.
Back to top
View user's profile Send private message
pietinger
Moderator
Moderator


Joined: 17 Oct 2006
Posts: 5372
Location: Bavaria

PostPosted: Thu Jan 18, 2024 4:03 pm    Post subject: Reply with quote

mrbassie wrote:
You did it again :lol:

Yes ... I can't help myself :lol:

(I must leave home now, so I am in hurry)
_________________
https://wiki.gentoo.org/wiki/User:Pietinger
Back to top
View user's profile Send private message
sokrovenno
n00b
n00b


Joined: 23 Aug 2023
Posts: 67

PostPosted: Thu Jan 18, 2024 6:30 pm    Post subject: Reply with quote

CONFIG_TRACEPOINTS:
For some reason I can't find it under the menuconfig. I searched it and it leads me to ATH_TRACEPOINTS. Looks like TRACEPOINTS is selected by other configs.

Code:
 Symbol: TRACEPOINTS [=y]
 Type  : bool                                                                                             
 Defined at init/Kconfig:1946
 Selected by [y]:
  - TRACING [=y]
  - BLK_DEV_IO_TRACE [=y] && FTRACE [=y] && SYSFS [=y] && BLOCK [=y]

Should I disable these?


pietinger wrote:
14. You will need it if you make a firewall with some "better" rules (e.g. CONFIG_NETFILTER_XT_MATCH_OWNER=y)

I do not understand much about firewalls, should I enable it?

pietinger wrote:
21. I dont think you need SCH; if you need ICH you must check with 1. Booting a LiveCD and 2. Check with "lsmod" - see also my links below
21.
# CONFIG_LPC_ICH is not set
CONFIG_MFD_INTEL_LPSS_PCI=y


I'm not sure what should I do with CONFIG_MFD_INTEL_LPSS_PCI. Currently I cannot boot a LiveCD because I'm on vacation and did not bring my USB stick. There is another way to do it? May I can use a kernel-bin or genkernel?

I have a question about modules. Is it really necessary or can I build my kernel with my config=y? I choose config=m just because I followed what the wiki said.
I remember reading about it, but did not really grasped the concept and what it really meant. :oops:

Now I'm going to check the links you provided. Thank you (all) very much for your help.

Edit: For some reason I can not understand dracut is being called automatically when I remade the kernel. Does someone knows why?

Code:
 INSTALL /boot
run-parts: executing /etc/kernel/preinst.d/50-dracut.install 6.1.67-gentoo arch/x86/boot/bzImage
dracut: Executing: /usr/bin/dracut --force --verbose --kernel-image arch/x86/boot/bzImage arch/x86/boot/initrd 6.1.67-gentoo
dracut: dracut module 'dash' will not be installed, because command 'dash' could not be found!
dracut: dracut module 'mksh' will not be installed, because command 'mksh' could not be found!
dracut: dracut module 'systemd' will not be installed, because command '/lib/systemd/systemd' could not be found!
dracut: dracut module 'systemd-ask-password' will not be installed, because command 'systemd-ask-password' could not be found!
dracut: dracut module 'systemd-ask-password' will not be installed, because command 'systemd-tty-ask-password-agent' could not be found!
[...]


Edit2: I uninstalled dracut, remade the kernel and got a Kernel Panic at the boot. My old kernel is not booting too. :lol: :cry:
Back to top
View user's profile Send private message
pietinger
Moderator
Moderator


Joined: 17 Oct 2006
Posts: 5372
Location: Bavaria

PostPosted: Thu Jan 18, 2024 9:11 pm    Post subject: Reply with quote

sokrovenno wrote:
CONFIG_TRACEPOINTS:
For some reason I can't find it under the menuconfig. I searched it and it leads me to ATH_TRACEPOINTS. Looks like TRACEPOINTS is selected by other configs.

Code:
 Symbol: TRACEPOINTS [=y]
 Type  : bool                                                                                             
 Defined at init/Kconfig:1946
 Selected by [y]:
  - TRACING [=y]
  - BLK_DEV_IO_TRACE [=y] && FTRACE [=y] && SYSFS [=y] && BLOCK [=y]

Should I disable these?

Yes and No. Never disable SYSFS or BLOCK ;-) You did the best thing: Searching with / and checking the dependencies. Yes, you really should disable CONFIG_BLK_DEV_IO_TRACE=y (its very bad). No, you cannot disable TRACING; it is automatically selected by other options. Search with / for it and look which option(s) have selected it. After all related options are disabled you will get TRACEPOINTS disabled too.

sokrovenno wrote:
I do not understand much about firewalls, should I enable it?

Yes and No. It enables ONLY more options (=it will not configure anything in your kernel) ... you MAYBE need if you want configure a FW. If you plan never doing some iptables or nftables stuff, you can disable the COMPLETE Netfilter Configuration menu (because you will never need some of these modules).

sokrovenno wrote:
I'm not sure what should I do with CONFIG_MFD_INTEL_LPSS_PCI. Currently I cannot boot a LiveCD because I'm on vacation and did not bring my USB stick. There is another way to do it? May I can use a kernel-bin or genkernel?

1. Nothing. CONFIG_MFD_INTEL_LPSS_PCI is good (and maybe therefore you dont need ICH).
2. Yes, I always recommend to install first our binary dist-kernel - even if you want configure your kernel (later) yourself ... because you have then always a Backup-Kernel. (I dont recommend genkernel for people who want configure their kernel later)

sokrovenno wrote:
I have a question about modules. Is it really necessary or can I build my kernel with my config=y? I choose config=m just because I followed what the wiki said.
I remember reading about it, but did not really grasped the concept and what it really meant. :oops:

Dont worry. Some options in your kernel configuration allows you to build a module not only static <*> into the kernel, but it can be a (external) <M>odule also. A kernel module is an extra piece of software and NOT loaded into your RAM immediately (you must install the modules with "make modules_install") ... Only when it is necessary. You see all loaded modules with "lsmod". Now the question: When should I build something as <M>odule ? One answer is: If you dont use it every day; e.g. CDROM modules. Another answer is: If you dont know which NETFILTER-modules you need for your firewall then you simply enable EVERY NETFILTER-modul as <M>. After you made your FW you can THEN check with "lsmod" which modules have been really loaded ... with this information you can now disable all unneeded and enable only these. A third reason for modules is: Every BootCD must have a kernel with almost everything enabled ... because it must work on every machine with every CPU ... so in these kernels almost everything is enabled as <M>odule ... and this gives you the chance to check what you really need ... but beware: Some modules are configured also statically into the kernel and you dont see it with "lsmod". An example is PINCTRL (you have already enabled), another example is CONFIG_X86_INTEL_LPSS=y (you have also already enabled == absolutely correct). So, you will need some experience when doing a manually kernel configuration. I have configured all my modules static and therefore I dont need MODULE_SUPPORT in my kernel ... I have a monolithic kernel. Why ? Because it is more secure (read more in KSPP article).

sokrovenno wrote:
Thank you (all) very much for your help.

You are very Welcome ! :D

sokrovenno wrote:
Edit: For some reason I can not understand dracut is being called automatically when I remade the kernel. Does someone knows why?
Edit2: I uninstalled dracut, remade the kernel and got a Kernel Panic at the boot. My old kernel is not booting too. :lol: :cry:

1. This is because of our new https://wiki.gentoo.org/wiki/Installkernel
See also this thread: https://forums.gentoo.org/viewtopic-t-1166976-highlight-.html

2. I guess you are using grub as bootmanager. If this is true, you must know some internal behaviour of grub-mkconfig: If it finds an initramfs it configures the root= parameter in a way that kernel dont understand it. Please read this urgently (in this order):
https://wiki.gentoo.org/wiki/User:Pietinger/Tutorials/Confusion_with_root%3DPARTUUID%3D_and_root%3DUUID%3D
https://wiki.gentoo.org/wiki/User:Pietinger/Tutorials/Kernel_Commandline_Parameter
If you are using a binary dist-kernel THEN I suggest to confiugure your root= INTO your manually configured kernel (Built-in kernel command line) and enable also "Built-in command line overrides boot loader arguments" ... so you never get a problem with grub.

... Another way is ... dont use grub anymore ... https://wiki.gentoo.org/wiki/User:Pietinger/Tutorials/Boot_kernel_via_UEFI ... ;-)
_________________
https://wiki.gentoo.org/wiki/User:Pietinger
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
Goto page 1, 2  Next
Page 1 of 2

 
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