Compilng Kernel 2.6.20.6
Sorry for the length of the post as i would like to provide the maximum possible detail.
I am using Slackware 11.0 withe the default kernel 2.4.33.For many days i have been thinking about compiling a custom kernel. So finally i mustered enough courage,did enough homework and then downloaded the latest stable release 2.6.20.6. Here are the steps i followed to install the kernel: 1)Created a directory by the name linux in my home directory and extraced the kernel source there. me@battleaXe:~/linux$ tar -xvjf linux-2.6.20.6.tar.bz2 2)This created a directory linux-2.6.20.6 and then i used: me@battleaXe:~/linux$ cd linux-2.6.20.6 3)make defconfig(This created a defautl .config file) 4)make menuconfig(I used this to make changes into the default .config file generated)and then saved thses changes into .config file. 5)make 6)su(i.e then i changed to root) 7)make modules_install 8)make install And then i did a reboot.Everything Works i.e sound network card,pendrive etc and moreover its quite fast. But i need to ask certain questions to clear some doubts.They are as follows: Q1)One of the reasons for compiling a new kernel was that I wanted that when i halt my computer using shutdown -h now or halt command it should turn off automatically without any need to press the power button.(in my 2.4.33 kernel i had uncommented the line /sbin/modprobe apm since i read about this somewhere but it didn't help so i thought may be kernel 2.6 can help)But still it doesn't turn off automatically although i have enabled apm during menuconfig program. So how to do this ? 2)Previously when i used to issues lsmod command there used to be a long list of modules but now it doesn't show any modules(even though i have made certain things as modules during menuconfig) Is there a problem(all my h/w is working though i.e pendrive ,sound,nic etc) 3)Also i want to know that although this procedure has just installed a new kernel 2.6.20.6 but my old kernel files are still there and do i need to remove them and if yes how? 4)The rc.modules-2.4.33 script in rc.d directory is still there and so is rc.modules script(which is a link to rc.modules-2.4.33) why is it still there? ? my kernel is now 2.6.20.6 and there is no script as 2.6.20.6-modules in rc.d directory. 5)The most important question is that the procedure that i have followed is this the correct one? I mean i am still a n00b and i have read Slackware Linux Essentials(it shows another method to compile and i found that book really waste no details nothing!!!) i also read the kernel compile guide in this forum and also read the book Linux kernel in a nutshell before starting off. 6)What is a vmlinuz file and what is bzImage.What is the final kernel image after make ? 7)What does make install does and how to manually install the kernel witouth issuing the make install command ? A book was referring about installkernel script being in all distributions and if its not there you need to manually install the kernel so thats why i asked this question. My concepts are still not clear. Kindly throw some light. thank you for your patience This forum rocks!!! |
Q1) But still it doesn't turn off automatically although i have enabled apm during menuconfig program. So how to do this ?
Have you made sure it's enabled in the BIOS? Did you read the config notes (help button) for both APM and ACPI about this? When you do lsmod do you see "button"? At least I think that's the module. 2)Previously when i used to issues lsmod command there used to be a long list of modules but now it doesn't show any modules It sounds like you didn't compile anything as a loadable module, but rather as a built-in. 3)Also i want to know that although this procedure has just installed a new kernel 2.6.20.6 but my old kernel files are still there and do i need to remove them and if yes how? Leave them!!!!! You do NOT want to be in the situation where a new kernel won't do X and you need it, but an old kernel did but you no longer have it. Standard advice - always leave the kernel that came with the installation on the system. 4)The rc.modules-2.4.33 script in rc.d directory is still there and so is rc.modules script(which is a link to rc.modules-2.4.33) why is it still there? ? my kernel is now 2.6.20.6 and there is no script as 2.6.20.6-modules in rc.d directory. You worry too much. "A book was referring about installkernel script being in all distributions and if its not there you need to manually install the kernel so thats why i asked this question." Again, you worry too much. Your distro clearly has it so this is only an academic question for you. Deal with it when you need it at this point. Edit: removed a large block of OP post that I didn't mean to include |
I wrote my own installkernel script. It does NOT change lilo settings tho ... cuz I use grub.
Code:
#!/bin/sh |
Thanks For reply
Thanks a lot for your reply and patience to read the post.
Well i don't worry much but only keen to seek knowledge about the intricacies of Linux :) After wasting 3 years at Windows the only thing i learned about an OS was left click and double click(lol).Slackware really rocks as its learning curve is steep. So thats why i wanted to clear my doubts. Can any one provide information about the last questions i.e which are in bold font thanks again |
H_TeXMeX_H wrote: "I wrote my own installkernel script."
Guys guys! Switch to debian and leave this sort of stuff to the professionals. LOLOL j/k |
Quote:
Quote:
Quote:
Quote:
Quote:
|
Quote:
vmlinux is the uncompressed version of the linux kernel image, at least the one that is generated in the kernel source directory. bzImage is like vmlinux.bz2, only it's called bzImage, it is a compressed version of the linux kernel image. Often, this is renamed to vmlinuz and works just the same as the uncompressed one, but is uncompressed on-the-fly. 7) see my stript above ... then edit '/etc/lilo.conf' and run '/sbin/lilo'. Oh, and the script was meant to be run from the kernel source directory (obviously). EDIT: vmlinux is uncompressed and vmlinuz is compressed as ok020969 says below. ... and they expect me to notice one letter change ... :( |
Wow
Thank You Quakeboy02 ,H_TexMex_H & Sonneeteer
I really appreciate and i am humbled by your spirit of helping newbies like me and there contributing to the Linux community. Thank You everyone !!! |
Ok nice long post to answer after a loong time. :)
As I have lotsa free time ... here goes ... Quote:
Quote:
The best thing is the following (by ErikM on #kernelnewbies) You change grub to power off. Then change your shutdown script so that it will first change your grub-default to the powerOff label. Then it will restart your comp/ e.g menu.lst Quote:
The PowerOFF label changes the default back to linux and then switches off the comp. Quote:
Quote:
Quote:
Quote:
Quote:
IIRC, in todays comp, the compressed image is faster than the normal one.. cos the bottleneck is the HDD and not the processor (processor is much faster). Quote:
Quote:
Quote:
|
Quote:
Can you explain what that means i.e how can we load and unload modules on the fly(what does on the fly means anyway ) ? i guess we can do that even in 2.4 kernel also by using modprobe ?(correct me if if am wrong) Also 1 thing more previously when i used to run alsaconf it detected my sound card but now it doesn't (although my sound is working) But i am unable to use alsamixer command(which i was able to use in 2.4.33) to configure sound The error its shows is "snd_ctl ..... device not found" The error i wrote is not the exact it says(right now i am on XP in college lab and cannot exactly remember the error) There's one more thing i want to ask what more tweaking can i do with the kernel so as to learn more b'coz i intend to compile kernel 2 -3 times more(i am getting a new hdd and will have to do a complete reinstall of Slackware 11) So kindly guide me what more tweaking should i do with the system and kernel so as to learn more. Thank you all |
Quote:
vmlinuz and bzImage are just the same thing - compressed kernel image. AFAIK "make" makes bzImage. And vmlinuz-* is the usual name for slackware pre-compiled kernels. It's just a tradition to name them vmlinuz-*, not bzImage-* :) WBW, Oleg |
Quote:
To compile a part of kernel as a module you should set the letter M instead of * in that field between square brackets (if you use menuconfig). Quote:
Quote:
Maybe I'm lazy, but most painless kernel compilations I did was those I got standard slackware .config for and tweak just some things I needed. If you plan to configure kernel "from scratch" you have to RTFM really alot (this is not bad but you need time). BTW, there should be some way - very IMHO :), just a theory. get kernel, unpack to /usr/src/linux-yourversion cd /usr/src/linux-yourversion cp /boot/config-generic-2.6.17.13 ./.config make oldconfig (you will need do answer some questions, but I hope _not_as_many_ as "from scratch") make menuconfig (tweak what you need) make make modules_install (i can't remember exact spelling) BTW-2:to install new kernel (presuming you're still in kernel src dir): su (you really need root privileges to install kernel! some writer above was wrong) cp arch/i386/boot/bzImage /boot/vmlinuz-20070415 (or whatever name you like :) ) (I also do 2 more things - I don't know about System.map, but as for .config, this is useful) cp System.map /boot/System.map-20070415 cp .config /boot/config-20070415 (then - before running /sbin/lilo !!! - you need to edit lilo.conf) vi /etc/lilo.conf (just copy another "vmlinuz" block and change names to your kernel's) (don't forget to change label! - the name of your new section) /sbin/lilo - then reboot. BTW-3:And some note about APM/ACPI - computers I used tend to work right with ACPI-only config, with APM switched off! I mean kernel config. This always turns power off automatically. I also may use power button safely. WBW, Oleg |
Thank you ok020969
Quote:
How to do that,do you mean i have to compile the kernel again(i'm ready anyway).Also how to load the modules(i guess using modprobe?) But how do i know what parts i have made modules(should i check /lib ? or is there another way ?) And how to compile sound as modules ?(Kindly provide some help :)How can i use alsamixer again and why is alsaconf not recognising my sound card ?(which earlier it used to) Also you referred to Quote:
Also what do you mean by RTFM(is it refer the forum ???) and IMHO (hope this question is answered as well :-)) One more thing please refer to my steps 3 and 4 i have used 3)make defconfig and 4)make menuconfig defconfig is for making a default configuration? and menuconfig is for changing that default configuration ? right? But i didn't find any file defconfig in the source directory(does the default configuration changes with each kernel i mean does kenel 2.6.19 and kernel 2.6.20 have different default configs?) Is any of my 3 and 4 step redundant ? I would also heartly like to thank everyone in this forum(You people provide provide real time help i guess lol).Really i never hoped that people can be so helpful. Thank you all once again |
Quote:
Quote:
Quote:
or fire "make menuconfig" again and see it in the tree. Quote:
Quote:
- In My Humble Opinion You really need to read many - no other way to get things done :(, even this forum isn't. Good notes about kernel modules/parts is subdir "Documentation/" in your kernel src tree. Other docs are under /usr/doc or /usr/share/doc. They're more fine than f***ing ;) Quote:
WBW, Oleg P.S. Why you started to compile new kernel? AFAIR (as far as I remember:) you didn't get soft poweroff? Try to use "bareacpi" kernel, maybe you don't need all this complete stuff. P.P.S. As I've seen in Slackware-current Changelog at http://www.slackware.com/changelog/current.php?cpu=i386, Pat uses kernel 2.6.18.8 now. May be you jump too far trying to compile 2.6.20.x Parts of Linux are not so independent :) as some people think (I thought for ex.) |
Quote:
One more thing please refer to my steps 3 and 4.there i have used 3)make defconfig and 4)make menuconfig defconfig is for making a default configuration? and menuconfig is for changing that default configuration ? right(correct me if iam wrong)? I read somewhere(Book=Linux kernel in nutshell) that this is the configuration that the kernel maintainer uses himself for his personal machines and they say for i386 architecture the default kernel configuration matches with what Linus torvalds uses for his machine But i didn't find any file defconfig in the source directory.(i didn't try much though may be its there, right now i am on windows at college lab or i would have done it now). Is any of my 3 and 4 step redundant ? |
All times are GMT -5. The time now is 04:45 PM. |