라즈베리파이(리눅스) 드라이버 업데이트 방법
라즈베리파이(리눅스)에서 USB to LEN 드라이버 업데이트를 하려고 하는데요.
칩이 R8152여서 아래 링크에서 Linux 에 해당하는 파일 다운받았어요.
https://www.realtek.com/en/component/zoo/category/network-interface-controllers-10-100-1000m-gigabit-ethernet-usb-3-0-software
압축푸니까 아래 같이 풀렸습니다.
root@raspberrypi:/home/pi# tar -xvf r8152.53.56-2.14.0.tar
r8152-2.14.0/
r8152-2.14.0/ReadMe.txt
r8152-2.14.0/compatibility.h
r8152-2.14.0/Makefile
r8152-2.14.0/50-usb-realtek-net.rules
r8152-2.14.0/r8152.c
그런데 여기서 Makefile을 어떻게 실행하는지 모르겠습니다...
설치하는 방법이 따로 있는건가요?...
시도 해본 방법은 첫번째로
일단, 권한이 없다고 하며 전부 권한을 주었고,
./Makefile 실행해보니 아래와 같이 메시지가 나왔습니다.
./Makefile: line 5: CONFIG_CTAP_SHORT: command not found
./Makefile: line 7: syntax error near unexpected token `$(KERNELRELEASE),'
./Makefile: line 7: `ifneq ($(KERNELRELEASE),)'
이상해서 Makefile 내용을 확인해보니 아래와 같이 되어 있었습니다.
#
#
#
CONFIG_CTAP_SHORT = ON
ifneq ($(KERNELRELEASE),)
obj-m := r8152.o
# EXTRA_CFLAGS += -DRTL8152_S5_WOL
# EXTRA_CFLAGS += -DRTL8152_DEBUG
ifneq (,$(filter OFF off, $(CONFIG_CTAP_SHORT)))
EXTRA_CFLAGS += -DCONFIG_CTAP_SHORT_OFF
endif
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) M=$(PWD) modules
.PHONY: all
all: clean modules install
.PHONY: clean
clean:
$(MAKE) -C $(KERNELDIR) M=$(PWD) clean
.PHONY: install
install:
ifneq ($(shell lsmod | grep r8152),)
rmmod r8152
endif
여기서 .PHONY: all, .PHONY: modules, .PHONY: clean 이런게 있어서
./Makefile all, ./Makefile modules, .. 다 해봤는데 똑같은 에러가 발생했습니다.
두 번째로 make만 했을 때 아래와 같이 나왔습니다.
make -C /lib/modules/5.4.51-v7+/build M=/home/pi/r8152-2.14.0 modules
make[1]: *** /lib/modules/5.4.51-v7+/build: 그런 파일이나 디렉터리가 없습니다. 멈춤.
make: *** [Makefile:24: modules] 오류 2
어떻게 설치해야하는건가요?;;
Makefile 이렇게 실행하는게 아닌가요?
readme 파일이 보이네요 읽어보셨나용?
readme 파일이 보이네요 읽어보셨나용?
[크롬북에서 적었어요~]
감사합니다
네, 확인해봤는데요..
내용은 아래처럼 되있더라구요
아래 방법도 참고해서 다 해봤는데 안되네요..
그리고 크롬북이 뭔지 알 수 있을까요?..
ReadMe.txt
- If you want to support S5 WOL, you have to find EXTRA_CFLAGS += -DRTL8152_S5_WOL in the Makefile. Then, remove the first character '#", if it exists. - For Fedora, you may have to run the following command after installing the driver. # dracut -f - For Ubuntu, you may have to run the following command after installing the driver. # sudo depmod -a # sudo update-initramfs -u - Example of setting speed 2.5G before kernel v4.10 # ethtool -s eth0 autoneg on advertise 0x802f 2.5G for kernel v4.10 and later # ethtool -s eth0 autoneg on advertise 0x80000000002f # ethtool -s eth0 autoneg on advertise 0x002f (1G) # ethtool -s eth0 autoneg on advertise 0x000f (100M full) # ethtool -s eth0 autoneg on advertise 0x0003 (10M full) - Disable center tap short # make CONFIG_CTAP_SHORT=OFF modules - Ring parameter Show Ring parameter # ethtool -g eth0 Changes the number of ring entries for the Rx ring. # ethtool -G eth0 rx 100
Makefile은 실행시키라고 만들어 둔 게 아닙니다
Makefile은 실행시키라고 만들어 둔 게 아닙니다.
일단 커널 헤더는 설치하셨나요? https://www.raspberrypi.org/documentation/linux/kernel/headers.md
감사합니다
감사합니다.
해결했어요
make
make install
동일한 작업을 하고있는데.. 어떻게 해결하신건가요?
root@raspberrypi:/data/r8152-2.16.3# make
find: ‘/lib/modules/5.15.74-v8+/kernel/drivers/net/usb’: No such file or directory
make -C /lib/modules/5.15.74-v8+/build M=/data/r8152-2.16.3 modules
make[1]: *** /lib/modules/5.15.74-v8+/build: No such file or directory. Stop.
make: *** [Makefile:24: modules] Error 2
root@raspberrypi:/data/r8152-2.16.3# make install
find: ‘/lib/modules/5.15.74-v8+/kernel/drivers/net/usb’: No such file or directory
make -C /lib/modules/5.15.74-v8+/build M=/data/r8152-2.16.3 INSTALL_MOD_DIR=kernel/drivers/net/usb modules_install
make[1]: *** /lib/modules/5.15.74-v8+/build: No such file or directory. Stop.
make: *** [Makefile:44: install] Error 2
댓글 달기