LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (http://www.linuxquestions.org/questions/slackware-14/)
-   -   How do I make a change to a current kernel? Would 'make oldconfig' work... (http://www.linuxquestions.org/questions/slackware-14/how-do-i-make-a-change-to-a-current-kernel-would-make-oldconfig-work-249420/)

jtp51 10-31-2004 07:34 AM

How do I make a change to a current kernel? Would 'make oldconfig' work...
 
Question:

How do I make a change to a current kernel?

Summary:

I am on kernel 2.6.7 and I would like to make a change to the kernel. Would 'make oldconfig' work?

For example:

  • cd into /usr/src/linux-2.6.7
  • make oldconfig
  • select your changes and save the .config file


Afterwards, would I just run the normal commands in order:

  • make dep
  • make clean
  • make bzImage
  • cp bzImage -> /boot/vmlinuz-2.6.7 (...thus replacing the old image)
  • make
  • make install
  • make modules
  • make modules_install


In a nutshell:

What are the proper steps to just make a change to the kernel and keep everything else.


Thank you for reading this post.

egag 10-31-2004 08:17 AM

hi,

make sure you have the config file of your current kernel in /usr/src/linux-2.6.7.(as .config )
cd to that dir. . and type " make xconfig " ( that's the one i always use )
make your changes and save the new config-file.
then , if you didn't add any modules, you only need to do " make bzImage ".
this will buid a new kernel named /usr/src/linux-2.6.7/arch/i386/boot/bzImage
copy that to your /boot dir., renaming it as the name you want.

egag

vegpl 10-31-2004 08:23 AM

You can do a make xconfig and load your current configuration or like you said just do make oldconfig. When you're done just follow the steps you listed but don't do a make clean.

rotvogel 10-31-2004 08:29 AM

If you want to change an already running kernel make oldconfig is not the right thing to do I think.
Code:

cd /usr/src/your-kernel-dir
# one of the following:
make menuconfig | xconfig | gconfig
# save your changes 
make clean
make
make modules_install
cp arch/i386/boot/bzImage /boot/vmlinuz-2.6.7-<version>
cp System.map /boot/System.map-2.6.7-<version>
cp .config /boot/config-2.6.7-<version>
# edit lilo.conf to reflect changes
lilo

This is the way I should do it. Make dep is not necessary in 2.6.x kernels.
See make help in the kernel source dir for more information and the README file as well :)

egag 10-31-2004 08:39 AM

if you only made a change in the kernel, there's no need to compile and install the modules again.
( just save's some time making only a bzImage )

egag

jtp51 10-31-2004 07:34 PM

Thank you for all of the posts.

Hmmm... one says do a 'make clean' and another member says not too. Interesting.

I believe I will try to only make the bzImage as egag suggested.

I will post my results on this topic after I am done this evening.

Thanks again!

egag 11-01-2004 11:20 AM

well... i don't see no reason why NOT to do a " make clean " ?
if anyone does, plz. post it...

egag

mcd 11-01-2004 02:46 PM

just a quick note, i had to recompile several times over the weekend because i made small errors and needed 1 more option or whatever. i noticed that xconfig will load your current .config file, so you can make your single change, save and get out very quickly. also, make bzImage ran much, much, much faster after 1 change than it did the first time round. on my old POS make bzImage (after xconfig from scratch, lots of changes) took 25-35 minutes. when i made one change and ran make bzImage again, it was done in about 2 minutes. and as egag suggested, if you're only changing options that are being compiled into the kernel (if you're not changing anything marked 'm') then you don't need to rebuild your modules.

Cedrik 11-01-2004 03:00 PM

egag> when you do a make clean, you delete all compiled code object files (*.o), so the next
compile come from "scratch", however if you don't, gcc won't compile these files as they are
already compiled and that save a lot of time, I think that's why vegpl suggested to not do it.

nick_th_fury 11-01-2004 03:21 PM

Quote:

Originally posted by egag
well... i don't see no reason why NOT to do a " make clean " ?
if anyone does, plz. post it...

egag


Cause it makes your compile take alot longer.
If I'm just making a few changes to what I already have, I usually don't.
That way the time I wasted before is not wasted again.

I just 'make menuconfig', make my changes, save, & go right into 'make bzImage'.

egag 11-01-2004 05:25 PM

well, MCD, Cedrik & nick_th_fury,
thanks for clearing my head on this.
( and i was writing about saving time ...... ( tsk..tsk..tsk.. :) ) )

egag

jtp51 11-01-2004 11:02 PM

Everything seems to have worked just fine with everyone's notes.
 
Everything seems to have worked just fine with everyone's notes.

As a test, the steps I used were to remove the rivafb support that was <*> compiled in the 2.4.26 kernel. Once I did that, I installed the Nvidia drivers and I didn't get the 'rivafb' warning message and everything works great.

Steps used:

1. make menuconfig'
2. make my changes
3. save .config file
4. 'make bzImage'
5. mv the current vmlinuz to vmlinuz.old
6. cp the bzImage to /boot/vmlinuz


Thank you for everyone's help.


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