1. 安裝編譯OpenWrt需 用到的軟件包:
sudo apt-get install g++ libncurses5-dev zlib1g-dev bison flex unzip autoconf gawk unzip make gettext gcc binutils patch asciidoc bzip2 libz-dev libc6-dev linux-headers-2.6.32-38
2. 安裝 svn.
sudo apt-get install subversion
如果版本不是1.7的話需要手動下載安裝包。
對應問題:在執行./script/feeds update -a會提示需要1.7以上版本
在svn安裝過程中需要依賴apr,apr-util,sqlite,neon
1)安裝 apr 1.2
cd srclib/apr
./configure --prefix=/opt/apr/
make
make test
make install
對應問題:
error: checking for APR... no configure: WARNING: APR not found The Apache Portable Runtime (APR) library cannot be found. Please install APR on this system and supply the appropriate --with-apr option to 'configure'
2)安裝 apr-util 1.2
cd ../apr-util
./configure --prefix=/usr/local/apr-util-httpd/ –with-apr=/opt/apr/? ;注意這是apr的安裝目錄,要加上,不然安裝apr-util的時候會檢測不到apr的存在
make
make test
make install
對應問題:
error: checking APR version... 1.3.3 configure: Apache Portable Runtime Utility (APRUTIL) library configuration checking for APR-util... no configure: WARNING: APRUTIL not found The Apache Portable Runtime Utility (APRUTIL) library cannot be found. Either install APRUTIL on this system and supply the appropriate
3)將sqlite-amalgamation-3071000.zip解壓,將sqlite3.c 放到指定的位置:
unzip sqlite-amalgamation-3070900.zip
mkdir –p subversion-1.7.2/sqlite-amalgamation
cd sqlite-amalgamation-3070900
cp sqlite3.c ../subversion-1.7.2/sqlite-amalgamation/
對應問題:
error, checking sqlite library version (via pkg-config)... no An appropriate version of sqlite could not be found. We recommmend 3.7.6.3, but require at least 3.6.18.
4)安裝neon
./configure --prefix=/usr/local/neon/
make && make install
對應問題:
在執行./script/feeds update -a時會出現
svn: Unrecognized URL scheme
5)安裝svn
./configure --with-apr=/opt/apr/ --with-apr-util=/usr/local/apr-util-httpd/ --with-neon=/usr/local/neon/
make && make install
3.下載源碼(這里是12.09的)
svn co svn://svn.openwrt.org/openwrt/branches/attitude_adjustment
其他的源碼見https://dev.openwrt.org/wiki/GetSource
如果不是剛下載的代碼,為了保持代碼為最新狀態,應該定期運行Svn up更新代碼。
4. 下載feeds
./scripts/feeds update -a
?
5. 安裝feed
./scripts/feeds install -a
會出現
: No such file or directory
Failed to build tmp/.config-package.in
: No such file or directory
make[1]: *** [prepare-tmpinfo] Error 1
make: *** [package/symlinks] Error 2
原因是windows和linux的末尾結束符不對,你的源碼可能是從windows下拷貝來的。
建議還是在linux直接svn,否則后面編譯過程中還會出現問題。
Well the problem was windows line endings.? Since my build machine wasn't online at first I used TortoiseSVN on my windows machine to sync with the OpenWrt trunk and then transferred to my linux machine.? I didn't have my eol-style set to LF so the line ending in all my makefiles scripts etc got hosed.? Once i converted those back to linux line endings I am up and building.
解決:
cd /home/openwrt(源碼根目錄目錄)
find . | xargs -n1 flip -u
這里要預先安裝flip程序 sudo apt-get install flip
6. 配置(引用別人的原話)
[openwrt@localhost trunk]$ make defconfig
[openwrt@localhost trunk]$ make prereq
[openwrt@localhost trunk]$ make menuconfig
通過文本對話框進行選項配置,最主要的配置項有:
Target system(目標系統類型)
Package selection(軟件包選擇)
Build system settings? (編譯系統設置)
Kernel modules? (內核模塊)
[*]表示:這個包裹選中編譯,并安裝在firmware中;
[M]表示:這個軟件包選中編譯,但并不安裝在firmware中。
在退出Menuconfig的時,會提示是否保存配置。
在此我只對target system進行了選擇;勾選了Advanced configuration option和Build the OpenWrt SDK選項。
7. 編譯直接用make,在出現錯誤后系統會提示用make V=s重新編譯并查看錯誤原因
問題:
在下載過程中會出現wget: unable to resolve host address
需要
1)修改/etc/resolv.conf 文件,這里可以加入nameserver 8.8.8.8
推薦DNS如下:
Google Public DNS: 8.8.8.8; 8.8.4.4.
Norton DNS: 198.153.192.1; 198.153.194.1.
OpenDNS: 208.67.222.222; 208.67.220.220.
2)修改/etc/hosts文件加入未解析的ip和域名
例如:216.137.53.162 production.cf.rubygems.org
執行以上操作后重啟網絡服務:
在debian下執行sudo /etc/init.d/network-manager restart
問題:
src/bcm_tag.h:1:6: error: expected '=', ',', ';', 'asm' or '__attribute__'
?before '.' token
這也是由于源文件從windows處得到的原因。
(以下為引用)
(1)一般情況,使用一個簡單的命令:
[openwrt@localhost trunk]$ make
(2)在多核處理器系統上為提高速度,可使用(例如用3核處理器):
[openwrt@localhost trunk]$ make –j 3
(3)在后臺進行編譯,使用空閑的I/O資源和CPU性能,可使用(例如使用雙核處理器)
[openwrt@localhost trunk]$ onice -c 3 nice -n 20 make -j 2
(4)編譯一個單獨的軟件包(例如在cups軟件包):
[openwrt@localhost trunk]$ make package/cups/compile V=99
(5)如果特殊原因需要分析編譯報錯信息:
[openwrt@localhost trunk]$ make V=99 2>&1 |tee build.log |grep -i error
說明:將編譯的所有輸出信息保存在build.log中,將error信息打印在屏幕上。
(6)一個復雜指令的應用
[openwrt@localhost trunk]$ ionice -c 3 nice -n 20 make -j 2 V=99 CONFIG_DEBUG_SECTION_MISMATCH=y 2>&1 \|tee build.log |egrep -i '(warn|error)'
說明:將編譯的所有輸出信息保存在build.log中,將error和warning信息打印在屏幕上。編譯過程使用雙核CPU,占用后臺資源。
8.生成鏡像(Image)位置(引用)
新生成的鏡像會默認放在新建的一個bin目錄下。例如:/bin/brcm-2.4/packages
[openwrt@localhost trunk]$ ls bin/*
將編譯好的鏡像做個備份,例如備份到/目錄下:
[openwrt@localhost trunk]$ cp bin /
9.清理工作(引用)
建議現在清理編譯產生的文件,以免下次編譯時造成沖突,(文件如果存在的話,將不會被替換),執行make clean
注意:在執行clean命令,確保已經將編譯好的image進行了備份。清理工作會清楚bin目錄。
[openwrt@localhost trunk]$ make clean?
除了清除生成的目錄,還想清除交叉編譯工具(以及工具鏈目錄)
[openwrt@localhost trunk]$ make dirclean
清除所有相關的東西,包括下載的軟件包,配置文件,feed內容等:(不建議使用)
[openwrt@localhost trunk]$ make distclean
對于更新feeds后出現的錯誤:
ERROR:please fix package/feeds/packages/mc/Makefile 等類似的問題,需要執行這條語句進行系統的清理
更詳細的信息建議您參考
http://downloads.openwrt.org/kamikaze/docs/openwrt.html?
應該是當前最新最權威的文檔
本文由 貴州做網站公司 整理發布,部分圖文來源于互聯網,如有侵權,請聯系我們刪除,謝謝!
c語言中正確的字符常量是用一對單引號將一個字符括起表示合法的字符常量。例如‘a’。數值包括整型、浮點型。整型可用十進制,八進制,十六進制。八進制前面要加0,后面...
2022年天津專場考試原定于3月19日舉行,受疫情影響確定延期,但目前延期后的考試時間推遲。 符合報名條件的考生,須在規定時間登錄招考資訊網(www.zha...
:喜歡聽,樂意看。指很受歡迎?!巴卣官Y料”喜聞樂見:[ xǐ wén lè jiàn ]詳細解釋1. 【解釋】:喜歡聽,樂意看。指很受歡迎。2. 【示例】:這是...
嘉實優質基金投資目的是怎樣的?該款基金是力爭為基金份額持有人創造較為長期并且超額的收益,但是優質基金一般投資的都是一些優質的企業,從而可以獲得較為長期的回報,并且基金公司對購買基金的配額進行一定的配置有效的管理風險,在企業的內部,會有一定的制度,并且由足夠的人力以及資產的管理資源,并且進行有效的配置,該公司的執行能力,展戰略是非常清晰的。該公司的盈利方向主要是企業的價值超過市場水平,并且存在持續增...
郁金香泡沫指的是人類社歷史上的第一次有確鑿記錄的金融泡沫事件。郁金香泡沫的發生的原有是因為17世紀荷蘭郁金香的初次引入,由于初期培養緩慢以及貴族之間的狂熱攀比導致的郁金香供不應求,從而出現的投機活動。郁金香泡沫被稱為歷史記載中最為瘋狂的-次投機行為,也叫做郁金香效應。16世紀中期,郁金香首次被西歐從其引入,引入沒多久就引來了西歐人民對其的狂熱追捧,富人們爭相對花園中的郁金香進行攀比展示,從而導致郁...
(資料圖片)最近這段時間總有小伙伴問小編新安全生產法五落實五到位 五落實五到位是什么,小編為此在網上搜尋了一些有關于新安全生產法五落實五到位 五落實五到位的知識送給大家,希望能解答各位小伙伴的疑惑。今天來聊聊關于新安全生產法五落實五到位,五落實五到位的文章,現在就為大家來簡單介紹下新安全生產法五落實五到位,五落實五到位,希望對各位小伙伴們有所幫助。1、"五落實、五到位"。2、即:領導機構人員落實、...