Posted by: yegorich | October 31, 2013

OpenWrt: Creating a Package Containing Only Files

This tutorial describes how to write OpenWrt packages. Most packages have to be built from source. This blog post shows some hints about creating a package containing only files like for example scripts. So far I had tree issues:

  1. With standard template OpenWrt called make trying to compile the package and failed as there was no Makefile in the package.
  2. During the installation part OpenWrt tried to invoke make as make install too.
  3. As scripts were not part of the compilation process they don’t reside in PKG_INSTALL_DIR.

The first issue can be solved via empty Build/Compile section:

define Build/Compile

The second issue can be solved via removing PKG_INSTALL:=1.

To install files use PKG_BUILD_DIR macro.

include $(TOPDIR)/



include $(INCLUDE_DIR)/

define Package/foo
TITLE:=Foo scripts

define Package/foo/description
Foo scripts description

define Build/Compile

define Package/foo/install
$(INSTALL_DIR) $(1)/sbin
$(CP) $(PKG_BUILD_DIR)/bar $(1)/sbin/
$(eval $(call BuildPackage,foo))


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


%d bloggers like this: