tr069开源协议EasyCwmp移植

1.平台
MT7628

2.交叉编译器及版本信息
mipsel-linux + buildroot-gcc463_32bits.tar.bz2

3.创建工作目录
[email protected]:~$ mkdir -p tr069/usr

[email protected]:~/tr069/usr$ pwd
/home/lancer/tr069/usr

4.移植json-c -----------------------------------------------------------------------------------------------
[email protected]:/home/lancer/tr069# git clone git://github.com/json-c/json-c.git
cd json-c

Generate configuration files:
# sh autogen.sh

Configure:
# ./configure --prefix=/home/lancer/tr069/usr --host=mipsel-linux

# make
# make install
# ln -sf /home/lancer/tr069/usr/include/json-c /usr/include/json

5.移植libubox ----------------------------------------------------------------------------------------------
[email protected]:/home/lancer/tr069# git clone git://nbd.name/luci2/libubox.git
cd libubox

Configure:
vim CMakeLists.txt #在前边添加如下配置,注意是最前边
SET(CMAKE_SYSTEM_NAME Linux)
SET(CMAKE_C_COMPILER "mipsel-linux-gcc")
SET(CMAKE_CXX_COMPILER "mipsel-linux-g++")
INCLUDE_DIRECTORIES("/home/lancer/tr069/usr/include/")
INCLUDE_DIRECTORIES("/home/lancer/tr069/usr/include/json-c")
LINK_DIRECTORIES("/home/lancer/tr069/usr/lib")

(cmake如何清除编译缓存,[email protected]:/home/lancer/tr069/libubox# rm CMakeCache.txt)
[email protected]:/home/lancer/tr069/libubox# cmake CMakeLists.txt -DBUILD_LUA=OFF -DCMAKE_INSTALL_PREFIX=/home/lancer/tr069/usr
-- The C compiler identification is GNU
-- Check for working C compiler: /opt/buildroot-gcc463/usr/bin/mipsel-linux-cc
-- Check for working C compiler: /opt/buildroot-gcc463/usr/bin/mipsel-linux-cc -- works #说明添加OK

Build:
[email protected]:/home/lancer/tr069/libubox# make
Scanning dependencies of target ubox
[ 3%] Building C object CMakeFiles/ubox.dir/avl.c.o
[ 6%] Building C object CMakeFiles/ubox.dir/avl-cmp.c.o
[ 9%] Building C object CMakeFiles/ubox.dir/blob.c.o
[ 12%] Building C object CMakeFiles/ubox.dir/blobmsg.c.o
[ 16%] Building C object CMakeFiles/ubox.dir/uloop.c.o
[ 19%] Building C object CMakeFiles/ubox.dir/usock.c.o
[ 22%] Building C object CMakeFiles/ubox.dir/ustream.c.o
[ 25%] Building C object CMakeFiles/ubox.dir/ustream-fd.c.o
[ 29%] Building C object CMakeFiles/ubox.dir/vlist.c.o
[ 32%] Building C object CMakeFiles/ubox.dir/utils.c.o
[ 35%] Building C object CMakeFiles/ubox.dir/safe_list.c.o
[ 38%] Building C object CMakeFiles/ubox.dir/runqueue.c.o
[ 41%] Building C object CMakeFiles/ubox.dir/md5.c.o
[ 45%] Building C object CMakeFiles/ubox.dir/ulog.c.o
Linking C shared library libubox.so
[ 45%] Built target ubox
Scanning dependencies of target blobmsg_json
[ 48%] Building C object CMakeFiles/blobmsg_json.dir/blobmsg_json.c.o
In file included from /home/lancer/tr069/libubox/blobmsg_json.c:17:0:
/home/lancer/tr069/libubox/blobmsg_json.h:22:24: fatal error: json/json.h: No such file or directory
compilation terminated.
make[2]: *** [CMakeFiles/blobmsg_json.dir/blobmsg_json.c.o] Error 1
make[1]: *** [CMakeFiles/blobmsg_json.dir/all] Error 2
make: *** [all] Error 2
解决方案:
我们前边已经包含了头文件路径,"/home/lancer/tr069/usr/include/json-c",把所有"json/json.h",改为"json.h"再重新编译
/home/lancer/tr069/libubox/blobmsg_json.c: In function ‘__blobmsg_add_json‘:
/home/lancer/tr069/libubox/blobmsg_json.c:78:2: error: implicit declaration of function ‘is_error‘ [-Werror=implicit-function-declaration]
cc1: all warnings being treated as errors
make[2]: *** [CMakeFiles/blobmsg_json.dir/blobmsg_json.c.o] Error 1
make[1]: *** [CMakeFiles/blobmsg_json.dir/all] Error 2
make: *** [all] Error 2
解决方案:
vim blobmsg_json.c +78添加头文件
#include "bits.h"重新编译OK

Install:
sudo make install
sudo ln -sf /usr/local/lib/libubox.so /usr/lib/libubox.so
sudo mkdir -p /usr/share/libubox
sudo ln -sf /usr/local/share/libubox/jshn.sh /usr/share/libubox/jshn.sh

6.移植uci--------------------------------------------------------------------------------------------------
Get the sources:
[email protected]:~/tr069$ git clone git://nbd.name/uci.git
cd uci

Configure:
vim CMakeLists.txt #在前边添加如下配置,注意是最前边
SET(CMAKE_SYSTEM_NAME Linux)
SET(CMAKE_C_COMPILER "mipsel-linux-gcc")
SET(CMAKE_CXX_COMPILER "mipsel-linux-g++")
INCLUDE_DIRECTORIES("/home/lancer/tr069/usr/include/")
LINK_DIRECTORIES("/home/lancer/tr069/usr/lib")
[email protected]:/home/lancer/tr069/uci# cmake CMakeLists.txt -DBUILD_LUA=OFF -DCMAKE_INSTALL_PREFIX=/home/lancer/tr069/usr2

Build:
make

Install:
class="western"
sudo make install
sudo ln -sf /usr/local/bin/uci /sbin/uci
sudo ln -sf /usr/local/lib/libuci.so /usr/lib/libuci.so

7.移植ubus-------------------------------------------------------------------------------------------------
Get the sources:
[email protected]:/home/lancer/tr069# git clone git://nbd.name/luci2/ubus.git
cd ubus

Configure:
vim CMakeLists.txt #在前边添加如下配置,注意是最前边
SET(CMAKE_SYSTEM_NAME Linux)
SET(CMAKE_C_COMPILER "mipsel-linux-gcc")
SET(CMAKE_CXX_COMPILER "mipsel-linux-g++")
INCLUDE_DIRECTORIES("/home/lancer/tr069/usr/include/")
INCLUDE_DIRECTORIES("/home/lancer/tr069/usr/include/json-c")
LINK_DIRECTORIES("/home/lancer/tr069/usr/lib")
[email protected]:/home/lancer/tr069/ubus# cmake CMakeLists.txt -DBUILD_LUA=OFF -DCMAKE_INSTALL_PREFIX=/home/lancer/tr069/usr

Build:
make

Install:
sudo make install
sudo ln -sf /usr/local/sbin/ubusd /usr/sbin/ubusd
sudo ln -sf /usr/local/lib/libubus.so /usr/lib/libubus.so

8.移植microxml---------------------------------------------------------------------------------------------
Get the sources:
[email protected]:/home/lancer/tr069# git clone https://github.com/pivasoftware/microxml.git
cd microxml

Generate configuration files:
[email protected]:/home/lancer/tr069/microxml# autoconf -i

Configure:
[email protected]:/home/lancer/tr069/microxml# ./configure --prefix=/home/lancer/tr069/usr --host=mipsel-linux --enable-threads --enable-shared --enable-static

Build:
make

Install:
sudo make install
sudo ln -sf /usr/lib/libmicroxml.so.1.0 /lib/libmicroxml.so
sudo ln -sf /usr/lib/libmicroxml.so.1.0 /lib/libmicroxml.so.1

9.移植curl
下载:https://curl.haxx.se/download.html :curl-7.53.1.tar.gz
cd curl-7.53.1

Configure:
[email protected]:/home/lancer/tr069/curl-7.53.1# ./configure --prefix=/home/lancer/tr069/usr --host=mipsel-linux

Build:
make

Install:
sudo make install

10.移植easycwmp-----------------------------------------------------------------------------------------------
官网下载:http://www.easycwmp.org/download.html : 我选择easycwmp-1.5.2.tar.gz
cd easycwmp-1.5.2

Generate configuration files:
[email protected]:/home/lancer/tr069/easycwmp-1.5.2# autoreconf -i

Configure:
./configure --prefix=/home/lancer/tr069/usr --host=mipsel-linux --enable-debug --enable-devel --enable-acs=multi --enable-jsonc=1 --x-includes=/home/lancer/tr069/usr/include/ --x-libraries=-L/home/lancer/tr069/usr/lib
......
checking for LIBCURL... no
configure: error: Package requirements (libcurl) were not met:

Package libcurl was not found in the pkg-config search path.
Perhaps you should add the directory containing `libcurl.pc‘
to the PKG_CONFIG_PATH environment variable
No package ‘libcurl‘ found

Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.

Alternatively, you may set the environment variables LIBCURL_CFLAGS
and LIBCURL_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.
解决方案:
[email protected]:/home/lancer/tr069/easycwmp-1.5.2# PKG_CONFIG_PATH=/home/lancer/tr069/usr//lib/pkgconfig:$PKG_CONFIG_PATH
[email protected]:/home/lancer/tr069/easycwmp-1.5.2# export PKG_CONFIG_PATH
[email protected]:/home/lancer/tr069/easycwmp-1.5.2# echo $PKG_CONFIG_PATH
/home/lancer/tr069/usr//lib/pkgconfig:
[email protected]:/home/lancer/tr069/easycwmp-1.5.2# ./configure --prefix=/home/lancer/tr069/usr --host=mipsel-linux --enable-debug --enable-devel --enable-acs=multi --enable-jsonc=1
OK
或者vim /opt/buildroot-gcc463/usr/bin/pkg-config修改
#!/bin/sh
#PKG_CONFIG_LIBDIR=${PKG_CONFIG_LIBDIR:-/opt/buildroot-gcc463/usr/mipsel-buildroot-linux-uclibc/sysroot/usr/lib/pkgconfig:/opt/buildroot-gcc463/usr/mipsel-buildroot-linux-uclibc/sysroot/usr/share/pkgconfig} PKG_CONFIG_SYSROOT_DIR=${PKG_CONFIG_SYSROOT_DIR:-/opt/buildroot-gcc463/usr/mipsel-buildroot-linux-uclibc/sysroot} $(dirname $0)/pkgconf [email protected]
PKG_CONFIG_LIBDIR=${PKG_CONFIG_LIBDIR:-/home/lancer/tr069/usr/lib/pkgconfig:/home/lancer/tr069/usr/share/pkgconfig} PKG_CONFIG_SYSROOT_DIR=${PKG_CONFIG_SYSROOT_DIR:-} $(dirname $0)/pkgconf [email protected]
为PKG_CONFIG_LIBDIR=${PKG_CONFIG_LIBDIR:-/home/lancer/tr069/usr/lib/pkgconfig:/home/lancer/tr069/usr/share/pkgconfig} PKG_CONFIG_SYSROOT_DIR=${PKG_CONFIG_SYSROOT_DIR:-/opt/buildroot-gcc463/usr/mipsel-buildroot-linux-uclibc/sysroot} $(dirname $0)/pkgconf [email protected]
当然第二种更好,不然编译还会有如下问题。

Build:
make
[email protected]:/home/lancer/tr069/easycwmp-1.5.2# make
Making all in bin
make[1]: Entering directory `/home/lancer/tr069/easycwmp-1.5.2/bin‘
mipsel-linux-gcc -DPACKAGE_NAME=\"easycwmpd\" -DPACKAGE_TARNAME=\"easycwmpd\" -DPACKAGE_VERSION=\"1.5.2\" -DPACKAGE_STRING=\"easycwmpd\ 1.5.2\" -DPACKAGE_BUGREPORT=\"[email protected]\" -DPACKAGE_URL=\"\" -DPACKAGE=\"easycwmpd\" -DVERSION=\"1.5.2\" -DPACKAGE=\"easycwmpd\" -DVERSION=\"1.5.2\" -DJSONC=1 -DDEBUG=1 -DDEVEL=1 -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -I. -I/opt/buildroot-gcc463/usr/mipsel-buildroot-linux-uclibc/sysroot/home/lancer/tr069/usr/include -D_THREAD_SAFE -D_REENTRANT -I/opt/buildroot-gcc463/usr/mipsel-buildroot-linux-uclibc/sysroot/home/lancer/tr069/usr/include -g -O2 -MT ../src/easycwmpd-backup.o -MD -MP -MF ../src/.deps/easycwmpd-backup.Tpo -c -o ../src/easycwmpd-backup.o `test -f ‘../src/backup.c‘ || echo ‘./‘`../src/backup.c
In file included from ../src/backup.c:13:0:
../src/backup.h:15:22: fatal error: microxml.h: No such file or directory
compilation terminated.
make[1]: *** [../src/easycwmpd-backup.o] Error 1
make[1]: Leaving directory `/home/lancer/tr069/easycwmp-1.5.2/bin‘
make: *** [all-recursive] Error 1
看前边。

自此,tr069相关库及程序都已交叉编译完毕。

时间: 2024-12-13 19:02:37

tr069开源协议EasyCwmp移植的相关文章

GPL、LGPL、MIT、BSD、Apache,这些开源协议,你都注意过吗?

本人在开发iOS应用的过程中,经常会使用到别人撰写的类库,不仅因为能够节省下大量的开发和调试的时间,还因此获得了更多完善且强大的功能和效果.在使用别人撰写的类库的时候,必须当心该类库所涉及的授权问题,如果使用不慎,很可能引发不必要的麻烦,甚至可能导致法律纠纷.同样使用过外部类库的开发者们,你们是否注意过呢? 1.GPL.LGPL和GFDL GPL 是 GNU General Public License (GNU 通用公共许可证)的缩写形式:LGPL 是 GNU Lesser General P

开源协议(转载)

  (1)Contributors 和 Recipients Contributors 指的是对某个开源软件或项目提供了代码(包括最初的或者修改过的)发布的人或者实体(团队.公司.组织等),Contributors 按照参与某个软件开源的时间先后,可以分为an initial Contributor 和 subsequent Contributors . Recipients指的是开源软件或项目的获取者,显然,subsequent Contributors 也属于 Recipients之列. (

主流开源协议简述

开源 ≠ 免费 开源 ≠ 免费 开源 ≠ 免费,重要的事情说三遍. 一.为何要了解开源协议 Java的强大与崛起,应当说强大的开源生态起了不小的作用.在编程的过程中也或多或少能接触到不少优秀的开源软件.框架, 况且我们又乐于找轮子,因此,了解经常见到的开源协议就有必要了.再者,不了解开源协议,随意使用一个带有限制的协议的开源软件甚至 使用没有任何协议的软件,这就像一颗定时炸弹,随时可能会要了你的命! 二.主流开源协议简介 1.Apache License, 2.0 (Apache-2.0 ) 1

各类开源协议总结

各种开源协议的核心内容,主要有4点: (1)使用该软件用于何目的的权利: (2)对软件工作原理的知情权(即是否能查看软件源代码): (3)重新发布软件副本的权利: (4)改进软件并将其发布的权利. 常见的开源协议: FPL(自由公共许可证): 代表软件:mysql (1)使用权利:允许内部自由使用,但不提供技术支持:商业使用必须申请商业许可证: (2)源代码:开放: (3)分发权利:允许免费分发,但必须遵守FPL其他条款,如要求分发mysql和其派生产品的全部源代码:并与Mysql分本FPL本身

GPL、BSD、MIT、Mozilla、Apache、LGPL开源协议介绍

BSD开源协议 BSD开源协议是一个给于使用者很大自由的协议.基本上使用者可以”为所欲为”,可以自由的使用,修改源代码,也可以将修改后的代码作为开源或者专有软件再发布. 但”为所欲为”的前提当你发布使用了BSD协议的代码,或则以BSD协议代码为基础做二次开发自己的产品时,需要满足三个条件: 如果再发布的产品中包含源代码,则在源代码中必须带有原来代码中的BSD协议. 如果再发布的只是二进制类库/软件,则需要在类库/软件的文档和版权声明中包含原来代码中的BSD协议. 不可以用开源代码的作者/机构名字

四大开源协议比较:BSD、Apache、GPL、LGPL

http://www.cnblogs.com/top5/archive/2010/07/31/1789657.html 本文参考文献:http://www.fsf.org/licensing/licenses/ 现今存在的开源协议很多,而经过Open Source Initiative组织通过批准的开源协议目前有58种.我们现在常见的开源协议如BSD, GPL, LGPL,MIT等都是OSI批准的协议.如果要开源自己的代码,最好也是选择这些被批准的开源协议. 这里我们来看四种最常用的开源协议及它

了解常见的开源协议(BSD, GPL, LGPL,MIT)

一直对各种开源协议比较模糊, 特意在网上搜索了一下资料, 整理总结,以作记录 如果不喜欢长篇大论的话, 看下图就可以了 基本概念了解: 1. Contributors 和 Recipients Contributors 指的是对某个开源软件或项目提供了代码(包括最初的或者修改过的)发布的人或者实体(团队.公司.组织等),Contributors 按照参与某个软件开源的时间先后,可以分为 an initial Contributor 和 subsequent Contributors . Reci

经典的开源协议分析工具:Wireshark.

2. TCP/IP协议经典书是:W.Richard Stevens 著<TCP/IP详解>三卷书,卷1是协议,卷2是实现,卷3是TCP事务协议等.还有官方的协议文档:RFC当然也可以在网上下载电子书.经典的开源协议分析工具:Wireshark.简单的开源TCP/IP协议栈:LwIP,或者Linux 1.0里包含的协议栈,当然也可以看看FreeBSD的TCP/IP协议栈 704ex 286wo 673av 604ek 659yl 363lh 957mk 564ge 854zm 932ox 711

开源协议

转自:http://www.open-open.com/Licence.asp 和 http://blog.csdn.net/strawren/archive/2008/04/26/2332755.aspx Mozilla Public License MPL License,允许免费重发布.免费修改,但要求修改后的代码版权归软件的发起者.这种授权维护了商业软件的利益,,它要求基于这种软件得修改无偿贡献版权给该软件.这样,围绕该软件得所有代码得版权都集中在发起开发人得手中.但MPL是允许修改,无