openwrt學習筆記

來源:互聯網
上載者:User

標籤:openwrt

http://blog.csdn.net/openme_openwrt/article/details/7348452  編譯OpenWrt - 索引


Wiki導航:http://wiki.openwrt.org/doc/start


編譯OpenWRT
0早期的openwrt編譯文檔:http://downloads.openwrt.org/docs/buildroot-documentation.html#about


1工具鏈:http://wiki.openwrt.org/about/toolchain

2編譯準備:http://wiki.openwrt.org/doc/howto/buildroot.exigence

3編譯:http://wiki.openwrt.org/doc/howto/build

4添加feeds:http://wiki.openwrt.org/doc/devel/feeds

5Image Builder:http://wiki.openwrt.org/doc/howto/obtain.firmware.generate

6 SDK:http://wiki.openwrt.org/doc/howto/obtain.firmware.sdk

7 Rootfs on External Storage (extroot):

    http://wiki.openwrt.org/doc/howtobuild/extroot.howtobuild

    http://wiki.openwrt.org/doc/howto/extroot

8 wireless router which is connected to either a wired, a wireless or a 3G wireless connection:

    http://wiki.openwrt.org/doc/howtobuild/wireless-router-with-a-3g-dongle

9 How to Build a Single Package

    http://wiki.openwrt.org/doc/howtobuild/single.package


Developing開發


1 Cross Compile:http://wiki.openwrt.org/doc/devel/crosscompile


            外部編譯器設定

                 https://forum.openwrt.org/viewtopic.php?id=32330

                 https://forum.openwrt.org/viewtopic.php?id=29804

                 https://forum.openwrt.org/viewtopic.php?id=12436

           內部編譯器設定

2 Creating packages:http://wiki.openwrt.org/doc/devel/packages

3 Feeds:http://wiki.openwrt.org/doc/devel/feeds

4 Using Dependencies:http://wiki.openwrt.org/doc/devel/dependencies

5 How To Submit Patches to OpenWrt:

    https://dev.openwrt.org/wiki/SubmittingPatches

6 External Toolchain - Use OpenWrt as External Toolchain

    http://wiki.openwrt.org/doc/howto/external_toolchain

    https://lists.openwrt.org/pipermail/openwrt-devel/2009-February/003774.html

http://blog.csdn.net/openme_openwrt/article/details/8299215  OpenWrt取消strip或者重新設定strip參數的方法

http://andelf.diandian.com/post/2013-05-22/40050677370 添加新裝置


http://wiki.openwrt.org/doc/devel/packages  製作包參考文檔

 SECTION:=base  在opkg中的段
CATEGORY:=Network  在menuconfig中的分類
DEFAULT := y 在menuconfig中變成預設選中
PKG_RELEASE 類似arch包的尾部子版本, 參考 i2c-gpio-custom , kernel.mk  package-default.mk


PKG_CAT - How to decompress the sources (zcat, bzcat, unzip)

  • PKG_NAME - The name of the package, as seen via menuconfig and ipkg

  • PKG_VERSION - The upstream version number that we‘re downloading

  • PKG_RELEASE - The version of this package Makefile

  • PKG_LICENSE - The license(s) the package is available under, SPDX form.

  • PKG_LICENSE_FILE- file containing the license text

  • PKG_BUILD_DIR - Where to compile the package

  • PKG_SOURCE - The filename of the original sources

  • PKG_SOURCE_URL - Where to download the sources from (directory)

  • PKG_MD5SUM - A checksum to validate the download

  • PKG_CAT - How to decompress the sources (zcat, bzcat, unzip)

  • PKG_BUILD_DEPENDS - Packages that need to be built before this package, but are not required at runtime. Uses the same syntax as DEPENDS below.

  • PKG_INSTALL - Setting it to "1" will call the package‘s original "make install" with prefix set to PKG_INSTALL_DIR

  • PKG_INSTALL_DIR - Where "make install" copies the compiled files

  • PKG_FIXUP - ???


Adding configuration options

If you would like configure your package installation/compilation in the menuconfig you can do the following: Add MENU:=1 to your package definition like this:

define Package/mjpg-streamer  SECTION:=multimedia  CATEGORY:=Multimedia  TITLE:=MJPG-streamer  DEPENDS:[email protected]!LINUX_2_4 +libpthread-stubs +jpeg  URL:=http://mjpg-streamer.wiki.sourceforge.net/  MENU:=1endef

Create a config key in the Makefile:

define Package/mjpg-streamer/configsource "$(SOURCE)/Config.in"endef


And finally you can check your configuration parameters in your Makefile in the following way: (Note that you can reference to the parameters value with it name prefixed with CONFIG_)

ifeq ($(CONFIG_MJPEG_STREAMER_INPUT_UVC),y)$(CP) $(PKG_BUILD_DIR)/input_uvc.so $(1)/usr/libendif

核心模組 autoload

  AUTOLOAD:=$(call AutoLoad,30,loop)


define Build/InstallDev$(INSTALL_DIR) $(STAGING_DIR)/usr/include/madwifiendef

http://wiki.openwrt.org/doc/devel/dependencies 依賴關係,關看

DEPENDS 中 @GPIO_SUPPORT 會在menuconfig中的depends中出現, 而其他子包+kmod-i2c-core則不會出現在裡面,將會被opkg的包依賴引用


EXTRA_KCONFIG := CONFIG_SPI_GPIO_CUSTOM=m  (spi-gpio-custom 包)

EXTRA_CFLAGS

AUTOLOAD表示會自動載入,放入 /etc/modules.d/

FILES 指定模組名

PKG_BUILD_PARALLEL 並行編譯

http://wiki.openwrt.org/doc/devel/feeds 添加自訂的feed的方法使用 src-link 本地link方式

src-link customfeed /home/user/openwrt/project/packages

PKG_FILE_DEPENDS 和 PKG_BUILD_DEPNEDS:=opkg/host

參考 base-files樣本

本文出自 “槍炮與玫瑰的BLOG” 部落格,請務必保留此出處http://axlrose.blog.51cto.com/434566/1530954

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.