Kernel Compile help
Hello. I 'm using slackware 12 and i want to complie a new kernel. I dont have idea how to so i am looking for some full instructions that will help me to compile. I found this link but i dont know if somethings has change.so if u have a better guide feel free to post it:) i dont want to mess up my system again :cry:
|
It's an excellent guide, and you can use it with a new version of kernel.
The only difference is, you won't be able to get a complete config file to start with. Which kernel are you compiling? |
|
Hi,
Welcome to Slackware! Quote:
This link and others are available from 'Slackware-Links' . |
Quote:
The Linux Kernel in a Nutshell book is correct, and I agree with TSquaredF -- it's very good. It's author, Greg Kroah-Hartman, is a present Linux kernel developer. The author of that guide you posted is not. I recommend that you download this book, study it before, and use it as you recompile your kernel. Read and follow the directions of the README file that comes with the kernel source ... located in ./linux-x.x.x/README after you unpack the new source. It is really very simple to build, configure, and install a kernel from the normal users home directory. Here's my very simple kernel rebuild guide that works, and I'm going to do just this on a fresh install of Slackware-12.0 on my test box as I type for you ... Download the latest stable kernel source (2.6.24) from the mirror nearest you. As per Linus Torvalds, and Greg Kroah-Hartman's, instructions make a directory somewhere under your /home/<username> directory to build the kernel. I use /home/mingdao/kernel/ -- you can create it while in your home directory just issue "mkdir kernel". The move your kernel source to there ... i.e., "mv linux-2.6.24.tar.bz2 kernel/" from wherever you downloaded the source. Then change to that directory with "cd kernel/" and untar the source by issuing "tar xvjf linux-2.6.24.tar.bz2". Then change to that directory by issuing "cd linux-2.6.24" You can start with the kernel .config file you're using in your present Slackware kernel. Now that you're in the directory for your kernel source, just issue "cp /boot/config .config" and you will copy the config file from your present kernel into that directory as .config. Now the easiest way to go from here IMO, if you've never rebuilt a kernel, is to issue "make xconfig". That's going to give you a nice looking GUI where the options and information about them can be easily seen. Since you have used the .config file from your present working kernel, everything you have working in your system will be there. This is the point where you want to use the information in the Linux Kernel in a Nutshell book. NB: Building your kernel this way, and under the user's home directory, you can keep running your system with nothing to worry about. You don't start X as root or anything and you're not going to even use root until you INSTALL the kernel. That's the only time you'll need root privileges. After you finish making your choices for the new kernel, save that file from the menu, then close the xconfig window. Now, still as a normal user, issue "make" -- that will take some time. After it finishes, you need to su to root. Issue "su" and then enter root's password. You should still be in the /home/mingdao/kernel/linux-2.6.24/ directory (except your username and not mingdao). Now you have just a few steps to do as root. First, issue "cp System.map /boot/System.map-2.6.24 ; ln -sf /boot/System.map-2.6.24 /boot/System.map" to copy the System.map file to /boot as System.map-kernel-version and update the /boot/System.map symlink. Then issue "make modules_install" to install the modules. Now copy the kernel itself to /boot under some new name, like so: "cp arch/i386/boot/bzImage /boot/vmlinuz-2.6.24" NB: In the configuring of your kernel, if you include support for your root filesystem and hard disk controller as built-in (Y or a check mark), rather than as a module (M or a dot), then you don't need an initrd image. If you have the support for your root filesystem or controller as a module, you should also build an initial ram disk image (initrd). To do this, change to the /boot directory by issuing "cd /boot" and follow the instructions in the file "README.initrd" before proceeding to the next step. You have now configured, built, and installed you new Linux kernel. Now you need to edit the bootloader so it will be available when you reboot. Use the editor of your choice -- mine is vim. Replace vim with your editor, and issue "vim /etc/lilo.conf" and add the following lines: Code:
image = /boot/vmlinuz-2.6.24 NB: You must replace sda6 with the partition of your root filesystem. It will already be there in your /etc/lilo.conf from the default install. One more thing we must do to finish ... we must issue "lilo" to reinstall the bootloader. Now you should be able to reboot and select either your old kernel or the new kernel, so if the one you just built won't boot, you can boot into your old kernel and fix whatever is wrong with your new kernel. Always keep a working kernel in place. It doesn't neccessarily have to be the kernel you installed with, but that one is always left in place on my systems. I think it's good practice, because it's using the original kernel headers and glibc your system was built with. This was followed, copying and pasting, to recompile a kernel for my test system. Here's some info: Code:
mingdao@james:~$ ls -l /boot/ |
If you ever want to work with kernel sources that are already installed under /usr/src you can do this as a normal user, but you need to specify some more args during the build process.
Here's an exert from the kernel README Code:
BUILD directory for the kernel: When using a .config from an older kernel version I usually make oldconfig. I am not completely sure if it is necessary (someone please verify this), but I was always under the impression that it was a good idea if using a .config from a much older kernel version. I prefer using make menuconfig for configuring kernels. |
Quote:
Brian |
Quote:
|
Originally posted by shadowsnipes
Quote:
Originally posted by shadowsnipes Quote:
First, from the kernel source README file: Code:
mingdao@silas:~/kernel/linux-2.6.24$ less README Second, using my 2.6.13.4 kernel config file on my laptop from Oct 10, 2005, I ran "make xconfig" and "make oldconfig" and "make menuconfig" on fresh 2.6.24 source. I did not change any options on them, and saved them so that you can diff the files. They are ALL exactly the same, and have all the options you'd get if you ran "make config" and generated and entirely new .config file. Here are those three files for you to diff: You will notice that nothing is different in those three files except the date. If I were going to use something other than the X windows based options, it would be preferable to use "make silentoldconfig". I particularly like the X windows based options because they give you a screen with all the kernel options and their associated HELP on the same screen. There's no need to get help by pressing "Shift+?" like you have to do with all the text based make options. My preference is also xconfig rather than gconfig because it's laid out better and looks nicer (IMO). |
please backup your reproof
Originally posted by BCarey
Quote:
If you see something in my guide or post that is incorrect, please supply some evidence to back up your supposition. |
Quote:
Thanks for verifying this. For some reason I had had this belief that make oldconfig not only just shows you the new options, but also reorganizes the config file in a certain way so that it still works. Apparently, others must do this as well. What would be really nice is if menuconfig and xconfig made the new options stand out even more. Maybe if there was an option to have all the old config options grayed out it would be even easier to quickly scan for new options. Alternatively, or in addition, there could be a separate section for just the NEW config options. |
Originally posted by shadowsnipes:
Quote:
Code:
"make oldconfig" Default all questions based on the contents of |
Quote:
|
Quote:
Code:
mingdao@silas:~/kernel/linux-2.6.24$ make silentoldconfig Maybe you just wanted the ncurses (is that what menuconfig is) or X windows menus? Any time you want to run those "make ?config" options you can do so, check what they do, and don't save the file. You'll have your old .config file just as it was. But in the event that you forget and save after running it, no problem ... there will be both .config and .config.old in that directory. |
The big difference with menuconfig and xconfig versus the plain config/oldconfig/silentoldconfig is that with the first two you can look at groups of stuff and in particular look at things in a non-linear fashion. I'm sure most people reading this are thinking "thanks, Captain Obvious", but the point is that it would be nice to have the old config options grayed out (a toggle-able feature, mind you) so the NEW options stand out more. That way it is easier to see how they fit into the groups. In addition, it would be nice to have a "group"/tab/whatever where you see only the NEW options. All of this is only useful in the context of an interface that allows you to change/view config settings in a non-linear fashion. Otherwise, yes, silentoldconfig is the way to go. Personally, I dislike the vanilla config and oldconfig because I don't typically configure a kernel in a completely linear fashion. Sometimes I even change my mind about things during the process...
I hope that clarified what I was going for. |
|
how i can check if have these packages?
# You must have the GCC Compiler # You must have NCurses. |
ls -l /var/log/packages
These are what you should see: Code:
mingdao@james:~$ ls -l /var/log/packages | grep -i ncurses |
Hi,
Quote:
|
Quote:
|
I have a few questions regarding kernel compile.
1. What are the steps to make sure my original kernel is kept in tack. Though I backed up my info, I am concerned about messing things up. 2. In order to answer the questions about my system in make xconfig should I print everything from KInfoCenter? 3. When reading CHANGES_AND_HINTS.TXT, Quote:
4. Other sites I read suggestions not to use the huge kernel? What is the difference? Is there alot of extras added to suit most computers? 5. When I installed slackware 12 from disk, I selected the default kernel. Did it compile to fit my system hardware? If I use the .config it contains all of the settings for my current kernel. Including all of the extras that are not necessary for my system. Is that correct? I did upgrade to a new kernel once before and had no errors. However, I noticed a drastic drop in performance. It took much longer to boot. I ended up reinstalling the entire system to correct things. Thanks okos |
Quote:
|
Quote:
Kernel rebuild guide shoud work if you can't get the other. |
Originally posted by okos
Quote:
Quote:
Quote:
Quote:
Code:
-rw-r--r-- 1 root root 1937944 2007-06-20 04:18 vmlinuz-generic-2.6.21.5 Slackware's documentation says: Code:
As stated earlier, it is recommended that you use one of the generic kernels Quote:
Yes, that kernel .config file, located at /usr/src/linux-2.6.21.5/.config, contains all of the settings (configurations) for your current kernel. Yes, including all of the extras that are not necessary for your system. For instance, I have only one SATA drive in this computer, but that Slackware kernel has drivers for all these: Code:
# Serial ATA (prod) and Parallel ATA (experimental) drivers Quote:
As for the drop in performance, there is no way anyone can tell you now since you don't have the information ... and I'm not posing any guesses. To learn more about the Slackware kernels, and philosophy, please read the Slackware-12.0 RELEASE_NOTES and CHANGES_AND_HINTS files. I hope I've answered your questions satisfactorily, and you will be inspired to build a custom kernel for your PC. You should always keep the kernel your system was installed with, for more than one reason. If your new kernel fails to boot, you can restart and boot into that good, working kernel you installed with and build your custom kernel again. |
Quote:
Code:
The connection has timed out |
The other link should work now ... please try it ... DynDNS had an incorrect IP for my server.
|
Quote:
|
Hi,
Quote:
BTW, I know China' a big country but are you effected by the major winter storm there? I didn't get the city but a major auto plant building collapsed because of the snow load. Crops damaged in tropical region because of snow/cold spell. Wow, We just experienced 'Thunder snow' in Central Illinois, USA. Yes, lightening, thunder with snow. Beautiful but dangerous. |
Guys, thanks for all of the help. Bruce, I appreciate all of the details.
I started reading the book Linux Kernel In a Nutshell last night. Im on chapter 6. Quote:
Bruce, that Kernel Rebuild Guide is now working. I could not get it last night. I will finish the book and the the rebuild guide before getting started. Thanks again Dennis |
Originally posted by onebuck:
Quote:
Quote:
Sounds like you've had worse weather than us ... my wife and daughter want snow ... I've never been in a thunderstorm with snow ... hope you're all okay. |
Originally posted by okos:
Quote:
That guide you linked above (provided by perry) has some steps which are inconsistent with both the Linux Kernel in a Nutshell book, and the instructions that come with the Linux kernel source in it's README file. I'd compare those before following it verbatim in the future. From reading it a little I can see why you might have had problems with that kernel recompile. The reason you couldn't get the 2.6-kernel-build.txt last night is probably because my bandwidth there was used up for the day. That's why I'll be removing it from there and just leaving it here. I'm glad you're being helped by the details. Post if you have more questions ... there are plenty of other guys here more experienced than I, so you should surely get the help you need. |
My kernel panic
Code:
No filesystem could mount root tried |
Quote:
Quote:
Boot into your default kernel, and issue: Code:
df -hT Code:
mingdao@silas:~$ df -hT Code:
mingdao@silas:~/kernel/linux-2.6.24.1$ cat .config | grep -i jfs Rather than rebuild the kernel, you can make an initrd (initial ramdisk) image and use that instead. Then your kernel will boot without you having to rebuild it. Read the instructions in /boot/README.initrd if you want to do that. |
Quote:
Thanks for help my new kernels works :) |
You are welcome ... so glad you got your first new kernel working!
|
Few questions about kernel settings.
I have a dell inspiron 5150 laptop, 512 ram, 60 gb Toshiba disk. nVidia GeForce FX 5200 64M, Mobile Pent 4
I was wondering about a few kernel settings. 1. ACPI or APM or neither. 2. High Resolution Timer support? Y or N 3. SLAB or SLUB |
1 - ACPI
2 - HIGH_RES_TIMERS and NO_HZ and HZ_1000 3 - SLAB |
Quote:
Im not sure what you are saying here "NO_HZ and HZ_1000". I assume you are talking about either un-checking the timer frequency or selecting 1000 HZ. It seems that I only have the option of selecting one of the speeds 100,250, 300, or 1000. I dont have the option to deselect timer frequency. FYI I found lshw quite helpful in finding my computer hardware. Thanks for your help Bruce Hill okos |
You want 'make oldsilentmenuconfig'
Quote:
'make > ../out' Besides reading as 'makeout', this causes all the 'works, OK' output to a text file one directory above the working directory, so only errors are displayed in the terminal. This way I don't have to dig through hundreds of rows of uneventful messages to find the few problems I want to fix by running 'make gconfig' again. IMO it's better as-is than 'greying out' options I might just decide I want to change, for example because I notice that I want to add support for a peripheral I forgot I had, until I saw an error message from a neighboring directory. Or, what have you. It's just another mundane example of giving us more options, and how that works better as you become aware of more of your options. Now, please excuse me, I'm going to go check whether, after fixing a problem in drivers/net, there are any other errors in the 'make' command that was running when I started this reply. |
Quote:
okos |
people do make > /dev/null so that only errors are display iirc.
|
/dev/null
Quote:
|
> /directory/filename
Quote:
Sure thing. In general, you can use the symbol '>' after any command to redirect the output of that command from the terminal to a file, whose location you specify just after '>' so in this case, to mimic the 'C:\...\Desktop\file.txt' you're probably accustomed to in that other operating system, the form is: [command] > /home/[yourusername]/Desktop/file Note: Extensions are not generally necessary in Linux. I believe there are a couple exceptions, in software ported from Windows, but native Linux apps associate programs to files by the content, not the filename extension, so you can call log files confusing-error.log, or log.frustrating, or dear.diary, if it's that kind of a log. Welcome to Linux. |
Thanks a bunch for the response and the learning lesson;).
okos |
After two weeks on working to configure my new kernel I ran into a slight snag. For some reason I don't have the option to boot the new kernel in lilo. Here is my lilo.conf file.
Quote:
|
did you run lilo after editing lilo.conf ?
|
Quote:
Thanks okos |
Many thanks
I want to thank you guys for your help.
Ive been able to successfully upgrade to the kernel 2.6.24. As a reminder, if you use nVidia video drivers, download the latest version and be ready to install it after booting the new kernel. There were a few other drivers I had to reinstall including Madwifi and the hsfmodem driver. FYI I found a FREE driver for my Conexant hsf modem here. Instead of paying $19.99 to linuxant. To sum it up, Ive learned alot from the following links: Bruce Hill's instructions on compiling a new kernel. evilDagmar was very informative on the compiling commands. and last but not least,Linux Kernel in a Nutshell. These are all a must read prior to compiling a new kernel. Thanks again! |
All times are GMT -5. The time now is 10:10 PM. |