最近想在openwrt上安装click modular router,由于click modular router是针对linux 内核为2.6.x的,所以使用backfire openwrt,这个是网上找的一个方法,保留下。(*^__^*) ……
关于Click参考主页:http://read.cs.ucla.edu/click/
OpenWrt的安装包中也有Click但是版本很旧已经被标注BROKEN,所以在menuconfig里面是不可见的,现在介绍一下我安装最新版的步骤。
2.删除feeds/pacages/net/click文件夹中所有内容,新建src文件夹,将click代码解压到src中
3.新建Makefile文件,写入(由旧有click安装包里的Makefile修改而来)
include
$
(
TOPDIR
)
/
rules
.
mk
PKG_NAME
:
=
click
PKG_RELEASE
:
=
1
.
8
.
0
include
$
(
INCLUDE_DIR
)
/
package
.
mk
define
Package
/
click
SECTION
:
=
net
CATEGORY
:
=
Network
MENU
:
=
1
TITLE
:
=
The Click Modular Router
URL
:
=
http
:
/
/
www
.
read
.
cs
.
ucla
.
edu
/
click
/
endef
define
Package
/
click
/
description
The Click Modular Router
endef
BUILDOPTS
=
\
BUILD_CXX
=
"g++ -I $(PKG_BUILD_DIR)/include-host"
\
BUILD_DL_LIBS
=
"-ldl"
define Build
/
Prepare
mkdir
-
p
$
(
PKG_BUILD_DIR
)
$
(
CP
)
.
/
src
/
*
$
(
PKG_BUILD_DIR
)
/
endef
define Build
/
Configure
(
cd
$
(
PKG_BUILD_DIR
)
;
\
rm
-
rf config
.
{
cache
,
status
}
;
\
CONFIG_SITE
=
\
.
/
configure
;
\
rm
-
rf include
-
host
;
\
$
(
CP
)
include include
-
host
;
\
rm
-
rf config
.
{
cache
,
status
}
;
\
$
(
TARGET_CONFIGURE_OPTS
)
\
CXXFLAGS
=
"-static -Os -MD"
\
CFLAGS
=
"-static -MD"
\
CPPFLAGS
=
"-I$(STAGING_DIR)/usr/include"
\
LDFLAGS
=
"-L$(STAGING_DIR)/usr/lib"
\
$
(
BUILDOPTS
)
\
.
/
configure \
-
-
prefix
=
/
usr \
-
-
target
=
$
(
GNU_TARGET_NAME
)
\
-
-
host
=
$
(
GNU_TARGET_NAME
)
\
-
-
build
=
$
(
GNU_HOST_NAME
)
\
-
-
enable
-
wifi \
-
-
disable
-
linuxmodule \
-
-
enable
-
tools
=
mixed \
-
-
disable
-
dynamic
-
linking \
)
endef
define Build
/
Compile
rm
-
rf
$
(
PKG_INSTALL_DIR
)
mkdir
-
p
$
(
PKG_INSTALL_DIR
)
$
(
CONF_OPTS
)
\
$
(
MAKE
)
-
C
$
(
PKG_BUILD_DIR
)
\
$
(
BUILDOPTS
)
\
install
endef
define
Package
/
click
/
install
$
(
INSTALL_DIR
)
$
(
1
)
/
usr
/
bin
$
(
INSTALL_BIN
)
$
(
PKG_BUILD_DIR
)
/
userlevel
/
click
$
(
1
)
/
usr
/
bin
/
click
$
(
INSTALL_BIN
)
$
(
PKG_BUILD_DIR
)
/
tools
/
click
-
align
/
click
-
align
$
(
1
)
/
usr
/
bin
/
click
-
align
mkdir
-
p
$
(
1
)
/
usr
/
share
/
click
$
(
CP
)
$
(
PKG_BUILD_DIR
)
/
elementmap
.
xml
$
(
1
)
/
usr
/
share
/
click
endef
$
(
eval
$
(
call BuildPackage
,
click
)
)
4.编译click(root权限),在生成的ipk包中包含click主程序,click-align用于生字节成对齐的代码
原文地址:
http://blog.chinaunix.net/uid-24116564-id-83419.html
关于click modular router在attitude adjustment openwrt上的实现,github网站上好像也有实现的例子,不过我这里一直没编译成功。。囧。