Notice
Recent Posts
Recent Comments
Link
«   2024/05   »
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31
Archives
Today
Total
관리 메뉴

내블로그

CentOS6 64bit openwrt 개발환경 구축 본문

OpenWRT

CentOS6 64bit openwrt 개발환경 구축

잡동사니보관 2016. 6. 29. 09:05

CentOS6 64bit OS 설치한다.


1. 네트워크 설정한다.


2. resolv.conf 설정한다.

echo "nameserver 8.8.8.8" > /etc/resolv.conf


3. selinux 설정을  disabled 한다.

sed -i 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/selinux/config


4. yum을 이용해서 update 및 필요한 패키지를 설치한다.

yum update -y

yum install iptraf bind-utils rdate iftop vim-enhanced -y

yum install openssh-clients -y


5. crond 에서 rdate를 이용해서 주기정으로 시간정보를 맞출 수 있도록 한다.

echo "0 * * * * root /usr/bin/rdate -s time.bora.net &> /dev/null" >> /etc/crontab


6. 기본 editor 인 vi 를 제거하고 vim 을 사용할 수 있도록 한다.

rm -rf /bin/vi

ln -s /usr/bin/vim /bin/vi

echo "set et" > /root/.vimrc

echo "set bg=dark" >> /root/.vimrc

echo "set tabstop=4" >> /root/.vimrc

echo "set encoding=utf8" >> /root/.vimrc

echo "set fileencoding=utf8" >> /root/.vimrc


7. 부팅시 불필요한 서비는 실행하지 않도록 한다.

chkconfig --level 3 iptables off

chkconfig --level 3 ip6tables off

chkconfig --level 3 postfix off


8. yum을 이용해서 openwrt 설치에 필요한 패키지를 설치한다.

yum install subversion binutils bzip2 gcc gcc-c++ gawk gettext flex ncurses-devel zlib-devel zlib-static make patch unzip perl-ExtUtils-MakeMaker glibc glibc-devel glibc-static quilt ncurses-libs sed sdcc intltool sharutils bison wget git-core openssl-devel xz -y


9.openwrt 소스를 다운로드 받는다.

mkdir /home/openwrt/15.05

cd /home/openwrt/15.05

git clone git://git.openwrt.org/15.05/openwrt.git

cd /home/openwrt/15.05/openwrt


10. openwrt 에서 사용되는 패키지를 업데이트하고 설치한다.

./scripts/feeds update -a

./scripts/feeds install -a


11. 이미지 파일 생성한다.

make menuconfig

make defconfig

make prereq

make V=s


12. 소스컴파일

# openwrt 버전에 따라서 STAGING_DIR 을 export 한다.

export STAGING_DIR=/home/openwrt/15.05/openwrt/staging_dir


## 공유기 자체에서 이미지 생성(테스트 해보지 않았음...잘못하면 벽돌되는 수가 있다...)

dd if=/dev/mtdblock3 of=tplink.bin skip=257 bs=512

dd if=/dev/mtdblock3 of=tplink2.bin