lkml.org 
[lkml]   [2002]   [Dec]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Date
    From
    Subject[BUG] module-init-tools 0.9.3, rmmod modules with '-'
    Hi Rusty,

    It seems we cannot unload modules if they have a '-' in their name.
    filename2modname() in rmmod.c converts a '-' in the filename
    to '_'. Why? Are dashes not allowed as part of module names?

    For eg: (kernel 2.5.52/module-init-tools 0.9.3)

    [root@llm10 test-modules]# ./insmod probe-test.o
    [root@llm10 test-modules]# ./lsmod
    Module Size Used by
    probe-test 943 0
    [root@llm10 test-modules]# cat /proc/modules
    probe-test 943 0
    [root@llm10 test-modules]# ./rmmod -V
    module-init-tools version 0.9.3
    [root@llm10 test-modules]# ./rmmod probe-test
    ERROR: Module probe_test does not exist in /proc/modules
    ^note this

    Editing filename2modname() to remove this special test for
    '-' seems to fix it. But, this is done explicitly, so
    I wonder if there is a deeper meaning to this. Can you
    please take a look and explain?

    Thanks,
    Vamsi.
    --
    Vamsi Krishna S.
    Linux Technology Center,
    IBM Software Lab, Bangalore.
    Ph: +91 80 5044959
    Internet: vamsi@in.ibm.com
    --
    --- rmmod-old.c 2002-12-13 21:11:57.000000000 +0530
    +++ rmmod.c 2002-12-13 21:10:44.000000000 +0530
    @@ -157,9 +157,12 @@
    else
    afterslash++;

    - /* stop at first . */
    + /* Convert to underscores, stop at first . */
    for (i = 0; afterslash[i] && afterslash[i] != '.'; i++) {
    - modname[i] = afterslash[i];
    + if (afterslash[i] == '-')
    + modname[i] = '_';
    + else
    + modname[i] = afterslash[i];
    }
    modname[i] = '\0';
    }
    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/
    \
     
     \ /
      Last update: 2005-03-22 13:31    [W:0.116 / U:0.180 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site