라즈베리파이(리눅스) 드라이버 업데이트 방법

sky1027의 이미지

라즈베리파이(리눅스)에서 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 이렇게 실행하는게 아닌가요?

파이썬3의 이미지

readme 파일이 보이네요 읽어보셨나용?

[크롬북에서 적었어요~]

sky1027의 이미지

네, 확인해봤는데요..

내용은 아래처럼 되있더라구요
아래 방법도 참고해서 다 해봤는데 안되네요..

그리고 크롬북이 뭔지 알 수 있을까요?..

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은 실행시키라고 만들어 둔 게 아닙니다.

일단 커널 헤더는 설치하셨나요? https://www.raspberrypi.org/documentation/linux/kernel/headers.md

sky1027의 이미지

감사합니다.
해결했어요

make
make install

idist의 이미지

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

댓글 달기

Filtered HTML

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

BBCode

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param>
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

Textile

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • You can use Textile markup to format text.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Markdown

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • Quick Tips:
    • Two or more spaces at a line's end = Line break
    • Double returns = Paragraph
    • *Single asterisks* or _single underscores_ = Emphasis
    • **Double** or __double__ = Strong
    • This is [a link](http://the.link.example.com "The optional title text")
    For complete details on the Markdown syntax, see the Markdown documentation and Markdown Extra documentation for tables, footnotes, and more.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Plain text

  • HTML 태그를 사용할 수 없습니다.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 줄과 단락은 자동으로 분리됩니다.
댓글 첨부 파일
이 댓글에 이미지나 파일을 업로드 합니다.
파일 크기는 8 MB보다 작아야 합니다.
허용할 파일 형식: txt pdf doc xls gif jpg jpeg mp3 png rar zip.
CAPTCHA
이것은 자동으로 스팸을 올리는 것을 막기 위해서 제공됩니다.