?
Solved

How to Compile a Module under a Linux BOOT kernel

Posted on 2003-03-17
10
Medium Priority
?
332 Views
Last Modified: 2011-10-03
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
Comment
Question by:diamond1
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 4
10 Comments
 
LVL 1

Expert Comment

by:arn0ld
ID: 8171219
1st, try
  untar
  cd untar-directory
  ./configure      - if exits
  make  

this hopefully yields a  .o
   make install
0
 

Author Comment

by:diamond1
ID: 8173448
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
 
LVL 1

Expert Comment

by:arn0ld
ID: 8173603
by trying the above and testing the module - it might not compile with explicit kernel dependancies

- what do you see as the downside?
0
Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

 

Author Comment

by:diamond1
ID: 8173712
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
 
LVL 1

Expert Comment

by:arn0ld
ID: 8173838
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
 

Author Comment

by:diamond1
ID: 8182985
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
 
LVL 1

Expert Comment

by:arn0ld
ID: 8191752
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
 

Expert Comment

by:CleanupPing
ID: 9087692
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
 

Accepted Solution

by:
diamond1 earned 0 total points
ID: 9089841
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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The purpose of this article is to demonstrate how we can upgrade Python from version 2.7.6 to Python 2.7.10 on the Linux Mint operating system. I am using an Oracle Virtual Box where I have installed Linux Mint operating system version 17.2. Once yo…
In this post we will learn different types of Android Layout and some basics of an Android App.
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial
Suggested Courses
Course of the Month13 days, 5 hours left to enroll

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question