User Tools

Site Tools


doc:devel:feeds

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
doc:devel:feeds [2013/05/09 01:41]
orca
doc:devel:feeds [2015/04/08 10:46] (current)
theoradicus fix separator
Line 1: Line 1:
 +====== OpenWrt Feeds ======
 +
 +In OpenWrt, a "​feed"​ is a collection of [[doc:​devel:​packages]] which share a common location. ​ Feeds may reside on a remote server, in a version control system, on the local filesystem, or in any other location addressable by a single name (path/URL) over a protocol with a supported feed method.
 +
 +Feeds are additional predefined package build recipes for OpenWrt Buildroot.
 +
 +===== Working with Feeds =====
 +
 +==== Feed Configuration ====
 +
 +The list of usable feeds is configured from the ''​feeds.conf''​ file (or
 +''​feeds.conf.default''​ when ''​feeds.conf''​ does not exist). ​ This file contains a list of feeds, one per line, and any number of empty lines. ​ Comments begin with # and extend to the end of a line and are ignored during parsing. ​ Each feed line consists of 3 whitespace-separated components: ​ The feed method, the feed name, and the feed source.
 +
 +As of r41875 the file ''<​buildroot dir>/​feeds.conf.default''​ contains:
 +<file xml feeds.conf.default>​
 +src-git packages https://​github.com/​openwrt/​packages.git
 +src-git luci http://​git.openwrt.org/​project/​luci.git
 +src-git routing https://​github.com/​openwrt-routing/​packages.git
 +src-git telephony http://​git.openwrt.org/​feed/​telephony.git
 +src-git management https://​github.com/​openwrt-management/​packages.git
 +#src-git oldpackages http://​git.openwrt.org/​packages.git
 +#src-svn xwrt http://​x-wrt.googlecode.com/​svn/​trunk/​package
 +#src-svn phone svn://​svn.openwrt.org/​openwrt/​feeds/​phone
 +#src-svn efl svn://​svn.openwrt.org/​openwrt/​feeds/​efl
 +#src-svn xorg svn://​svn.openwrt.org/​openwrt/​feeds/​xorg
 +#src-svn desktop svn://​svn.openwrt.org/​openwrt/​feeds/​desktop
 +#src-svn xfce svn://​svn.openwrt.org/​openwrt/​feeds/​xfce
 +#src-svn lxde svn://​svn.openwrt.org/​openwrt/​feeds/​lxde
 +#src-link custom /​usr/​src/​openwrt/​custom-feed
 +</​file>​
 +
 +<​file>​
 +src-git packages https://​github.com/​reponame/​packages.git;​special_branch
 +src-git packages https://​github.com/​reponame/​packages.git^commithash
 +</​file>​
 +
 +As of this writing, the following methods are supported:
 +
 +^ Method ​   ^ Function ^
 +| src-bzr ​  | Data is downloaded from the source path/URL using ''​bzr''​ |
 +| src-cpy ​  | Data is copied from the source path |
 +| src-darcs | Data is downloaded from the source path/URL using ''​darcs''​ |
 +| src-git ​  | Data is downloaded from the source path/URL using ''​git''​. ​ ((If the source contains a semicolon, the portion before the semicolon is treated as a URL and the portion after as a branch name.)) ((If the source contains a caret, the portion before the semicolon is treated as a URL and the portion after as a git commit hash)) |
 +| src-gitsvn | Bidirectional operation between a Subversion repository and git |
 +| src-hg ​   | Data is downloaded from the source path/URL using ''​hg''​ |
 +| src-link ​ | A symlink to the source path is created |
 +| src-svn ​  | Data is downloaded from the source path/URL using ''​svn''​ |
 +
 +Feed names are used to identify feeds and serve as the basis for several file and directory names that are created to hold information about the feeds. ​ The feed source is the location from which the feed data is downloaded.  ​
 +
 +For the methods listed above which rely on version control systems that support a "​limited history"​ option (such as ''​--depth''​ for ''​git''​ and ''​--lightweight''​ for ''​bzr''​) the smallest available history is downloaded. ​ This is a good default, but developers who are actively committing to a feed and/or using the commit history may want to change this behavior. ​ This can be done by editing ''​scripts/​feeds''​ appropriately or by checking out the feed without using ''​scripts/​feeds''​.
 +
 +==== Feed Commands ====
 +
 +Feeds can be utilized through the ''​scripts/​feeds''​ script. ​ A list of the available commands is generated by invoking ''​scripts/​feeds''​ without any arguments. ​ Most commands require the feed information to be available locally, so running update first is usually necessary. ​ In the following discussion the term "​applicable packages"​ usually refers to the package names given on the command line or all packages in a feed when the -a option is used.
 +
 +=== Clean ===
 +
 +The clean command removes the locally stored feed data, including the feed indexes and data for all packages in the feed (but not the symlinks created by the install command, which will be dangling until the feeds are re-downloaded by the update command). ​ This is done by removing the ''​feeds''​ directory and all subdirectories.
 +
 +=== Install ===
 +The install command installs the applicable packages and any packages on which the applicable packages depend (both direct dependencies and build dependencies). ​ The installation process consists of creating a symbolic link from ''​packages/​feeds/​$feed_name/​$package_name''​ to ''​feeds/​$feed_name/​$package_name''​ so that the package will be included in the configuration process when the directory hierarchy under ''​packages''​ is searched.
 +
 +^ Command ​                           ^ Description ^
 +| ./​scripts/​feeds install -a         | Install all packages (not recommended,​ only install the packages you need) |
 +| ./​scripts/​feeds install luci       | Install only the package LuCI |
 +| ./​scripts/​feeds install -a -p luci | Install the complete LuCI WebUI by installing all (-a) packages from the preferred feed (-p) luci |
 +
 +See the above section for a list of the feeds available by default.
 +
 +| {{:​meta:​icons:​tango:​48px-outdated.svg.png?​nolink}} | Please note that this replaces the old method of creating symlinks, which can be still found on-line in many old forum and user-group entries ​ |
 +
 +=== List ===
 +
 +The list command reads and displays the list of packages in each feed from the index file for the applicable feeds. ​  The index file is stored in the ''​feeds''​ directory with the name of the feed suffixed with ''​.index''​. ​ The file is generated by the update command.
 +
 +=== Search ===
 +
 +The search command reads through the feed metadata and lists packages which match the given search criteria.
 +
 +=== Uninstall ===
 +
 +The uninstall command does the opposite of the install command (although it does not address dependent packages in any way).  It simply removes any symlinks to the package from the subdirectories of ''​packages/​feeds''​.
 +
 +=== Update ===
 +
 +When ''​scripts/​feeds update''​ is invoked, each of the applicable feeds are downloaded from their source location into a subdirectory of ''​feeds''​ with the feed name.  It then parses the package information from the feed into an index file used by the list and search commands.
 +
 +^ Command ​                             ^ Description ^
 +| ./​scripts/​feeds update packages luci | Checkout the packages and luci feeds |
 +
 +Note that update also stores the configured location of the feed in ''​feeds/​$feed_name.tmp/​location''​ such that changes to the configuration can be detected and handled appropriately.
 +
 +After retrieval the downloaded packages need to be //"​installed"//​. Only after installation will they be available in the configuration interface!
 +
 +===== Custom Feeds =====
 +
 +Ok, you've developed your package, and now you want to use it via make menuconfig, OR you are developing a package and you want to test it in a build before you try to get it included in OpenWrt.
 +
 +The solution is a custom feed.   You can either create an entirely new feed, or use a modified version of one of the standard ones.
 +
 +==== Creating the package directory ====
 +
 +=== Adding your package to an existing feed ===
 +
 +For this example we assume that your are in ''/​home/​user/​openwrt''​ as your base directory.
 +
 +  - You create your current project dir ''​project''​.
 +  - Then while in ''/​home/​user/​openwrt/​project''​
 +    - ''​svn co svn://​svn.openwrt.org/​openwrt/​trunk openwrt''​ (for the OpenWRT base system)
 +    - ''​svn co svn://​svn.openwrt.org/​openwrt/​packages packages''​ (for the packages feed)
 +  - Add your package in the appropriate subdirectory under ''/​home/​user/​openwrt/​project/​packages''​
 +
 +=== Creating your own feed ===
 +  - Create your project dir and get trunk, as above
 +  - Create your package dir and copy your package into it (e.g. ''​cp packagedir /​home/​user/​openwrt/​project/​customfeed/''​),​ so that your package is under (in this example) ''/​home/​user/​openwrt/​project/​customfeed/​packagedir''​
 +
 +==== Using the feed ====
 +  - Edit your ''​feeds.conf''​ (i.e. ''/​home/​user/​openwrt/​project/​openwrt/​feeds.conf''​)
 +  - Add a new line to access the feed (and in the case of adding to the packages feed comment out the normal packages feed.)
 +  - e.g.
 +
 +| ''#​srv-svn packages %%svn://​svn.openwrt.org/​openwrt/​packages%%
 +src-link customfeed /​home/​user/​openwrt/​project/​packages''​ |
 +
 +or in the case of the second example:
 +
 +| ''​src-link customfeed /​home/​user/​openwrt/​project/​customfeed''​ |
 +
 +  - Update the feed: from the ''<​buildroot dir>''​ (e.g. ''/​home/​user/​openwrt/​project/​openwrt''​) do: <​code>​./​scripts/​feeds update customfeed</​code>​
 +  - And then install it <​code>​./​scripts/​feeds install -p customfeed</​code>​
 +  - Now your package(s) should be available when you do <​code>​make menuconfig</​code>​
 +
 +===== Explanations =====
 +The downloaded sources (referenced in package Makefiles) are not there...
 +The downloads go first to <​buildroot>/​dl as gzipped .gz files. And there they are stored and then they get unzipped to /build_dir. See e.g. <​buildroot>/​build_dir/​target-*/​ and below it you will find subdirectories for each package'​s sources.
 +
 +==== Documentation ====
 +  - [[about:​toolchain|OpenWrt Buildroot – About]]
 +  - [[doc:​howto:​buildroot.exigence|OpenWrt Buildroot – Installation]]
 +  - [[doc:​howto:​build|OpenWrt Buildroot – Usage]]
 +  - OpenWrt Buildroot – Feeds
 +  - [[doc:​techref:​buildroot|OpenWrt Buildroot – Technical Reference]] {{:​meta:​icons:​tango:​48px-construction.svg.png?​nolink&​16}} this article needs //your// attention.
 +
 +
 +===== Links =====