Acid Guide to compiling Kernel 2.6.10 on Slack 10.1
This is a detailed guide to compiling a new kernel version 2.6.10 under a fresh install of Slackware 10.1.
I enjoyed DaOne's little guide and am grateful for his contribution. However, as the total noob I am, in my first kernel compiling experiences I still missed some points I believe some other noobs as me may miss to successfully compiling their new kernel. I am therefore releasing this first 'acid guide' hoping to help out someone, as I was helped by DaOne and various posts' around here. Please do feel free to leave comments on any suggestions / mistakes that you have found in this guide. Forums are all made of this, sharing. General note: I try and keep this Post #1 updated all the time so that there's no need to go through all the inevitable posts with such a topic. However, feel free to read on and give your own feedbacks. Now for the guide part. For the purpose of this guide, I'll use version 2.6.10 which at the moment of this writing is the latest kernel release. Note: even though strictly not necessary, if you are doing a fresh install of Slackware I recommend updating the kernel prior doing anything else, on the first boot after installing Slack (i.e. even before you get the X server configured and running). This is useful since many compiles do rely on the current version of kernel and may need to be reinstalled when upgrading it (for instance, NVIDIA drivers need to be reinstalled after a kernel upgrade). The following are my recommended points to follow. Definitely not exhaustive. One last thing: this worked for me. It doesn't mean that it will work for you. Upgrading a kernel may result in the total mess up of your system (this sound scary: it is however a normal operation done by most linux users; it is here to ensure you are aware of what you are doing). Before you begin, download the necessary files and save them to /etc/src: 1. Get the kernel 2.6.10 sources Slackware 10.1 comes with kernel 2.4.29. You therefore need to download the full sources of the new kernel. You can get them here: linux-2.6.10.tar.bz2 (35MB). This is the .bz2 file format, which is more compressed than the tar.gz one. 2. Get a valid kernel 2.6.10 configuration file At a certain point you will have to configure your kernel. You may start off with a fresh configuration, however I recommend getting a good starting point by downloading Patrick's excellent configuration file: config-2.6.10. Now let's start the operations. Let's move into the /usr/src directory (where you have put the two files here above) and decompress the kernel 2.6.10 source code: Code:
# cd /usr/src Note: as per Linus Thorvalds, there's a philosophy that if it doesn't have to be done as root it shouldn't be, in order to reduce error / hacking risks. You may consider compiling the kernel on your local home directory and then su to root to move the compiled files. However, I somewhat tend to believe that having a symbolic link /usr/src/linux to /usr/src/kernel-2.6.10 might be needed by some applications / installs that look for the kernel source, and therefore the fastest / easiest way to proceed is as described here below. If you didn't understand a single word of this, you may just as well ignore this note. Now, delete the symbolic link 'linux' that is under /usr/src and which points to the old kernel source directory and recreate it to point to the new directory: Code:
/usr/src# rm linux Move into the directory linux: Code:
/usr/src# cd linux Code:
/usr/src/linux# make mrproper Code:
/usr/src/linux# Make menuconfig Here things can get tricky, since the options that you set here must build the kernel according to the system you are running linux on. Read all available help and be sure to have the correct settings. Personally, I setup these three additional things: 1. I have an AMD64 processor, therefore under the processors section I select 'AMD64' and leave 'PC-compatible' as architecture. 2. I use SATA disks, therefore I must ensure that these disks are understood by the kernel at boot time or it will not be able to read from it and I would experience a 'Kernel panic' error. To enable SATA support, under Device drivers->SCSI device support I ensure that I have 'SCSI disk' and 'SCSI generic' selected <*> and not loaded in modules [M]. Also, under SCSI Low Level Drivers, I make sure that 'Serial ATA' is <*>, and I ensure that my chipset support is also enabled here (I enabled NVIDIA chipset support since I have a NFORCE one). This is all done since at boot time modules are not loaded yet, therefore I can't have this support on modules (or, as explained, I wouldn't be able to boot). 3. Also, since I've formatted my disks using ReiserFS, I also want to be sure that at boot time the Kernel is able to read from them. To do so, under File systems I enable Reiserfs support <*>. Thank you db391 for these clues. 4. I have a PS2 mouse, therefore i ensure that under Device Drivers I select all the necessary PS2 and serial port support otherwise my mouse will not work. 5. Finally, I enable ALSA support to allow for my sound card configuration and I ensure to select the driver for my card (SoundBlaster). You may consider in setting this as module <M> instead of compiled into the kernel <*>. If you do believe that you need to make additional changes, do so. Otherwise, quit and, when prompted, save the file leaving the .config name as it is by default. You have now configured your kernel. Now, it's time to build the compressed kernel image using the command: Code:
/usr/src/linux# make -j5 bzImage Afer a certain time it will finish, and you will have the kernel image into the directory /usr/src/linux/arch/i386/boot/ (do not browse there for now, stay into the /usr/src/linux directory). Now let's proceed with compiling and the install of the modules by issuing these 2 commands: Code:
/usr/src/linux# make -j5 modules We will now create a new boot entry for LILO, so that you can boot in your new kernel but keeping the old kernel still available. First, we need to put the freshly generated System.map, .config and the compiled kernel image bzImage into the /boot/ directory. To do so: Code:
/usr/src/linux# mv System.map /boot/System.map-2.6.10 Code:
/usr/src/linux# mv /boot/vmlinuz /boot/vmlinuz-old Code:
/usr/src/linux# pico /etc/lilo.conf You will see at the end of the lilo.conf file the Windows entry of your boot option, and then the Linux one. Do not touch the Windows entry. We will modify the existing Linux entry and add a new one so that the last two entries of this file look like this: Code:
# Slack NEW begins Quit pico by pressing Ctrl-X and say yes to save the file, leave default name unchanged (lilo.conf). Now, let's activate these changes by running lilo: Code:
/usr/src/linux# lilo If you wish, you may remove the existing symbolic links to the old kernel files: Code:
/usr/src/linux# cd /boot Code:
/boot# ln -s System.map-2.6.10 System.map -------------- End of Optional Step ------------- We're almost done. Since kernel version 2.6.xx, the file modules.conf is now substituted by the file modprobe.conf, which you normally shouldn't have already, or if you do, it might just as well be empty. to see if you have it or if it is empty, type: Code:
/boot# pico /etc/modprobe.conf Code:
/boot# rm /etc/modprobe.conf Now let's create a good file from the new kernel: Code:
/boot# generate-modprobe.conf /etc/modprobe.conf Code:
mkdir /sys Enjoy. Acid Juice. |
you might tell people that you put pico editor on yourself since it is not included in Slackware at all.............
I guess VI is not good enough for you........... |
pico (or actually a link to nano) is on all of my Slackware machines which were originally installed as 9.x and 10.0
Kernel 2.4.39 by default? I think that you meant 2.4.29 |
320mb: as per davidsrsb post here above, so is on my machine, on a fresh install... btw no need to be so harsh on me i'm just trying to help here :) and i guess vi is less immediate for noobs. just an opinion.
Quote:
|
Quote:
Thanks for taking the time to post such a nice thread =) It's nice when people give back to the community. |
Pico is only installed in Slackwar if you install PINE (the email program). An alternative, if you don't want Pine, is to track down and install Nano. As another alternative, just use whatever console based text editor you are comfortable with.
|
Quote:
|
May i add that there are much easier ways in doing all of this? as discussed in the "kernel compile guide for 2.6.0" ...
|
xushi is there something in particular you are thinking of?
|
Also, there is no need to add
none /sys sysfs defaults 0 0 ...in fstab, just create a /sys dir if it does not exists, the /etc/rc.d/rc.S script will mount it for you : Code:
cat /etc/rc.d/rc.S : |
Quote:
|
Quote:
From what i've tried, it's much easier to just edit the Makefile and uncomment "export INSTALL_PATH=/boot" somewhere around line 450. This will save you the trouble of moving everything into /boot, and backing up the older stuff.. For more information about that, just check out both the guides on the top of the forum (2.4 and 2.6). Keep up the good work. EDIT: ============== It's better to backup the old kernal and system.map into Lilo (say as MyKernel.old), instead of removing it. Just incase your new kernel does not work for some reason (and you will get into that problem at some point), you can always chose the last configured kernel and fix the problems, compile again, etc... |
acidjuice - when you have (or think you have) a complete and finalised guide, could I ask you to submit it to the Linux Tutorial section?
|
For simplicity, some could create a /sbin/installkernel script
which contains the kernel install steps I discovered this feature with doing make help So after a /sbin/installkernel script created, you just run make install and it will run your script instead of the default make install procedure |
well...some remarks....
------------ /usr/src# rm linux /usr/src# ln -s linux-2.6.10 linux ------------ that link is never used, you don't need it. ------------ /usr/src/linux# cd /boot /boot# rm System.map /boot# rm config /boot# rm vmlinuz /boot# ln -s System.map-2.6.10 System.map /boot# ln -s config-2.6.10 config /boot# ln -s vmlinuz-2.6.10 vmlinuz -------------- i also think those links are not used, as you edit lilo.conf. egag |
All times are GMT -5. The time now is 04:08 PM. |