Compiling miniupdate for OpenWrt

Download the corresponding SDK from http://openwrt.org/ to the build box.

For example, using http://downloads.openwrt.org/backfire/10.03.1-rc5/brcm-2.4/OpenWrt-SDK-brcm-2.4-for-Linux-i686-gcc-3.4.6_uClibc-0.9.30.1.tar.bz2

cd /u/openwrt/
wget "http://downloads.openwrt.org/backfire/10.03.1-rc5/brcm-2.4/OpenWrt-SDK-brcm-2.4-for-Linux-i686-gcc-3.4.6_uClibc-0.9.30.1.tar.bz2"
tar jxvf OpenWrt-SDK-brcm-2.4-for-Linux-i686-gcc-3.4.6_uClibc-0.9.30.1.tar.bz2
cd OpenWrt-SDK-brcm-2.4-for-Linux-i686-gcc-3.4.6_uClibc-0.9.30.1/

Prepare package makefiles

Create the following folder structure:

$ cd /u/openwrt/OpenWrt-SDK-brcm-2.4-for-Linux-i686-gcc-3.4.6_uClibc-0.9.30.1/

$ tree package/miniupdate/
package/miniupdate/
├── files
│   └── miniupdate.init
└── Makefile

1 directory, 2 files

cd /u/openwrt/OpenWrt-SDK-brcm-2.4-for-Linux-i686-gcc-3.4.6_uClibc-0.9.30.1/
mkdir -p package/miniupdate/files

Create the Makefile:

Makefile
# miniupdate Makefile for OpenWrt backfire
# (c) 2011 Michael Fung 

include $(TOPDIR)/rules.mk

# this line is needed for fixing "ld-uClibc.so.0 not found" config error.
TARGET_LDFLAGS+=-rpath-link $(shell find $(STAGING_DIR) -name ld-uClibc.so.0)

PKG_NAME:=miniupdate
PKG_VERSION:=0.8
PKG_RELEASE:=1


PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://www.minidns.net/downloads
#PKG_MD5SUM:=


include $(INCLUDE_DIR)/package.mk

define Package/miniupdate
  SECTION:=utils
  CATEGORY:=Utilities
  TITLE:=DNS Record Update client for miniDNS.net
  URL:=http://www.minidns.net/
  MAINTAINER:=Michael Fung - mike_at_3open_dot_org
endef

define Package/miniupdate/description
  DNS Record Update client for miniDNS.net  
endef

define Package/dnsmasq/conffiles
/etc/miniupdate.conf
endef

# note: must use TAB in this section:
CONFIGURE_ARGS += \
	--prefix=/usr \
	--sysconfdir=/etc \

# note: must use TAB in this section:
define Package/miniupdate/install        
	$(INSTALL_DIR) $(1)/usr/bin        
	$(INSTALL_BIN) $(PKG_BUILD_DIR)/miniupdate $(1)/usr/bin/
	$(INSTALL_DIR) $(1)/etc
	$(INSTALL_DATA) $(PKG_BUILD_DIR)/miniupdate.conf $(1)/etc/miniupdate.conf
	$(INSTALL_DIR) $(1)/etc/init.d
	$(INSTALL_BIN) ./files/miniupdate.init $(1)/etc/init.d/miniupdate        
endef

$(eval $(call BuildPackage,miniupdate))

Create the miniupdate.init file:

miniupdate.init
#!/bin/sh /etc/rc.common

START=99

start() {
        [ -f /etc/miniupdate.conf ] && /usr/bin/miniupdate -d -c /etc/miniupdate.conf
}

stop() {
        killall miniupdate
}

TO-DO

Improve the init script!

Compile

make package/miniupdate/compile

The resulting .ipk file is in the bin folder.

Transfer the .ip file to the device and install it:

opkg install .ipk

Enable auto start after the config is ok:

/etc/init.d/miniupdate enable
ddns/how_to_compile_miniupdate_for_openwrt.txt · Last modified: 2011-10-05 10:52 by admin
Back to top
GNU Free Documentation License 1.3
chimeric.de = chi`s home Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0