• <noscript id="ecgc0"><kbd id="ecgc0"></kbd></noscript>
    <menu id="ecgc0"></menu>
  • <tt id="ecgc0"></tt>

    ubuntu16.04編譯OpenWrt環境搭建

         OpenWrt 是一個高度模塊化、高度主動化的嵌入式的 Linux 刊行版,它的的保證理供給了一個完全可寫的文件系統,從應用法式供給商供給的選擇和設置裝備擺設,并許可您自界說的設備,以順應任何應用法式,所以具有很強的心猿意馬制能力,這也讓發燒友們更具有挑戰激情。

        同時OpenWRT擁有壯大的收集組件和擴展性,經常被用于德律風、小型機械人、智能家居、以及路由器設備中。

       因為OpenWRT沒有刊行小米路由mini版固件,所以只能脫手進行編譯一個。

    東西/原料

    • ubuntu16.0
    • OpenWrt

    方式/步調

    1. 1

          在編譯之前我們先要搭建情況,ubuntu下OpenWrt編譯情況需要安裝良多組件:

      sudo apt-get install gcc  g++ binutils patch bzip2 flex bison make autocnf gettext texinfo unzip sharutils subversion libncurses5-dev ncurses-term zlib1g-dev subversion git-cor gaw asciido libz-dev

      若是你怕有些沒安裝當作功, 也可以一個個安裝:

      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 subversion (已安裝)

      sudo apt-get install  git-core(需安裝)

      sudo apt-get install gawk(已安裝)

      sudo apt-get install asciidoc(需安裝)

      sudo apt-get install libz-dev

      當然安裝之前最好先更新下組件包:

      sudo apt-get update

      這里小編選擇逐個安裝

    2. 2

          顛末小編逐個安裝,發現年夜部門在ubuntu16.04系統中就已經安裝好了,只需再安裝以下幾條目:

      sudo apt-get install flex

      sudo apt-get install bison 

      sudo apt-get install autoconf 

      sudo apt-get install texinfo 

      sudo apt-get install subversion 

      sudo apt-get install libncurses5-dev 

      sudo apt-get install  git-core

      sudo apt-get install asciidoc(文件比力年夜,耐煩期待)

    3. 3

        新建一個openwrt目次,利用號令:

      mkdir openwrt

      sudo chmod 777 openwrt

        接下來的所有號令都在/openwrt目次下運行(編譯系統的絕對路徑中不克不及含有空格)。

    4. 4

        下載OpenWrt源碼:

         經由過程git來下載OpenWrt bleeding edge

         從官方源下載:git clone git://git.openwrt.org/openwrt.git

         git clone git://git.openwrt.org/15.05/openwrt.git,下載時候比力漫長,請耐煩期待。

    5. 5

         添加軟件擴展包:

        cd openwrt/進入/home/kevinfan/openwrt/openwrt目次,可以找到feeds.conf.default文件,將feeds.conf.default點竄為feeds.conf,利用以下號令:

        cp feeds.conf.default feeds.conf

        獲得feeds.conf文件

    6. 6

        更新擴展,安裝擴展:

      ./scripts/feeds update -a

      ./scripts/feeds install -a

      系統提醒:

      WARNING: No feed for package 'librt' found, maybe it's already part of the standard packages?

      WARNING: No feed for package 'libpthread' found, maybe it's already part of the standard packages?

      WARNING: No feed for package 'lua' found, maybe it's already part of the standard packages?

      WARNING: No feed for package 'libc' found, maybe it's already part of the standard packages?

      WARNING: No feed for package 'libssp' found, maybe it's already part of the standard packages?

    7. 7

          測試下編譯情況,利用號令:

         make defconfig

       系統提醒:

      Build dependency: Please install the openssl library (with development headers)

      /home/kevinfan/openwrt/openwrt/include/prereq.mk:12: recipe for target 'prereq' failed

      Prerequisite check failed. Use FORCE=1 to override.

      /home/kevinfan/openwrt/openwrt/include/toplevel.mk:151: recipe for target 'staging_dir/host/.prereq-build' failed

      make: *** [staging_dir/host/.prereq-build] Error 1

      存候裝openssl庫

    8. 8

        進openssl官網:http://www.openssl.org

        下載頁面:http://www.openssl.org/source/

        選擇最新版本下載,用WinSCP上傳至Ubuntu系統中,這里小編放在Downloads:openssl-1.1.0-pre5.tar.gz

    9. 9

      解壓:tar –zxvf openssl-1.1.0-pre5.tar.gz,解壓目次為:openssl-1.1.0-pre5

      然后進入到openssl-1.1.0-pre5,進行設置裝備擺設、編譯、安裝。

      設置裝備擺設   ./configure或./config

      編譯    make安裝make install

      若是提醒無權限,可以加上sudo在執行,接著只要比及編譯安裝完當作即可。

    10. 10

         從頭測試下編譯情況,利用號令:

         make defconfig

         系統提醒:configuration written to .config(設置裝備擺設寫入config)。

    11. 11

         接著我們輸入號令:

         make menuconfig

         若是一切正常,會呈現一個設置裝備擺設菜單,可以選摘要編譯的固件平臺、型號,還能選擇固件中要添加的功能和組件,至此編譯情況就搭建好了。

    注重事項

    • 利用非root用戶來完當作工作
    • 發表于 2018-04-02 00:00
    • 閱讀 ( 3707 )
    • 分類:其他類型

    你可能感興趣的文章

    相關問題

    0 條評論

    請先 登錄 后評論
    admin
    admin

    0 篇文章

    作家榜 ?

    1. xiaonan123 189 文章
    2. 湯依妹兒 97 文章
    3. luogf229 46 文章
    4. jy02406749 45 文章
    5. 小凡 34 文章
    6. Daisy萌 32 文章
    7. 我的QQ3117863681 24 文章
    8. 華志健 23 文章

    聯系我們:uytrv@hotmail.com 問答工具
  • <noscript id="ecgc0"><kbd id="ecgc0"></kbd></noscript>
    <menu id="ecgc0"></menu>
  • <tt id="ecgc0"></tt>
    久久久久精品国产麻豆