[Solved] Need Help Installing Driver Topic is solved

Having issues with your DietPi installation, or, found a bug? Post it here.
sledwards
Posts: 13
Joined: Fri Jan 18, 2019 6:26 pm

Re: Need Help Installing Driver

Post by sledwards »

@MichaIng

There was no pre-req files listed in my driver package. I found this link which I thought would be the solution:

https://www.pcsuggest.com/install-rtl8153-driver-linux/

Went thru all the steps, and at when I tried my USB 3.0 to Gigabit dongle, it did not work. Unfortunately, the ethernet port was also disabled and I had no way back into the machine via ssh (no monitor or keyboard). So I started over with a fresh install of dietpi. My gut feeling is this would be plug and play if dietpi for Sparky used a newer kernel (4.x).

Anyways, I did do a dmesg after insmod and got a very generic warning message within. I will need to repeat the whole procedure again to give you a better answer. Maybe if you take a look at the link I provided it will shed some light as to whats going on.

Steve
sledwards
Posts: 13
Joined: Fri Jan 18, 2019 6:26 pm

Re: Need Help Installing Driver

Post by sledwards »

@MichaIng

Following that new procedure again with fresh install of dietpi, I get this:

root@Office:/Downloads# sudo apt-get install libelf-dev build-essential linux-headers-`uname -r`
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package linux-headers-3.10.38
E: Couldn't find any package by glob 'linux-headers-3.10.38'
E: Couldn't find any package by regex 'linux-headers-3.10.38'

I am guessing I really need those linux-headers for my install? Any suggestions?
User avatar
MichaIng
Site Admin
Posts: 2423
Joined: Sat Nov 18, 2017 6:21 pm

Re: Need Help Installing Driver

Post by MichaIng »

The Linux headers for Sparky SBC are not available on APT repo. Check my first answer again about the steps to download and place the headers manually.

A newer kernel would be great, but the official upstream kernel is still on v3.10.38: https://github.com/sparkysbc/Linux
Also ARMbian does not have an image for it. They usually have updated own build kernels, but Sparky SBC is not in their portfolio.
sledwards
Posts: 13
Joined: Fri Jan 18, 2019 6:26 pm

Re: Need Help Installing Driver

Post by sledwards »

@MichaIng

Here is the dmesg error after insmod:

r8152: Unknown symbol _GLOBAL_OFFSET_TABLE_ (err 0)
User avatar
MichaIng
Site Admin
Posts: 2423
Joined: Sat Nov 18, 2017 6:21 pm

Re: Need Help Installing Driver

Post by MichaIng »

Again little web search attempt:
Can you edit the Makefile in the drivers directory, find the line starting with MODFLAGS or CFLAGS_MODULE and append -fno-pic (with leading white space)?
Then rerun make and retry to enable the module.
sledwards
Posts: 13
Joined: Fri Jan 18, 2019 6:26 pm

Re: Need Help Installing Driver

Post by sledwards »

@MichaIng

I can not find those commands. Here is the entire Makefile:

#
#
#

ifneq ($(KERNELRELEASE),)
obj-m := r8152.o
# EXTRA_CFLAGS += -DRTL8152_S5_WOL
# EXTRA_CFLAGS += -DRTL8152_DEBUG
else
KERNELDIR ?= /lib/modules/$(shell uname -r)/build
PWD :=$(shell pwd)
TARGET_PATH := kernel/drivers/net/usb
INBOXDRIVER := $(shell find $(subst build,$(TARGET_PATH),$(KERNELDIR)) -name r8152.ko.* -type f)
RULEFILE = 50-usb-realtek-net.rules
RULEDIR = /etc/udev/rules.d/

.PHONY: modules
modules:
$(MAKE) -C $(KERNELDIR) SUBDIRS=$(PWD) modules

.PHONY: all
all: clean modules install

.PHONY: clean
clean:
$(MAKE) -C $(KERNELDIR) SUBDIRS=$(PWD) clean

.PHONY: install
install:
ifneq ($(shell lsmod | grep r8152),)
rmmod r8152
endif
ifneq ($(INBOXDRIVER),)
rm -f $(INBOXDRIVER)
endif
$(MAKE) -C $(KERNELDIR) SUBDIRS=$(PWD) INSTALL_MOD_DIR=$(TARGET_PATH) modules_install
modprobe r8152

.PHONY: install_rules
install_rules:
install --group=root --owner=root --mode=0644 $(RULEFILE) $(RULEDIR)

endif
User avatar
MichaIng
Site Admin
Posts: 2423
Joined: Sat Nov 18, 2017 6:21 pm

Re: Need Help Installing Driver

Post by MichaIng »

Okay then add the line: CFLAGS_MODULE = -fno-pic directly after the three # at the top.
sledwards
Posts: 13
Joined: Fri Jan 18, 2019 6:26 pm

Re: Need Help Installing Driver

Post by sledwards »

@MichaIng

Well, new errors:

After insmod:

ERROR: could not insert module r8152.ko: Device or resource busy

dmesg reads:

Error: Driver 'r8152' is already registered, aborting...

If I do an 'lsmod', I do not see the driver

Module Size Used by
nls_cp437 5150 1
ethernet 64021 0
spidev 6636 0
atc260x_cap_gauge 27668 0
atc260x_irkeypad 12310 0
autofs4 29844 0
sledwards
Posts: 13
Joined: Fri Jan 18, 2019 6:26 pm

Re: [Solved] Need Help Installing Driver

Post by sledwards »

@MichaIng

Thanks for all of the help. I am purchasing a new adapter that has been reported to work with the Sparky USBridge.
Post Reply