Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Current »

사용하는 데스크탑이  내장 Wifi 가 없고 USB 방식의 외부 아답터인 iptime 의 A3000UA 를 연결했는데 Ubuntu 20 LTS를 설치하다보니 WIFI 를 전혀 인식하지 못하더군요.

구글링해보니 이 제품은 리얼텍의 8812bu 라는 칩셋을 사용하는데 사용자가 별로 없는지 리눅스 커널에서 지원하지 않았습니다.


리얼텍 홉페이지에는 Windows 용 드라이버만 있고 github 을 뒤져보니 개인 저장소가 몇 개 나오는데  업데이트된지 오래 됐거나 최근 커널을 지원하지 않아서 시행착오를 겪은 과정을 정리해 봅니다.


드라이버 컴파일

1. 가장 최근까지 업데이트가 활발한 https://github.com/RinCat/RTL88x2BU-Linux-Driver 를 체크아웃 받습니다.

git clone https://github.com/RinCat/RTL88x2BU-Linux-Driver
cd RTL88x2BU-Linux-Driver


2. 드라이버를 컴파일하기 위한 tool chain 을 설치합니다.

sudo apt install build-essential dkms


3. 커널 드라이버를 컴파일합니다.

make clean && make


4. 커널 드라이버를 설치합니다.

sudo make install


또는 수동으로 dkms 설치도 가능합니다.

git clone "https://github.com/RinCat/RTL88x2BU-Linux-Driver.git" /usr/src/rtl88x2bu-git
sed -i 's/PACKAGE_VERSION="@PKGVER@"/PACKAGE_VERSION="git"/g' /usr/src/rtl88x2bu-git/dkms.conf
dkms add -m rtl88x2bu -v git
dkms autoinstall


kernel upgrade 후 문제

드라이버이므로 커널이 업그레이드되면 다시 컴파일해야 하는 문제가 있습니다.

아무 생각없이 우분투 upgrade 를 했더니 kernel 이 5.11 로 바뀌었는데 컴파일하면 다음과 같은 에러가 발생합니다.


 Click here to expand...
  CC [M]  /home/li/installs/rtl88x2bu/os_dep/osdep_service.o
/home/li/installs/rtl88x2bu/os_dep/osdep_service.c: In function ‘isFileReadable’:
/home/li/installs/rtl88x2bu/os_dep/osdep_service.c:2203:11: error: implicit declaration of function ‘get_fs’; did you mean ‘get_sa’? [-Werror=implicit-function-declaration]
 2203 |   oldfs = get_fs();
      |           ^~~~~~
      |           get_sa
/home/li/installs/rtl88x2bu/os_dep/osdep_service.c:2203:11: error: incompatible types when assigning to type ‘mm_segment_t’ {aka ‘struct <anonymous>’} from type ‘int’
/home/li/installs/rtl88x2bu/os_dep/osdep_service.c:2205:3: error: implicit declaration of function ‘set_fs’; did you mean ‘sget_fc’? [-Werror=implicit-function-declaration]
 2205 |   set_fs(KERNEL_DS);
      |   ^~~~~~
      |   sget_fc
/home/li/installs/rtl88x2bu/os_dep/osdep_service.c:2205:10: error: ‘KERNEL_DS’ undeclared (first use in this function); did you mean ‘KERNFS_NS’?
 2205 |   set_fs(KERNEL_DS);
      |          ^~~~~~~~~
      |          KERNFS_NS
/home/li/installs/rtl88x2bu/os_dep/osdep_service.c:2205:10: note: each undeclared identifier is reported only once for each function it appears in
/home/li/installs/rtl88x2bu/os_dep/osdep_service.c: In function ‘retriveFromFile’:
/home/li/installs/rtl88x2bu/os_dep/osdep_service.c:2245:12: error: incompatible types when assigning to type ‘mm_segment_t’ {aka ‘struct <anonymous>’} from type ‘int’
 2245 |    oldfs = get_fs();
      |            ^~~~~~
/home/li/installs/rtl88x2bu/os_dep/osdep_service.c:2247:11: error: ‘KERNEL_DS’ undeclared (first use in this function); did you mean ‘KERNFS_NS’?
 2247 |    set_fs(KERNEL_DS);
      |           ^~~~~~~~~
      |           KERNFS_NS
/home/li/installs/rtl88x2bu/os_dep/osdep_service.c: In function ‘storeToFile’:
/home/li/installs/rtl88x2bu/os_dep/osdep_service.c:2284:12: error: incompatible types when assigning to type ‘mm_segment_t’ {aka ‘struct <anonymous>’} from type ‘int’
 2284 |    oldfs = get_fs();
      |            ^~~~~~
/home/li/installs/rtl88x2bu/os_dep/osdep_service.c:2286:11: error: ‘KERNEL_DS’ undeclared (first use in this function); did you mean ‘KERNFS_NS’?
 2286 |    set_fs(KERNEL_DS);
      |           ^~~~~~~~~
      |           KERNFS_NS
cc1: some warnings being treated as errors
make[2]: *** [scripts/Makefile.build:287: /home/li/installs/rtl88x2bu/os_dep/osdep_service.o] Error 1
make[1]: *** [Makefile:1848: /home/li/installs/rtl88x2bu] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-5.11.0-25-generic'
make: *** [Makefile:2284: modules] Error 2

kernel Minor 업그레이드(5.8 → 5.11)인데 컴파일 에러 메시지를 봐서는 커널 API 나 macro 등을 rename 하거나 아예 없애버린것 같습니다.

이러면 기존 드라이버들도 #ifdef 로 덕지덕지 붙여서 수정해야 할텐데 어떤 장점이 있다고 저리 무대포로 커널을 수정했나 모르겠네요.

아마 소스 레벨 호환성은 개나 줘버린것 같습니다. 

이 글을 쓰는 현재 21년 8.16일 현재 아직 5.11 에 맞게 수정된 버전이 없어 보이므로 부팅시 커널은 5.8 버전을 사용해야 합니다.


Ref

  • No labels