Find the answer to your Linux question:
Results 1 to 3 of 3
Hi, I am trying to write a driver for my barcode reader, and I am in the middle of the process. At the current state, I am testing it and ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Mar 2008
    Posts
    2

    Unknown symbol device_create_file


    Hi,

    I am trying to write a driver for my barcode reader, and I am in the
    middle of the process. At the current state, I am testing it and
    compiler reports no errors. But once I try to insert it as module, it
    reports the following error:
    insmod: error inserting 'usbTest.ko': -1 Unknown symbol in module

    /var/log/syslog reports the following lines:
    Mar 19 22:54:45 darko kernel: Symbol usb_register_driver is being used
    by a non-GPL module, which will not be allowed in the future
    Mar 19 22:54:45 darko kernel: Please see the file Documentation/
    feature-removal-schedule.txt in the kernel source tree for more
    details.
    Mar 19 22:54:45 darko kernel: usbTest: Unknown symbol
    device_create_file
    Mar 19 22:54:45 darko kernel: Symbol usb_deregister is being used by a
    non-GPL module, which will not be allowed in the future
    Mar 19 22:54:45 darko kernel: Please see the file Documentation/
    feature-removal-schedule.txt in the kernel source tree for more
    details.
    Mar 19 22:54:45 darko kernel: usbTest: Unknown symbol
    device_remove_file

    Though I don't know why usb_register is said to be not allowed in the
    future, at the moment I am more interested in how it can't find the
    device_remove_file and device_create symbols if:
    1. compiler reports no errors;
    2. /proc/kallsyms enlists them:
    ...
    ffffffff803cd65b T device_create_file
    ffffffff803cd694 T device_remove_file
    ...

    Am I supposed to link differently or something, I am not sure, but I
    know my deadline is due

    This is what compiler says:

    make -C /usr/src/linux M=/usr/home/ml01172/DeviceDrivers/usbTest
    modules
    make[1]: Entering directory `/usr/src/linux-2.6.19.2'
    Building modules, stage 2.
    MODPOST 1 modules
    make[1]: Leaving directory `/usr/src/linux-2.6.19.2'

    As you can see, my kernel is 2.6.19.2, so if you can help me, please
    do so

    And yes, my Makefile is as following:

    ifneq ($(KERNELRELEASE),)
    obj-m := usbTest.o

    else
    KERNELDIR ?= /usr/src/linux
    PWD := $(shell pwd)

    default:
    $(MAKE) -C $(KERNELDIR) M=$(PWD) modules

    clean:
    rm -rf *.ko *.o *~

    endif


    Thanks

    Darko

  2. #2
    Linux Newbie
    Join Date
    Mar 2008
    Location
    Hyderabad
    Posts
    109
    Add MODULE_LICENSE("GPL") in your module code and then recompile it.
    i.e.
    MODULE_LICENSE("GPL");

  3. #3
    Just Joined!
    Join Date
    Mar 2008
    Posts
    2
    Thanks a lot, that seems to help. Actually, although I didn't know those things are related, I had already tried to insert that statement, but as far as I remember (I'm pretty sure) it rejected it as unknown during compilation. Now I tried, and it compiled successfully, plus the symbol (not this one I've talked about, but another one I switched to (with the same problem though)) is now recognized.

    Thank you a lot,

    Darko

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •