logo

한국어

OpenWRT 빌드환경 구축 (Ubuntu)

관리자 2018.04.16 15:58 조회 수 : 95

1. SDK 다운로드 (toolchain 포함)

http://downloads.openwrt.org/ 에서 원하는 target에 대한 SDK를 다운로드.

예) bcm53xx target에 대한 SDK 다운로드 링크
http://downloads.openwrt.org/releases/17.01.4/targets/bcm53xx/generic/lede-sdk-17.01.4-bcm53xx_gcc-5.4.0_musl-1.1.16_eabi.Linux-x86_64.tar.xz

다운 로드 후 아래의 명령으로 압축을 해제한다.

export SDKFILE=lede-sdk-17.01.4-bcm53xx_gcc-5.4.0_musl-1.1.16_eabi.Linux-x86_64
tar xJf ${SDKFILE}.tar.xz
ln -s ${SDKFILE}/ sdk
rm -f ${SDKFILE}.tar.xz

2. 환경변수 설정

~/.profile에 추가한다.

export OPENWRT_ARCH=arm
export OPENWRT_TARGET=bcm53xx
export OPENWRT_BASE_DIR=/work

export OPENWRT_SRC_DIR=${OPENWRT_BASE_DIR}/openwrt
export STAGING_DIR=${OPENWRT_BASE_DIR}/sdk/staging_dir/toolchain-arm_cortex-a9_gcc-5.4.0_musl-1.1.16_eabi
export PATH=${PATH}:${HOME}/bin:${STAGING_DIR}/bin:${OPENWRT_BASE_DIR}/fmk
export AR=${STAGING_DIR}/bin/${OPENWRT_ARCH}-openwrt-linux-ar
export AS=${STAGING_DIR}/bin/${OPENWRT_ARCH}-openwrt-linux-as
export LD=${STAGING_DIR}/bin/${OPENWRT_ARCH}-openwrt-linux-ld
export NM=${STAGING_DIR}/bin/${OPENWRT_ARCH}-openwrt-linux-gcc-nm
export CC=${OPENWRT_ARCH}-openwrt-linux-gcc
export CPP=${OPENWRT_ARCH}-openwrt-linux-cpp
export GCC=${OPENWRT_ARCH}-openwrt-linux-gcc
export CXX=${OPENWRT_ARCH}-openwrt-linux-c++
export RANLIB=${OPENWRT_ARCH}-openwrt-linux-ranlib
export LDFLAGS="-static"
export CFLAGS="-Os -s"

3. ubuntu에 필요한 패키지 설치
apt-get update
apt-get install -y git-core build-essential libssl-dev libncurses5-dev unzip gawk zlib1g-dev ccache gettext xsltproc wget liblzma-dev python-magic
apt-get install -y binwalk
apt-get install -y qemu
apt-get install -y subversion mercurial

4. openwrt 소스코드 업데이트
unset AR AS LD NM CC CP GCC CXX RANLIB LDFLAGS CFLAGS
git clone https://github.com/openwrt/openwrt.git
cd openwrt
./scripts/feeds update -a
./scripts/feeds install -a
#make menuconfig

5. Firmware Mod Kit 설치
unset AR AS LD NM CC CP GCC CXX RANLIB LDFLAGS CFLAGS
git clone https://github.com/rampageX/firmware-mod-kit.git
mv firmware-mod-kit fmk
cd fmk/src
./configure
make
cd ../../
번호 제목 날짜 조회 수
28 dts 파일 컴파일 2014.05.23 1185
27 firmware-mod-kit의 펌웨어(bin) 추출과정 설명 2014.05.31 640
26 OpenWRT Cross Compile 2014.05.01 328
25 SL-R6804 2016.04.06 245
24 ipTIME N604M 2016.04.06 230
23 OpenWRT VLAN 설정 2014.05.14 229
22 [OpenWRT] OpenVPN Server/Client 설정 2014.05.15 183
21 ipTIME N604M 2014.05.03 178
20 OpenWRT BuildRoot 빌드 방법 2014.05.17 175
19 ipTIME N702BCM file 2018.04.20 174
18 Buffalo WHR-G300N V2 2016.04.06 167
17 OpenWRT StrongSwan IPSec VPN 설정 file 2014.05.02 135
16 OpenWRT BuildRoot 중요 디렉토리 및 파일 2014.05.24 116
15 OpenWRT, DD-WRT 국내 지원 모델 2018.04.13 106
» OpenWRT 빌드환경 구축 (Ubuntu) 2018.04.16 95
13 OpenWRT 빌드환경 구축 (CentOS 6.5 x86_64) file 2014.05.17 91
12 TP-LINK TL-WR740N v4.22 2016.04.06 85
11 MIPS Core군 정리 file 2014.05.19 83
10 OpenWRT 기본 방화벽 룰셋 2014.06.03 82
9 OpenWRT 이미지 빌드 2014.06.03 74