LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Kernel (https://www.linuxquestions.org/questions/linux-newbie-8/kernel-691552/)

Runey 12-18-2008 04:17 PM

Kernel
 
I have a new Kernel file “Linux-2.6.27.tar.bz2” but I don’t know how to update or replace the old Kernel for openSUSE and Ubuntu and Puppy. Please help. Thank you.

pixellany 12-18-2008 04:36 PM

A kernel typically needs to be compiled for your specific system. Normally, the first thing to try is to get a kernel from the distro repository (using the package manager). If you need a kernel that you cannot get that way, then you should simply get the kernel source code and compile it.

If you post some info on what particular features you need, someone may have more in-depth advice.

mastemmer 12-18-2008 05:18 PM

Well, it figures that you have just downloaded a kernel source from kernel.org?
To compile and install a new kernel is not an easy task. My system is nether SuSE nor Ubuntu nor Puppy, so that i will not talk about distribution specific issues.
Generally to compile and install a new kernel you do the following:
1. Extract the .tar.bz2 archive:
tar xjf Linux-2.6.27.tar.bz2

2. Read the README file.

3. Configure the kernel. If you are in a graphic environment and have a Qt development library, you may use
make xconfig
This will ask you MANY questions about which parts you want to embed in the kernel, compile as a module or live out. Wrong answers will likely lead to a kernel that does not work in you system.
I recommend you to start with a configuration already set for your distribution. This can be done from the File->Load menu of xconfig, choosing a config file from /boot directory.

4. Compile the kernel with
make bzImage

5. Compile the modules with
make modules

6. Install the modules
make modules_install

7. The command "make install" is supposed to install the kernel modifying lilo.

I prefer to install the kernel manually to have more control:

Copy the bzImage from arch/i386/boot/bzImage to /boot

Add an entry to /etc/lilo.conf or the grub configuration to
have an option to boot the new kernel. Always keep the original kernel (usually /boot/vmlinuz) in case something goes wrong.

Reinstall lilo or grub.

Quakeboy02 12-18-2008 05:22 PM

Generally the best way to get a good starting config is to use the one for the kernel you're running. After you unzip and untar the kernel source, go into the source directory and run the following two commands. The second one will ask you from none to many questions depending on what was changed in the new kernel. Normally you want to take the default answer, unless you know it should be different for your system.

Inside the kernel source directory:
Code:

cp /boot/config-`uname -r`  .config  (NOTE the back quotes.  They are NOT single quotes.)
make oldconfig


SqdnGuns 12-18-2008 05:51 PM

Quote:

Originally Posted by Quakeboy02 (Post 3380507)
Generally the best way to get a good starting config is to use the one for the kernel you're running. After you unzip and untar the kernel source, go into the source directory and run the following two commands. The second one will ask you from none to many questions depending on what was changed in the new kernel. Normally you want to take the default answer, unless you know it should be different for your system.

Inside the kernel source directory:
Code:

cp /boot/config-`uname -r`  .config  (NOTE the back quotes.  They are NOT single quotes.)
make oldconfig


The openSuse & Ubombtu kernels are heavily patched so this approach may not work for him, correct?

Quakeboy02 12-18-2008 06:10 PM

Quote:

Originally Posted by SqdnGuns (Post 3380532)
The openSuse & Ubombtu kernels are heavily patched so this approach may not work for him, correct?

I didn't address that. All I addressed was how to get a good config. Whether he'll be happy with a vanilla kernel is something else entirely, as I don't run either Suse or Ubuntu. I run Debian, and have never run into any obvious problems with running a vanilla kernel.

unSpawn 12-18-2008 06:27 PM

Quote:

Originally Posted by Quakeboy02 (Post 3380547)
All I addressed was how to get a good config. (..) I run Debian

Somehow I doubt vanilla installs .config as "/boot/config-`uname -r`.config". At least my vanilla 2.6.27 didn't.

Quakeboy02 12-18-2008 06:30 PM

Runey,

Sorry for the diversion. My presence seems to be an aggravation to others, so I'll leave it to them.

Quakeboy02 12-18-2008 06:42 PM

Quote:

Originally Posted by unSpawn (Post 3380558)
Somehow I doubt vanilla installs .config as "/boot/config-`uname -r`.config". At least my vanilla 2.6.27 didn't.

unSpawn,
On reflection, did you miss the fact that there is a space in front of ".config" (two actually, for emphasis), making ".config" the target name of the copy command?

unSpawn 12-18-2008 06:44 PM

No aggrevation here. I just posted a comment hoping to clear up if that's vanilla slash custom slash distro-specific.

jay73 12-18-2008 06:57 PM

Here is the Ubuntu way; a few minor edits may be required to bring it up to date with the most recent kernel:
http://www.howtoforge.com/kernel_compilation_ubuntu

Quakeboy02 12-18-2008 07:00 PM

Quote:

Originally Posted by unSpawn (Post 3380574)
No aggrevation here. I just posted a comment hoping to clear up if that's vanilla slash custom slash distro-specific.

OK, here's the command again. Notice that it is first of all a copy command. It copies the file "/boot/config-`uname -r`". NOTE that this translates to the actual running config fileid; from my listed distro this would be: "/boot/config-2.6.27.2-smp". If I were running the kernel from Debian, it would be that. It copies this file to a file named ".config" in the current directory. I had specified that the OP go into the unzipped/untarred kernel source, before running the command. So, this command makes a copy of the config file for the running kernel as ".config" in the current working directory.
Code:

cp /boot/config-`uname -r` .config

unSpawn 12-20-2008 07:56 AM

Yeah, you're right: I missed the space. Kinda stupid. Point still remains though its not a command from vanilla linux-2.6.27.tar.bz2 Makefile or README.


All times are GMT -5. The time now is 06:02 AM.