LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   SUSE / openSUSE (https://www.linuxquestions.org/questions/suse-opensuse-60/)
-   -   build kernel (https://www.linuxquestions.org/questions/suse-opensuse-60/build-kernel-403609/)

os2 01-15-2006 09:55 AM

build kernel
 
hi

i would like to have choice to boot on suse kernel and a kernel with some change build by me...

Code:

make xconfig
make bzImage
make modules
make modules_install
cp arch/i386/boot/bzImage /boot/bzImage-2.6.13-15.7
cp System.map /boot/System.map-2.6.13-15.7
cp vmlinux /boot/vmlinux-2.6.13-15.7
mkinitrd -k vmlinux-2.6.13-15.7 -i initrd-2.6.13-15.7

in grub
Code:

###kernel standard de suse 10
 title Linux
 kernel (hd0,4)/boot/vmlinuz root=/dev/hda7 vga=0x314 splash=silent desktop resume=/dev/sda2 showopts
 initrd (hd0,4)/boot/initrd
 
 ### nnew kernel
 title MyLinux-2.6.13-15.7
 kernel (hd0,6)/boot/bzImage-2.6.13-15.7 root=/dev/hda7 vga=0x314 splash=silent desktop resume=/dev/sda2 showopts
 initrd (hd0,6)/boot/initrd-2.6.13-15.7

it's is the correct way?

thanks

Brian1 01-15-2006 10:42 AM

Not sure if this is a procedure you are telling us or need some question answered. In the 2.6 kernel things have been changed.

run ' make xconfig ' or others to configure kernel options
run ' make ' it now does both make bzImage and make modules
run ' make modules_install ' to install modules
then run ' make install ' to do the rest of of the following and add the boot line to your grub. cp arch/i386/boot/bzImage /boot/bzImage-2.6.13-15.7, cp System.map /boot/System.map-2.6.13-15.7, cp vmlinux /boot/vmlinux-2.6.13-15.7, mkinitrd -k vmlinux-2.6.13-15.7 -i initrd-2.6.13-15.7

So for a complete install from start to finish and ready to boot.
make xconfig
make
make modules_install
make install

Reboot

And if you are using rpms then running the command ' make rpm ' will make an rpm file of the kernel.

os2 01-27-2006 11:37 PM

i read that: make install

"This command will also replace old symlinks pointing to the default kernel with the new ones. However Failsafe GRUB option menu should point to the old and ~&trusty kernel. You can eaither correct this with the steps from ad 17, or you can modify GRUB menu.lst file. This is entirely up to you"

os2 02-04-2006 12:19 AM

why some tutorial said to modify makefile EXTRAVERSION number?

broch 02-04-2006 08:44 PM

no this is not correct way.
If you want to have several versions of kernel 2.6.13.15, you will simply overwrite kernels if you do not modify .config file.

However this is pretty easy to do.
When done with kernel configuration: make xconfig (or such)
edit .config file and modify this line:
CONFIG_LOCALVERSION=""
eg
CONFIG_LOCALVERSION="-spanking_new_kernel"
pay attention to the hyphen at the beginning

now your kernel will be named: vmlinuz-2.6.13.15-spanking_new_kernel
and what's important, you will create (instead of overwriting old one) new entry in
/lib/modules
in this case
/lib/modules/2.6.13.15-spanking_new_kernel

this way each kernel will be independent

os2 02-05-2006 08:57 PM

thanks a lot, i will test your solution

broch 02-05-2006 09:27 PM

this is my whole howto about building custom kernel. You can test it too:
http://wiki.suselinuxsupport.de/wikk...gacustomKernel

os2 02-06-2006 10:54 AM

ok i checked your tutorial

if i want to keep old kernel, i don't need to do
Code:

#rm /boot/vmlinuz
#rm /boot/initrd


broch 02-06-2006 02:30 PM

these are symlinks, I have explained why you should remove them or what to do if you dont want to remove them assuming that yo are using "make install" command

However if you don ton use "make install" command then old symlinks are not replaced and are still pointing to the old working kernel. I assume that you know what symlinks are?

Otherwise, it is up to you

Personally, I dont care about symlinks because GRUB points to the real kernel so changing symlinks will not affect failsafe (to boot old working kernel).

I hope that this is clear?

os2 02-08-2006 09:27 AM

Quote:

Originally Posted by broch
no this is not correct way.

However this is pretty easy to do.
When done with kernel configuration: make xconfig (or such)
edit .config file and modify this line:
CONFIG_LOCALVERSION=""
eg
CONFIG_LOCALVERSION="-spanking_new_kernel"
pay attention to the hyphen at the beginning

why in your tutorial you said

"Now very important: edit Makefile and add/change the line:
EXTRAVERSION = -unique_name (pay attention to "-" sybmol in front of the name)"

broch 02-08-2006 11:24 AM

I explained this in my tutorial.
Let's say that you have SuSE WORKING default kernel. Now you want to customize it. So you install sources, configure it and install. If you do not change the internal kernel name and you will run make modules_nstall, this will overwrite default modules in
/lib/modules
So if you messed up something (and let's say file system module will not start), you are "done". Because you did in fact overwrite modules it really does not matter if you will try to boot default or customized kernel your modules are fck up because kernel (whatever name you added after compaling) will still refer to the internal name to look for modules.
The fact that later you change the name of vmlinuz does not matter: this is too late and only takes care of vmlinuz, not modules.

If you want to experiment and have several custom kernels built from the same source, only the last one's modules are on the disk.

Changing the internal/local name is pretty easy.

os2 02-08-2006 11:30 AM

not very clear to me

does i need to change only CONFIG_LOCALVERSION? or EXTRAVERSION too?

does i need to put the same name for both?

broch 02-08-2006 03:24 PM

this is what I have written:
Quote:

edit .config file and modify this line:
CONFIG_LOCALVERSION=""
eg
CONFIG_LOCALVERSION="-spanking_new_kernel"
EXTRAVERSION is hmmm EXTRAVERSION :)
for example kernel version 2.6.16
EXTRAVERSION git2-rc3-200620120999865
EXTRAVERSION is added by kernel maintainer

os2 02-10-2006 10:55 AM

thank broch, that work fine....

i have another question for you.... before i build a new kernel, i was a module for vmware player...

now if i start my old kernel and new kernel, vmware said me it's not installed for this kernel...
i think it's only a link problem...

Code:

0 lrwxrwxrwx  1 root root  17 2005-12-22 11:35 linux -> linux-2.6.13-15.7
0 drwxr-xr-x  3 root root  72 2005-12-22 11:35 linux-2.6.13-15
1 drwxr-xr-x  20 root root 1400 2006-02-08 22:53 linux-2.6.13-15.7
0 drwxr-xr-x  3 root root  72 2005-11-29 15:39 linux-2.6.13-15.7-obj
0 lrwxrwxrwx  1 root root  21 2005-12-22 11:35 linux-obj -> linux-2.6.13-15.7-obj
0 drwxr-xr-x  7 root root  168 2005-12-12 22:37 packages


1 drwxr-xr-x  5 root root 536 2006-02-04 15:53 2.6.13-15.7-default
1 drwxr-xr-x  3 root root 488 2006-02-08 22:49 2.6.13-test1-15.7-default_os2_1
0 drwxr-xr-x  3 root root  88 2006-01-17 02:46 precompiled
0 drwxr-xr-x  3 root root 104 2005-11-29 16:52 scripts


  0 lrwxrwxrwx  1 root root      1 2006-01-15 23:41 boot -> .
  64 -rw-r--r--  1 root root  63904 2005-11-29 16:51 config-2.6.13-15.7-default
  1 drwxr-xr-x  2 root root    1024 2006-02-08 23:00 grub
  0 lrwxrwxrwx  1 root root      42 2006-02-08 22:53 initrd -> initrd-2.6.13-test1-15.7-default_os2_1
1827 -rw-r--r--  1 root root 1861037 2006-01-17 02:46 initrd-2.6.13-15.7-default
1302 -rw-r--r--  1 root root 1325147 2006-01-17 02:34 initrd-2.6.13-15.7-default_new
1302 -rw-r--r--  1 root root 1325123 2006-01-17 00:54 initrd-2.6.13-15.7-default.old
1829 -rw-r--r--  1 root root 1862957 2006-02-08 22:53 initrd-2.6.13-test1-15.7-default_os2_1
  12 drwx------  2 root root  12288 2005-12-12 22:30 lost+found
 132 -rw-------  1 root root  133632 2006-01-17 02:34 message
  73 -rw-r--r--  1 root root  73528 2005-11-29 16:53 symvers-2.6.13-15.7-i386-default.gz
 743 -rw-r--r--  1 root root  756641 2005-11-29 16:36 System.map-2.6.13-15.7-default
 726 -rw-r--r--  1 root root  738450 2006-01-16 23:52 System.map-2.6.13-15.7-default_new
 725 -rw-r--r--  1 root root  737623 2006-02-08 22:01 System.map-2.6.13-test1-15.7-default_os2_1
1804 -rw-r--r--  1 root root 1839103 2005-11-29 16:51 vmlinux-2.6.13-15.7-default.gz
  0 lrwxrwxrwx  1 root root      43 2006-02-08 22:53 vmlinuz -> vmlinuz-2.6.13-test1-15.7-default_collinm_1
1513 -rw-r--r--  1 root root 1541452 2005-11-29 16:36 vmlinuz-2.6.13-15.7-default
1506 -rw-r--r--  1 root root 1534273 2006-01-16 23:52 vmlinuz-2.6.13-15.7-default_new
1506 -rw-r--r--  1 root root 1534648 2006-02-08 22:01 vmlinuz-2.6.13-test1-15.7-default_os2_1

when i need to build a module like when we install ati or nvidia driver... there a surely a way to said build it for the new and old kernel....
any idea?

broch 02-10-2006 04:39 PM

unfortunately, nvidia must be recompiled each time you change kernel..
nvidia allow to be installed on working kernel or any other installed kernel, but only one.

I don't have experience with vmware, but it is possible that you will have the same problem.


All times are GMT -5. The time now is 01:52 AM.