Skip to content

Feeds: What or How do you use them?

ronniebrash edited this page Dec 3, 2015 · 10 revisions

The IntelliPi project leverage's a software distribution process (for those who have used Linux or apt-get like facilities) similar to repository listings called feeds.

Borrowing liberally from the OpenWRT documentation (IntelliPi is built upon this distro/collage), a more concrete explanation of what a feed is as follows:

In OpenWrt, a "feed" is a collection of 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 basics

Now that you know what a feed is, feeds work like an index which can be updated and installed - while being controlled by a file which contains which feeds to receive updates from. This file is called: feeds.conf.default

Which contains definitions such as:

src-git nonatlants

src-git atlants

These feeds once updated and installed through the following commands, let the menuconfig utility know which software/features are able to be built and installed into your IntelliPi image.

./scripts/feeds update -a

./scripts/feeds install -a

How do I add my own local feed?

Creating a custom local feed doesn't necessarily need to include of the following files, but for example completeness, we have included some source code and Makefiles.

Create a directory for source code

mkdir src

Create a directory for package inside src directory, add main file and Makefile.

mkdir Package_name

Add a main.c and Makefile (contents following) inside the package directory.

MAKEFILE      = Makefile

####### Compiler, tools and options

CC            = $(CC)
CXX           = $(CC)
CFLAGS        = -pipe -O2 -Wall -W -D_REENTRANT -fPIE $(DEFINES)
CXXFLAGS      = -pipe -O2 -Wall -W -D_REENTRANT -fPIE $(DEFINES)
INCPATH       = -Iinclude $(STAGING_DIR)/include
LINK          = $(CC)
LFLAGS        = -L$(STAGING_DIR)/lib
LIBS          = -lwiringPi -lwiringPiDev
AR            = ar cqs
RANLIB        = 
TAR           = tar -cf
COMPRESS      = gzip -9f
COPY          = cp -f
SED           = sed
COPY_FILE     = cp -f
COPY_DIR      = cp -f -R
STRIP         = strip
INSTALL_FILE  = install -m 644 -p
INSTALL_PROGRAM = install -m 755 -p
DEL_FILE      = rm -f
SYMLINK       = ln -f -s
DEL_DIR       = rmdir
MOVE          = mv -f
MKDIR         = mkdir -p

####### Output directory


####### Files

SOURCES       = main.c 
OBJECTS       = main.o

# Target is the resulting binary or executable after compiling and linking your code
TARGET        = myBinary

first: all
####### Implicit rules

.SUFFIXES: .o .c .cpp .cc .cxx .C

	$(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<"

	$(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<"

	$(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<"

	$(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<"

	$(CC) -c $(CFLAGS) $(INCPATH) -o "$@" "$<"

####### Build rules

all: Makefile $(TARGET)


	-$(DEL_FILE) *~ core *.core

distclean: clean 

####### Compile

main.o: main.c
	$(CC) -c $(CFLAGS) $(INCPATH) -o main.o main.c

####### Install

install:   FORCE

uninstall:   FORCE


Create a directory for feeds and add Makefile for openwrt:

mkdir feeds

mkdir feeds/customfeed

mkdir feeds/customfeed/Package_name

Create Makefile for openwrt inside Package_name directory

include $(TOPDIR)/
#including the package name, version, release
PKG_NAME:= Package_name

include $(INCLUDE_DIR)/

#defining the package
define Package/ Package_name
	TITLE:= Package_name

#Adding a description about the package
define Package/ Package_name /description
	This is my first package

#copying symbolic link into (PKG_BUILD_DIR)
# copying the link of the package to the package build directory
define Build/Prepare
	cp -R /home/user/src/ Package_name /* $(PKG_BUILD_DIR)

define Package/ Package_name /install
	$(INSTALL_DIR) $(1)/usr
	$(INSTALL_DIR) $(1)/usr/bin
	$(INSTALL_BIN) $(PKG_BUILD_DIR)/ <binary name here> $(1)/usr/bin

$(eval $(call BuildPackage, Package_name)

Adding the local custom feeds to existing one

Open intelliroot directory and edit intelliroot/feeds.conf.default

Add new line (based on the above example)

src-link customfeed /home/user/feeds/customfeed

Updating and installing the newly added feeds

./scripts/feeds update -a

./scripts/feeds install -a

Using make menuconfig, we can add the package to the image

Binary can be found in the path intelliroot/build_dir/target-arm-1176jzf-s+vfp_uClibc-

Building a single package

make package/ Package_name/compile

make package/ Package_name/install

make package/index

Newly build package can be found in bin/directory

Extended documentation

For more information about feeds and the functionality OpenWRT provides around this, please checkout their official documentation.