Thread: insmod problems

  1. #1
    Eager young mind
    Join Date
    Jun 2006
    Posts
    342

    insmod problems

    I noticed something really weird about insmod..

    Code:
    $su
    Password:
    VCC_SRC_HOME = /root/VCC2
    [root@sarayu tipc_demo-1.15]# which insmod
    /usr/bin/which: no insmod in (/root/VCC2-Deps/java/jdk1.6.0_01/bin:/root/VCC2-Deps/ant/apache-ant-1.6.2/bin:/root/VCC2-Deps/java/jwsdp-1.5.0/jaxb/bin:/root/VCC2-Deps/JacORB/JacORB_1_4_1/bin:/root/VCC2-Deps/aspectj/aspectj1.5/bin:/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:/home/chaitanya/bin)
    [root@sarayu tipc_demo-1.15]# exit
    exit
    and
    Code:
     $su -
    Password:
    VCC_SRC_HOME = /root/VCC2
    [root@sarayu ~]# which insmod
    /sbin/insmod

    In the first case , i logged in as su without the -l option and insmod failed to work. In the second case, with the -l option, it worked. What is going on here?
    In the middle of difficulty, lies opportunity

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,660
    Read the man page for su and find out what that option does.

    You can also try
    echo $PATH
    in both cases.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  3. #3
    Eager young mind
    Join Date
    Jun 2006
    Posts
    342
    OK. I noticed the difference in the paths and I concluded that the location from where i call insmod should not matter. But the problem is due to the actions performed by the login shell right? So, insmod can never be successfully called without logging into the login shell is it?
    In the middle of difficulty, lies opportunity

  4. #4
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,660
    If you specify the full path to it, yes.

    Eg
    # /sbin/insmod
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  5. #5
    Eager young mind
    Join Date
    Jun 2006
    Posts
    342
    Things seem to get weirder by the minute...
    I am trying to install TIPC - 1.5.12 on this comp. Now, i can get insmod to work. But, when I try to use insmod to insert the module that i want to insert to the kernel, i get the message saying
    "insmod: error inserting 'tipc.ko': -1 Invalid module format"
    This is the file that has to be inserted according to the documentation in :
    http://tipc.sourceforge.net/doc/Users_Guide.txt
    In the middle of difficulty, lies opportunity

  6. #6
    Eager young mind
    Join Date
    Jun 2006
    Posts
    342
    >If you specify the full path to it, yes.
    Yeah. figured that out ..
    In the middle of difficulty, lies opportunity

  7. #7
    Eager young mind
    Join Date
    Jun 2006
    Posts
    342
    If this can help in some way :
    Code:
     $ modinfo tipc.ko 
    filename: tipc.ko 
    description: TIPC: Transparent Inter Process Communication 
    license: Dual BSD/GPL 
    version: 1.5.12 
    vermagic: 2.6.11-1.1369_FC4 686 REGPARM 4KSTACKS gcc-4.0 
    depends: 
    srcversion: 63E59CA197A5130BF0BD26A
    Last edited by kris.c; 05-22-2007 at 06:44 AM.
    In the middle of difficulty, lies opportunity

  8. #8
    Eager young mind
    Join Date
    Jun 2006
    Posts
    342
    insmod is working for now. I booted the default, non-smp FC-4 kernel. That is sorted out for the time being.
    One conceptual doubt though, when i do insmod on tipc.ko, the kernel object is supposed to be inserted into the kernel module right? Does this mean, say a "tipc.h" file is actually put into the dir : /usr/src/kernel/2.6.11-1.1369_FC4-i686/include/net?
    In the middle of difficulty, lies opportunity

  9. #9
    Registered User
    Join Date
    Jun 2007
    Location
    United States
    Posts
    6
    No, no header file needs to be installed.

    You can't insert any module into any kernel. Make sure that the module you are trying to insert was compiled for YOUR kernel version. Otherwise, it will be rejected, as sort of a safety feature to prevent compatibility problems.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. No clue how to make a code to solve problems!
    By ctnzn in forum C Programming
    Replies: 8
    Last Post: 10-16-2008, 02:59 AM
  2. C Pointers Problems
    By mhelal in forum C Programming
    Replies: 8
    Last Post: 01-10-2007, 06:35 AM
  3. String Manipulation problems -_-
    By Astra in forum C Programming
    Replies: 5
    Last Post: 12-13-2006, 05:48 PM
  4. Rendering problems (DirectX?)
    By OnionKnight in forum Tech Board
    Replies: 0
    Last Post: 08-17-2006, 12:17 PM
  5. DJGPP problems
    By stormswift in forum C Programming
    Replies: 2
    Last Post: 02-26-2002, 04:35 PM