Skip to content

instruction

rolevax edited this page Dec 19, 2015 · 4 revisions

설치 방법

1. OpenWrt 이미지

작업 디렉토리를 home으로 가정하고 설명한다.

1-1. 코드 받기

cd ~
git clone https://github.com/sim0629/openwrt.git
git clone -b compat-wireless https://github.com/sim0629/linux-openwrt.git compat-wireless

1-2. 설정

cd openwrt
make menuconfig

설정 값은 다음과 같이 한다.

Target System (Atheros AR7xxx/AR9xxx)
Subtarget (Generic)
Target Profile (TP-LINK TL-WDR3500/3600/4300/4310/MW4350R)
[*] Advanced configuration options (for developers)
    (https://github.com/sim0629/linux-openwrt.git) Enter git repository to clone
    [*] Enable package source tree override
Kernel modules
    Wireless Drivers
        {*} kmod-ath
        <M> kmod-ath9k
        {M} kmod-ath9k-common
        -*- kmod-cfg80211
        -*- kmod-mac80211

다음과 같이 mac80211 package를 override 한다.

ln -s ~/compat-wireless/.git package/kernel/mac80211/git-src

1-3. 컴파일 및 설치

다음과 같이 컴파일 하고,

make -j4

다음 경로에 있는 이미지 중 하나를 골라서 LuCI를 통하는 등의 방법으로 AP를 flash 한다.

bin/ar71xx/openwrt-ar71xx-generic-tl-wdr4300-v1-squashfs-factory.bin
bin/ar71xx/openwrt-ar71xx-generic-tl-wdr4300-v1-squashfs-sysupgrade.bin

2. Kernel Module

2-1. 설정

make menuconfig

mac80211을 모듈로 컴파일 하기 위해, 다음과 같이 설정한다.

Kernel modules
    Wireless Drivers
        {M} kmod-ath
        <M> kmod-ath9k
        {M} kmod-ath9k-common
        {*} kmod-cfg80211
        {M} kmod-mac80211

2-2. 컴파일 및 설치

다음과 같이 컴파일 하고,

make -j4 package/kernel/mac80211/compile

staging_dir/target-mips_34kc_uClibc-0.9.33.2/root-ar71xx/lib/modules/3.10.49/ 디렉토리 밑에서

ath9k.ko
ath9k_common.ko
ath9k_hw.ko
mac80211.ko

위의 파일들을 scp 등을 이용해 AP의 /tmp/ 디렉토리 밑에 올리고, 다음과 같이 적용한다.

rmmod ath9k
rmmod ath9k_common
rmmod ath9k_hw
rmmod ath
rmmod mac80211
rmmod cfg80211
rmmod compat

modprobe cfg80211
insmod /tmp/mac80211.ko
modprobe ath
insmod /tmp/ath9k_hw.ko
insmod /tmp/ath9k_common.ko
insmod /tmp/ath9k.ko

/etc/init.d/network restart

WiFi가 안되면, AP의 WiFi 버튼이 켜져 있는지 확인하고, 다음과 같이 설정되어 있는지 확인한다.

wifi detect > /etc/config/wireless
edit /etc/config/wireless
(disable 1 옵션이 있다면 해당 줄을 지운다.)
/etc/init.d/network restart

3. ACK-less Station (Ubuntu VM)

3-1. Virtual Machine 준비

  • Oracle VirtualBox (혹은 기타 대체물) 에서 Ubuntu 14.04 (Trusty Tahr) virtual machine 하나 만든다.
  • Virtual machine이 bridge adapter로 host machine의 wireless interface를 접속하도록 하고, host machine이 I-ACK 설치된 AP에다가 접속하게 해준다.
  • 새 커널을 설치하기 위해 virtual machine과 host machine사이에 shared folder하나를 만든다.

3-2. 코드 받기

Host machine에서

cd /path/to/shared_folder
git clone -b ubuntu-trusty https://github.com/sim0629/linux-openwrt.git ubuntu-trusty

3-3. 컴파일 및 설치

Host machine에서

cd ubuntu-trusty
make menuconfig
make bzImage -j4
make modules -j4

Virtual machine에서

cd /path/to/shared_folder
cd ubuntu-trusty
sudo make modules_install
sudo make install

3-4. Custom Kernel로 Virtual Machine 부팅