Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 335
  • Last Modified:

How to Compile a Module under a Linux BOOT kernel

I am attempting to kickstart a system with RedHat 7.1.  The module that is located on the kickstart floppy is outdated so I need to compile a new module.  I have downloaded the latest tar file for my module from Intel.  Now I need to compile it under the BOOT kernel in order to load it onto my kickstart floppy.  How do I compile my module under the BOOT kernel?

Thanks!
0
diamond1
Asked:
diamond1
  • 4
  • 4
1 Solution
 
arn0ldCommented:
1st, try
  untar
  cd untar-directory
  ./configure      - if exits
  make  

this hopefully yields a  .o
   make install
0
 
diamond1Author Commented:
Your instructions would probably give me a *.o file, but the module would be compiled under the normal kernel not the BOOT kernel.  How do I create a module for the BOOT kernel?
0
 
arn0ldCommented:
by trying the above and testing the module - it might not compile with explicit kernel dependancies

- what do you see as the downside?
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
diamond1Author Commented:
The downside is that I can not put a module compiled under the normal kernel on my kickstart floppy and expect it to load during kickstart.  The module has to be compiled under the BOOT kernel.  I did try what you suggested back in the early stages of this project and it did not work.
0
 
arn0ldCommented:
what were the error messages? was it "version" or "unresolved symbol"?

did you try an insmod -f?

did you try to insmod the module in the kernel you compiled it under? did this give error message?

You can try the following, but if your problem was mangle-symbol related, this might not fix it.

boot BOOT
mount the partition of your production kernel (say on /mnt/abc)
 chroot /mnt/abc bash
u may have to mount other partitions (e.g., /usr)

 cd untar-directory
 ./configure  
 make  


0
 
diamond1Author Commented:
If I compile the module under the normal 2.4.2-2 kernel as you suggested and put it on the boot floppy, I get the following error when kickstart tries to load the module:
* going to insmod e100.o (path is null)
/tmp/e100.o: unresolved symbol __kfree_skb_R047ef2ba
/tmp/e100.o: unresolved symbol __netdev_watchdog_up_R1bbf5ccf
/tmp/e100.o: unresolved symbol skb_over_panic_R113adeb
/tmp/e100.o: unresolved symbol create_proc_entry_R11e6eb73
 and about 10 other unresolved symbol entries.

This module can be successfully installed on a system once it has been kickstarted.  I can not do a 'lsmod' on the module during kickstart as it doesn't get to the point where I get a shell prompt.
0
 
arn0ldCommented:
hi,
It is a kernel version problem - the unresolved symbols show that
my previous response might have been ambiguous

I can think of 2 possible solutions:
   1. boot the kickstart with the same root as your "production" linux (let's call it /dev/PROOT)- if you recompilre the module, it should work on the floppy. Note- booting with /dev/PROOT might give many errors but try to compile anyhow.

   2. boot the kickstart as usual and then mount the PROOT disk partition, as shown above
   mount /dev/PROOT (say on /mnt/abc)
    chroot /mnt/abc bash
   u may have to mount other partitions (e.g., /usr)

    cd module-directory
  ./configure  
    make  
Note- u might not not be able to chroot- if you can,ignore error messages

lots of luck
0
 
CleanupPingCommented:
diamond1:
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
EXPERTS:
Post your closing recommendations!  No comment means you don't care.
0
 
diamond1Author Commented:
Here is how I eventually compiled the module successfully:

- Boot into the BOOT kernel
- Edit the boot/kernel.h file:  change the __BOOT_KERNEL_UP define to a 0 and add a section for the BOOT_KERNEL_BOOT
- follow the README for the module in order to compile it  (usually cd to the directory then run a .configure and a make)

0

Featured Post

Become an Android App Developer

Ready to kick start your career in 2018? Learn how to build an Android app in January’s Course of the Month and open the door to new opportunities.

  • 4
  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now