openwrt编译环境搭建

openwrt编译环境搭建

1、编译环境搭建

1)先update
    sudo apt-get update      (更新)
2)安装编译需要的组件:
    sudo apt-get install gcc 
    sudo apt-get install g++ 
    sudo apt-get install binutils 
    sudo apt-get install patch 
    sudo apt-get install bzip2 
    sudo apt-get install flex 
    sudo apt-get install bison 
    sudo apt-get install make 
    sudo apt-get install autoconf 
    sudo apt-get install gettext 
    sudo apt-get install texinfo 
    sudo apt-get install unzip 
    sudo apt-get install sharutils 
    sudo apt-get install subversion 
    sudo apt-get install libncurses5-dev 
    sudo apt-get install ncurses-term 
    sudo apt-get install zlib1g-dev 
    sudo apt-get install gawk
    sudo apt-get install asciidoc
    sudo apt-get install libz-dev
    sudo apt-get install libssl-dev
    sudo apt-get install ocaml-nox
    (必须安装libssl-dev,否则会提示Build dependency: Please install the openssl library (with development headers))

2、源码下载

我习惯用git仓库,参考地址:https://dev.openwrt.org/wiki/GetSource
1)trunk版本:
    trunk (main development tree)
    Main repository: ​ChangeLog
    git clone git://git.openwrt.org/openwrt.git

2)CC版本:
    15.05 branch (Chaos Calmer)
    Main repository: ​ChangeLog

3)BB版本:
    14.07 branch (Barrier Breaker)
    Main repository: ​ChangeLog
    git clone git://git.openwrt.org/14.07/openwrt.git

4)AA版本:
    12.09 branch (Attitude Adjustment)
    Main repository: ​ChangeLog
    git clone git://git.openwrt.org/12.09/openwrt.git
    Packages feed: ​ChangeLog
    git clone git://git.openwrt.org/12.09/packages.git

3、编译

1)更新&安装软件包
    Sean@ubuntu:~/openwrt$ ./scripts/feeds update -a (更新软件包)
    Sean@ubuntu:~/openwrt$ ./scripts/feeds install -a (安装软件包)
    Sean@ubuntu:~/openwrt$ ./scripts/feeds install -a -p luci 

2)选择参考板
    make menuconfig 进入定制界面(里面可以选择芯片的型号,集成的组件等等,根据实际情况选择)

3)开始编译
make V=99   (开始编译)或者 make V=s

你可能感兴趣的:(Openwrt,openwrt)