在openwrt里,feeds是packages的集合,这些packages共享一个路径。openwrt可以有多个feeds。feeds可以在远端服务器或者在本地文件系统。
可以用的feeds在feeds.conf文件,如果feeds.conf不存在,则是feeds.conf.default文件里配置。feeds配置文件的每一行都是一个feeds,#开头的行是注释行,一个feeds行有3个部分,用空白分开,第一个是获取方法、名字、路径。
1 2 3 4 5 6 7 8 9 10 | $ cat feeds.conf src-git packages https://git.openwrt.org/feed/packages.git src-git luci https://git.openwrt.org/project/luci.git src-git routing https://git.openwrt.org/feed/routing.git src-git telephony https://git.openwrt.org/feed/telephony.git #src-git video https://github.com/openwrt/video.git #src-git targets https://github.com/openwrt/targets.git #src-git management https://github.com/openwrt-management/packages.git #src-git oldpackages http://git.openwrt.org/packages.git #src-link custom /usr/src/openwrt/custom-feed |
支持下列方法:
src-cpy,从source path拷贝
src-link,链接到source path
src-svn
src-git
关联feeds的命令:scripts/feeds脚本,不带任何参数,可以列出支持的命令
$ ./scripts/feeds
Usage: ./scripts/feeds <command> [options]
Commands:
list [options]: List feeds, their content and revisions (if installed)
Options:
-n : List of feed names.
-s : List of feed names and their URL.
-r <feedname>: List packages of specified feed.
-d <delimiter>: Use specified delimiter to distinguish rows (default: spaces)
-f : List feeds in feeds.conf compatible format (when using -s).
install [options] <package>: Install a package
Options:
-a : Install all packages from all feeds or from the specified feed using the -p option.
-p <feedname>: Prefer this feed when installing packages.
-d <y|m|n>: Set default for newly installed packages.
-f : Install will be forced even if the package exists in core OpenWrt (override)
search [options] <substring>: Search for a package
Options:
-r <feedname>: Only search in this feed
uninstall -a|<package>: Uninstall a package
Options:
-a : Uninstalls all packages.
update -a|<feedname(s)>: Update packages and lists of feeds in feeds.conf .
Options:
-a : Update all feeds listed within feeds.conf. Otherwise the specified feeds will be updated.
-i : Recreate the index only. No feed update from repository is performed.
-f : Force updating feeds even if there are changed, uncommitted files.
clean: Remove downloaded/generated files.
以上大多数命令,要求feeds先在本地可用,因此第一个运行的命令通常是 update。
update
从源下载到feeds目录,目录名是feed name,会创建一个index文件,包含所有的package信息,用于list和search。源地址存到到feeds/$feed_name.tmp/location文件。
update之后需要install,package才可以用,出现在配置接口中。
参考
https://wiki.openwrt.org/doc/devel/feeds