Instalarea kernelului 2.6.22.x (Slackware 12.0)
From linux360
Acest tutorial prezintă instalarea din surse a unui kernel 2.6.22.x în distribuția Slackware 12.0. Informațiile au fost testate pentru kernelul 2.6.22.5 și 2.6.22.9.
Atenționare: Nu recomand utilizarea acestui tutorial dacă nu înțelegeți exact ce reprezintă fiecare etapă și cum trebuie parcursă corect, în concordanță cu particularitățile instalării distribuției Slackware Linux 12.0 pe calculatorul dumneavoastră.
Nu uitaţi că primul CD (DVD-ul) distribuţiei poate fi folosit şi ca "Rescue CD/DVD" - bootaţi calculatorul de pe CD/DVD şi tastaţi:
hugesmp.s root=/dev/hda3 rdinit= ro
unde "hda3" este partiţia pe care aţi instalat distribuţia Slackware Linux 12.0.
Contents
Introducere
- Configurația inițială
Distribuția Slackware Linux 12.0 a fost instalată cu opțiunea "full", cu imaginea de kernel hugesmp.s. Am folosit sistemul de fișere reiserfs. Așa cum este recomandat în CHANGES_AND_HINTS.TXT, ANNOUNCE.12_0 și RELEASE_NOTES, am trecut de la kernelul huge-smp la kernelul generic-smp astfel:
- /cd boot
- mkinitrd -c -k 2.6.21.5-smp -m reiserfs
Fișierul inițial /etc/lilo.conf este:
(...)
Linux bootable partition config begins
image = /boot/vmlinuz-generic-smp-2.6.21.5-smp
initrd = /boot/initrd.gz root = /dev/hda3 label = Slackware read-only # Partitions should be mounted read-only for checking
Linux bootable partition config ends (...)
- Descărcarea kernelului
Am folosit arhiva kernelului 2.6.22.9, descărcată de pe site-ul oficial al GNU/Linux Kernel.
wget ftp://ftp.kernel.org/pub/linux/kernel/v2.6/linux-2.6.22.9.tar.gz
- Verificarea autenticității arhivei descărcate
$ gpg --keyserver wwwkeys.pgp.net --recv-keys 0x517D0F0E
$ gpg --verify linux-2.6.22.9.tar.gz.sign linux-2.6.22.9.tar.gz
- Despachetarea arhivei
tar -zxvf ~/linux-2.6.22.9.tar.gz
Configurarea kernelului
- Copierea arhivei în /usr/src/
Există o controversă privind instalarea kernelului în /usr/src. Nu voi intra în detalii, așa că
mv ~/linux-2.6.22.9 /usr/src/linux-2.6.22.9
- Crearea unei legături simbolice către sursele noului kernel
cd /usr/src/
rm /usr/src/linux
ln -s /usr/src/linux-2.6.22.9 linux
Construirea kernelului
- Copierea unui fișier .config în sursele noului kernel
cp /boot/config /usr/src/linux/.config
cd /usr/src/linux
- Rularea comenzii
Run make oldconfig in the kernel source directory so that the defaults are used from the .config file you just installed. Because your kernel sources are probably newer than the .config, there will be new options to choose from. You will only have to answer these (press ENTER for the default answers which are mostly fine, or M to build new drivers as modules).
make oldconfig
- Alte modificări
You now have configured a pretty generic kernel (that is the reason why Pat calls them “kernel-generic” probably :-) but you will want to change some of the defaults to suit your needs. Run the X based configurator (if you do not run X but are at a text console, just run “make menuconfig” to get the curses-based dialog program instead)
make xconfig
Walk through the forest of options. What I usually change are things like:
- build the ext3 (needs the jbd driver as well) and reiser fileystem drivers into the kernel instead of compiling them as modules - I do not need to create an additional “initrd” then
(see under “Filesystems” in the configurator).
- enable support for dual procesessors and hypertreading - naturally this only helps if you have a HT Intel CPU, or a dual-CPU board or a dual-core CPU
(under “Processor type and features” > “Symmetric multi-processing support”).
- enable 4GB of RAM. The Slackware default setting is to only support ~800 MB of your RAM, so any additional installed RAM is never used!
(under “Processor type and features” > “High Memory Support (4GB)”).
- enable the “low-latency” kernel if you run a desktop/laptop computer - multimedia apps will run much smoother
(under “Processor type and features” > “Preemption model” > “Preemptible kernel”).
- set a 1000Hz timer (under “Processor type and features” > “Preemption model” > “Timer frequency”).
- ... and more I can’t think of right now. You can decide to disable a lot of the modules that the default config will build, to cut down on time, if you don’t have the hardware in your computer. You could also looka at software suspend and CPU frequency scaling (under “Processor type and features”) if you own a laptop.
And finally save your configuration if you’re satisfied.
- Now, start the build of kernel and modules, and install them to the proper places.
make bzImage
make modules
make modules_install
cp arch/i386/boot/bzImage /boot/vmlinuz-2.6.22.9-smp
cp System.map /boot/System.map-2.6.22.9-smp
cp .config /boot/config-2.6.22.9-smp
Modificarea /etc/lilo.conf
- initrd (nu este obligatoriu, dar este recomandat)
cd /boot
mkinitrd -c -k 2.6.22.9-smp -m reiserfs
- Modificarea lilo.conf
mcedit lilo
- Linux bootable partition config begins
image = /boot/vmlinuz-2.6.22.9-smp
initrd = /boot/initrd.gz root = /dev/hda3 label = Slackware read-only # Partitions should be mounted read-only for checking
- Linux bootable partition config ends
- Cleaning and reboot
cd /usr/src/linux
make clean
reboot
uname -a Linux MyLinuxBox 2.6.22.9-smp #1 SMP PREEMPT Fri Sep 28 17:54:30 EEST 2007 i686 AMD Sempron(tm) Processor 2500+ AuthenticAMD GNU/Linux
Reinstalarea modulelor
Now, with the installation of your new kernel, you will lose these modules, and you have to recompile the sources so that the binary modules match the new kernel. You can get an overview of all packages that have installed a kernel module for your current kernel by running this command (i.e. you must run this command while still running your old kernel):
cd /var/log/packages grep -l "lib/modules/`uname -r`" *
gspca /usr/bin/./vmware-config.pl sh ./NV*.run