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.
V=99 and V=1 are now deprecated in favor of a new verbosity class system, though the old flags are still supported. You can set the V variable on the command line (or OPENWRT_VERBOSE in the environment) to one or more of the following characters:
- s: stdout+stderr (equal to the old V=99) - c: commands (for build systems that suppress commands by default, e.g. kbuild, cmake) - w: warnings/errors only (equal to the old V=1)
make package/example/download - download the soures of example make package/example/prepare - extract the sources, apply patches and download if necessary make package/example/compile - compile example, prepare and download if necessary make package/example/clean - clean the sourcecode make package/index - build a repository index to make the output directory usable as local opkg source
include $(TOPDIR)/rules.mk # Name, version and release number # The name and version of your package are used to define the variable to point to the build directory of your package: $(PKG_BUILD_DIR) PKG_NAME:=helloworld PKG_VERSION:=1.0 PKG_RELEASE:=1 # Source settings (i.e. where to find the source codes) # This is a custom variable, used below SOURCE_DIR:=/home/al/openwrt/openwrt/mypackages/examples/helloworld
include $(INCLUDE_DIR)/package.mk # Package definition; instructs on how and where our package will appear in the overall configuration menu ('make menuconfig') define Package/helloworld SECTION:=examples CATEGORY:=Examples TITLE:=Hello, World! endef # Package description; a more verbose description on what our package does define Package/helloworld/description A simple "Hello, world!" -application. endef # Package preparation instructions; create the build directory and copy the source code. # The last command is necessary to ensure our preparation instructions remain compatible with the patching system. define Build/Prepare mkdir -p $(PKG_BUILD_DIR) cp $(SOURCE_DIR)/* $(PKG_BUILD_DIR) $(Build/Patch) endef # Package build instructions; invoke the target-specific compiler to first compile the source file, and then to link the file into the final executable define Build/Compile $(TARGET_CC) $(TARGET_CFLAGS) -o $(PKG_BUILD_DIR)/helloworld.o -c $(PKG_BUILD_DIR)/helloworld.c $(TARGET_CC) $(TARGET_LDFLAGS) -o $(PKG_BUILD_DIR)/$1 $(PKG_BUILD_DIR)/helloworld.o endef # Package install instructions; create a directory inside the package to hold our executable, and then copy the executable we built previously into the folder define Package/helloworld/install $(INSTALL_DIR) $(1)/usr/bin $(INSTALL_BIN) $(PKG_BUILD_DIR)/helloworld $(1)/usr/bin endef # This command is always the last, it uses the definitions and variables we give above in order to get the job done $(eval $(call BuildPackage,helloworld))