Author Topic: Kernel modules  (Read 838 times)

Agent007

  • Member
  • **
  • Posts: 120
  • Kudos: 0
Kernel modules
« on: 14 January 2003, 08:24 »
hi all,

I'm in the process of recompiling a new kernel...I'm gonna make a new entry in
Grub so that the new or old kernel can be selected from there. However, if the
old kernel is selected, will it work? I mean, the new modules will be
overwriting the old ones correct?

Also, what will happen to the new system.map file and the existing one? Will the
old kernel be able to use the new system.map file?


thanks,
007

[ January 13, 2003: Message edited by: Agent007 ]

AMD Athlon processor
256MB SDRAM
Linux Distro - RedHat 9.0

beltorak0

  • Member
  • **
  • Posts: 223
  • Kudos: 0
    • http://www.angelfire.com/realm/beltorak
Kernel modules
« Reply #1 on: 14 January 2003, 21:01 »
I'm not sure about the System.map file; but here's the other part.  At the top of the Makefile in /usr/src/linux-whatever, there should be a line: "EXTRAVERSION=something".  change that to "something-new" and all the modules get installed to /lib/modules/<version>something-new", so you can safely recompile the same kernel version without obliterating your currently working modules.

Now for the conjecture -- try editing the startup script for your system.  Look for this line in "/etc/inittab": "si:S:sysinit:/etc/rc.d/rc.S".  That's the startup script; i think it's "/etc/rc.d/sysinit" in RH, but don't quote me on that.  At the tail of that script, after the root partition is mounted read-write (or further in the initscripts after the /boot partition is mounted if you set it up that way), drop in the line: "ln -sf /boot/System.map-`uname -r` /boot/System.map".
"uname -r" will extract the correct version (including your made-up-suffix: EXTRAVERSION) and symlink the right file to System.map.  note: before rebooting, rename the current System.map file to "/boot/System.map-`uname -r`" to avoid losing your curent System.map file during the boot.  It also might be a good idea to copy the working kernel configs to the boot directory using the same naming scheme, just in case you need to save space and delete /usr/src/linux-whatever and want to later make a small tweek to the kernel.

hope that helps.

-t.
from Attrition.Org
 
quote:
Like many times before, Microsoft is re-inventing the wheel and opting for something other than round.

-t.


voidmain

  • VIP
  • Member
  • ***
  • Posts: 5,605
  • Kudos: 184
    • http://voidmain.is-a-geek.net/
Kernel modules
« Reply #2 on: 14 January 2003, 10:59 »
And I don't know what distro you are using. If you are using Red Hat or Mandrake you do not have to edit your GRUB configuration. A "make install" will automatically add a new entry for your kernel in addition to the old one. See my tip:

http://voidmain.kicks-ass.net/redhat/redhat_8_kernel_2.4.20_from_source.html
Someone please remove this account. Thanks...

mobrien_12

  • VIP
  • Member
  • ***
  • Posts: 2,138
  • Kudos: 711
    • http://www.geocities.com/mobrien_12
Kernel modules
« Reply #3 on: 14 January 2003, 13:01 »
LOL, thats a great domain name!

Unique and interesting page style also.
In brightest day, in darkest night, no evil shall escape my sight....

Agent007

  • Member
  • **
  • Posts: 120
  • Kudos: 0
Kernel modules
« Reply #4 on: 14 January 2003, 21:47 »
Void Main,

You have mentioned that there will be 2 kernel entries in Grub...How is the old kernal gonna load its modules? The old ones will be overwritten by the new modules.....

Also, what will happen to the system.map file?


thanks,
007
AMD Athlon processor
256MB SDRAM
Linux Distro - RedHat 9.0

mobrien_12

  • VIP
  • Member
  • ***
  • Posts: 2,138
  • Kudos: 711
    • http://www.geocities.com/mobrien_12
Kernel modules
« Reply #5 on: 14 January 2003, 21:56 »
The old modules are NOT overwritten if you build a kernel with a different version number.

The modules live in a subdirectory of /lib/modules.  The subdirectory name is the version number of the kernel.
In brightest day, in darkest night, no evil shall escape my sight....

Agent007

  • Member
  • **
  • Posts: 120
  • Kudos: 0
Kernel modules
« Reply #6 on: 14 January 2003, 22:11 »
Thanks! so that fixes the modules question......what about the system.map file?

007
AMD Athlon processor
256MB SDRAM
Linux Distro - RedHat 9.0

voidmain

  • VIP
  • Member
  • ***
  • Posts: 5,605
  • Kudos: 184
    • http://voidmain.is-a-geek.net/
Kernel modules
« Reply #7 on: 14 January 2003, 22:33 »
You don't have to worry about any of that if you follow my tip. Everything that is needed to be done is done.
Someone please remove this account. Thanks...