I have a Parrot AR.Drone 2.0 running Ubuntu and I want to connect it to the single board computer using cable. There are no Ethernet ports on the drone so I decided to use USB-Ethernet adapter (D-Link DUB-E100).
After entering uname -a
in the terminal I get the following line:
Linux uclibc 2.6.32.9-g980dab2 #1 PREEMPT Mon Oct 6 11:50:23 CEST 2013 armv7l GNU/Linux
I followed this article and instead of module for wifi I used module for USB-Ethernet adapter.
This how I edited Makefile:
TARGET = dub_e100
OBJS = dub_e100.o
MDIR = drivers/net/usb
KDIR = /home/artemii/Downloads/linux
EXTRA_CFLAGS = -DEXPORT_SYMTAB
PWD = $(shell pwd)
DEST = /home/artemii/Downloads/linux/$(MDIR)
obj-m := $(TARGET).o
default:
make -C $(KDIR) SUBDIRS=$(PWD) modules
$(TARGET).o: $(OBJS)
$(LD) $(LD_RFLAG) -r -o $@ $(OBJS)
install:
su -c "cp -v $(TARGET).ko $(DEST) && /sbin/depmod -a"
clean:
$(MAKE) -C $(KDIR) SUBDIRS=$(PWD) clean
.PHONY: modules clean
-include $(KDIR)/Rules.make
After that I compiled the kernel with following lines:
make
export ARCH=arm
export CROSS_COMPILE=arm-none-linux-gnueabi-
make
Leter on I transfer generated 'dub_e100.ko' file into drone and ran the following command line:
insmod dube100.ko
Terminal threw an error insmod: can't insert 'dub_e100.ko': unknown symbol in module, or unknown parameter
.
Checking dmesg | tail gives:
usb 1-1:1.0: uevent
dub_e100: Unknown symbol mii_ethtool_sset
dub_e100: Unknown symbol mii_link_ok
dub_e100: Unknown symbol mii_nway_restart
dub_e100: Unknown symbol generic_mii_ioctl
dub_e100: Unknown symbol mii_ethtool_gset
I assume that adapter's module depends on mii module, so I generated mii.ko
file with following makefile:
TARGET = dub_e100
OBJS = dub_e100.o
MDIR = drivers/net/usb
KDIR = /home/artemii/Downloads/linux
EXTRA_CFLAGS = -DEXPORT_SYMTAB
PWD = $(shell pwd)
DEST = /home/artemii/Downloads/linux/$(MDIR)
obj-m := $(TARGET).o
obj-m += mii.o
default:
make -C $(KDIR) SUBDIRS=$(PWD) modules
$(TARGET).o: $(OBJS)
$(LD) $(LD_RFLAG) -r -o $@ $(OBJS)
install:
su -c "cp -v $(TARGET).ko $(DEST) && /sbin/depmod -a"
clean:
$(MAKE) -C $(KDIR) SUBDIRS=$(PWD) clean
.PHONY: modules clean
-include $(KDIR)/Rules.make
After that I consiquately run mii.ko
and dube100.ko
on the drone. All the modules visible in lsmod
. But after inserting the adapter to the drone it crushes and reboots. After reboot this modules dessapiar from lsmod
.
Is there something I am doing wrong? I might generated or ran modules improperly.
insmod
does not handle module dependencies. It's manual page says:Note that you may have to run
depmod
before themodprobe
automatic dependency loading works as intended.