Linux/Tipps/Gentoo/Kernel: Unterschied zwischen den Versionen

 
(34 dazwischenliegende Versionen desselben Benutzers werden nicht angezeigt)
Zeile 19: Zeile 19:
===Mit genkernel===
===Mit genkernel===
Auf Basis der Config des laufenden Kernels:
Auf Basis der Config des laufenden Kernels:
  genkernel all
  genkernel --microcode --kernel-config=.config --no-clean --makeopts=-j5 all
Mit völlig neuer generischer Config:
Mit völlig neuer generischer Config:
  genkernel --kernel-config=/usr/share/genkernel/x86/kernel-config-2.6 all
  genkernel --microcode --kernel-config=/usr/share/genkernel/x86/kernel-config-2.6 --makeopts=-j5 all


===Ohne genkernel===
===Ohne genkernel===
Zeile 33: Zeile 33:
* per Hand/Editor oder "make menuconfig" und anschließend "genkernel --no-clean all"
* per Hand/Editor oder "make menuconfig" und anschließend "genkernel --no-clean all"
oder
oder
* genkernel --no-clean --menuconfig all
* genkernel --kernel-config=.config --no-clean --menuconfig all
Wenn ein Splashscreen verwendet wird, muss auch noch "--splash=<THEME>" und optional "--splash-res=1024x768" angegeben werden.
Wenn ein Splashscreen verwendet wird, muss auch noch "--splash=<THEME>" und optional "--splash-res=1024x768" angegeben werden.


Zeile 54: Zeile 54:
===Compilieren===
===Compilieren===
====Mit genkernel====
====Mit genkernel====
  genkernel --oldconfig all
make oldconfig
Falls die '''.config''' selbst modifiziert wurde, muss genkernel mit '''--oldconfig''' aufgerufen werden, sonst wird eine Standardkonfiguration verwendet.
  genkernel --kernel-config=.config --no-clean all
 
Mir 4 CPUs:
genkernel --kernel-config=.config --no-clean --makeopts=-j5 all


Wenn ein Splashscreen verwendet wird, muss auch noch "--splash=<THEME>" und optional "--splash-res=1024x768" angegeben werden.
Wenn ein Splashscreen verwendet wird, muss auch noch "--splash=<THEME>" und optional "--splash-res=1024x768" angegeben werden.
Zeile 74: Zeile 77:
===Bootmenü===
===Bootmenü===
Dann '''/boot/grub/menu.lst''' erweitern und neu booten.
Dann '''/boot/grub/menu.lst''' erweitern und neu booten.
==Module automatisch laden==
Seit Baselayout2/OpenRC wird das in '''/etc/conf.d/modules''' eingestellt:
modules_2_6="${modules_2_6} lirc_serial"
module_lirc_serial_args_2_6=""
modules_2_6="${modules_2_6} powernow_k8"
module_powernow_k8_args_2_6=""
modules_2_6="${modules_2_6} vboxdrv"
module_vboxdrv_args_2_6=""
modules_2_6="${modules_2_6} vboxnetflt"
module_vboxnetflt_args_2_6=""
==Migration auf Kernel 3.x==
Um Module automatisch zu laden muss '''3_0''' statt '''2_6''' in '''/etc/conf.d/modules''' verwendet werden.


=Wichtige Kernel-Optionen=
=Wichtige Kernel-Optionen=
Wenn man '''genkernel''' die Kernel-Config erzeugen lässt, dann sind die meisten Optionen schon aktiviert.
Wenn man '''genkernel''' die Kernel-Config erzeugen lässt, dann sind die meisten Optionen schon aktiviert.


==Prozessor==
==Prozessor-Typ==
Auf jeden Fall sollte man den Prozessor-Typ einstellen.
Man sollte den Prozessor-Typ einstellen.


Unter '''Processor type and features -> Processor family''' die richtige Prozessor-Familie wählen.
Unter '''Processor type and features -> Processor family''' die richtige Prozessor-Familie wählen.
==Prozessorhersteller==
Der richtige Prozessorhersteller '''muss''' aktiviert sein (weitere schaden nicht), sonst bootet der Kernel evtl. nicht oder stürzt beim Initialisieren ab!
* CONFIG_PROCESSOR_SELECT: '''Processor type and features -> Supported processor vendors''' = y
* CONFIG_CPU_SUP_INTEL: '''Processor type and features -> Supported processor vendors -> Support Intel processors''' = y
* CONFIG_CPU_SUP_AMD: '''Processor type and features -> Supported processor vendors -> Support AMD processors''' = y


==Allgemeine Optionen==
==Allgemeine Optionen==
Zeile 87: Zeile 114:


==Audio (ALSA)==
==Audio (ALSA)==
Siehe http://www.gentoo.org/doc/en/alsa-guide.xml#doc_chap2_pre3.
Allgemeines siehe http://www.gentoo.org/doc/en/alsa-guide.xml#doc_chap2_pre3.
 
Erweiterte procfs Einstellungen:
* CONFIG_SND_VERBOSE_PROCFS: '''Device Drivers -> Sound card support -> Advanced Linux Sound Architecture -> Verbose procfs contents''' = y


==Optimierung für Desktop==
==Optimierung für Desktop==
Zeile 184: Zeile 214:
* CONFIG_RTC_DRV_CMOS: '''Device Drivers -> Real Time Clock -> PC-style 'CMOS'''' = y
* CONFIG_RTC_DRV_CMOS: '''Device Drivers -> Real Time Clock -> PC-style 'CMOS'''' = y
* CONFIG_HPET_EMULATE_RTC: y (wird von menuconfig automatisch gesetzt)
* CONFIG_HPET_EMULATE_RTC: y (wird von menuconfig automatisch gesetzt)
Weitere Infos: http://wiki.debianforum.de/KernelTimer
==Filesystem in Userspace (FUSE)==
* CONFIG_BLK_DEV_LOOP: '''Device Drivers -> Block devices -> Loopback device support''' = y
* CONFIG_MD: '''Device Drivers -> Multiple devices driver support (RAID and LVM)''' = y
* CONFIG_BLK_DEV_DM: '''Device Drivers -> Multiple devices driver support (RAID and LVM) -> Device mapper support''' = m
* CONFIG_DM_CRYPT: '''Device Drivers -> Multiple devices driver support (RAID and LVM) -> Crypt target support''' = m
* CONFIG_FUSE_FS: '''File systems -> FUSE (Filesystem in Userspace) support''' = y
==Staging-Treiber von lirc aktivieren ab Kernel 2.6.36==
* CONFIG_MEDIA_SUPPORT: '''Device Drivers -> Multimedia support''' = y
* CONFIG_RC_CORE: '''Device Drivers -> Multimedia support -> Remote Controller adapters''' = y
* CONFIG_STAGING: '''Device Drivers -> Staging drivers''' = y
* CONFIG_STAGING_MEDIA: '''Device Drivers -> Staging drivers -> Media staging drivers''' = y
* CONFIG_LIRC_STAGING: '''Device Drivers -> Staging drivers -> Media staging drivers -> Linux Infrared Remote Control''' = y
* CONFIG_LIRC_SERIAL: '''Device Drivers -> Staging drivers -> Media staging drivers -> Linux Infrared Remote Control -> Homebrew Serial Port Receiver''' = m
==Suspend-To-RAM und Hibernate==
* CONFIG_SUSPEND: '''Power management and ACPI options -> Suspend to RAM and standby''' = y
* CONFIG_HIBERNATION: '''Power management and ACPI options -> Hibernation (aka 'suspend to disk')''' = y
Für Hibernate muss eine Swap-Partition existieren, die mindestens so groß wie das RAM ist. Verwendet wird die erste gefundene. Für Resume muss diese bei den Kernel-Optionen in der Grub-Config angegeben werden, z.B.:
resume=/dev/sdb1
Falls der PC nach Hibernate manchmal oder immer nicht ausgeschaltet wird muss evtl. bei jedem Booten diese Zeile ausgeführt werden (z.B. in '''/etc/local.d/baselayout1.start'''):
echo shutdown > /sys/power/disk
==Firmware-Patch für RTL8111/8168B Netzwerkchip==
emerge sys-kernel/linux-firmware
* CONFIG_EXTRA_FIRMWARE: '''Device Drivers -> Generic Driver Options -> External firmware blobs to build into the kernel binary''' = rtl_nic/rtl8168e-3.fw
* CONFIG_EXTRA_FIRMWARE_DIR: '''Device Drivers -> Generic Driver Options -> Firmware blobs root directory''' = /lib/firmware
==Logitech Unifying Receiver==
* CONFIG_USB_HIDDEV: '''Device Drivers -> HID Devices -> /dev/hiddev raw HID device support''' = y
'''oder'''
* CONFIG_HIDRAW: '''Device Drivers -> HID Devices -> /dev/hidraw raw HID device support''' = y
Außerdem:
* CONFIG_HID_LOGITECH: '''Device Drivers -> HID Devices -> Special HID drivers -> Logitech devices''' = y
* CONFIG_HID_LOGITECH: '''Device Drivers -> HID Devices -> Special HID drivers -> Logitech Unifying receivers full support''' = m
==PAE (Physical Address Extension)==
* CONFIG_HIGHMEM64G: '''Processor type and features -> High Memory Support 64GB''' = y
* CONFIG_X86_PAE: '''Processor type and features -> PAE (Physical Address Extension) Support''' = y
==Namespaces (benötigt für die Sandbox von Chrome/Chromium)==
* CONFIG_NAMESPACES: '''General setup -> Namespaces support''' = y
* PID_NS: '''General setup -> Namespaces support -> PID Namespaces''' = y
* NET_NS: '''General setup -> Namespaces support -> Network namespace''' = y
==High Resolution Timer==
* CONFIG_HIGH_RES_TIMERS: '''General setup -> Timers subsystem -> High Resolution Timer Support''' = y
==Crypto XTS support ==
* CRYPTO_XTS: '''Cryptographic API -> XTS support''' = y
== Microcode patches for Spectre ==
See also https://wiki.gentoo.org/wiki/Project:Security/Vulnerabilities/Meltdown_and_Spectre and https://wiki.gentoo.org/wiki/Intel_microcode and https://www.heise.de/security/meldung/Spectre-Luecke-Intels-Microcode-Updates-fuer-Linux-und-Windows-3994347.html.
Check processor and microcode version (before and after changes):
dmesg | grep microcode
Install microcode and tool:
emerge --ask --noreplace sys-firmware/intel-microcode sys-apps/iucode_tool
Generate microcode for kernel (do after each update of intel-microcode):
iucode_tool -S --overwrite --write-earlyfw=/boot/early_ucode.cpio /lib/firmware/intel-ucode/*
Enable kernel options:
* CONFIG_BLK_DEV_INITRD: '''General setup -> Initial RAM filesystem and RAM disk (initramfs/initrd) support''' = y
* CONFIG_MICROCODE: '''Processor type and features -> CPU microcode loading support''' = y
* CONFIG_MICROCODE_INTEL: '''Processor type and features -> Intel microcode loading support''' = y
Need newer genkernel for '''--microcode''' option, so have to add this to '''/etc/portage/package.keywords''':
=sys-kernel/genkernel-3.5.1.1
Install newer genkernel:
emerge --ask genkernel
Create new kernel with microcode update:
genkernel '''--microcode''' --kernel-config=.config --no-clean --makeopts=-j5 all
1.075

Bearbeitungen