openwrt 添加应用的几个步骤如下:

(1)在目录 ./feeds/luci/applications 下添加要增加的应用,譬如 "luci-test"

(2)里面应该包含以下几个目录

hbg@root:~/trunk/feeds/luci/applications/luci-test$ tree
.
├── ipkg                      //  1、包相关
│   ├── conffiles
│   ├── postinst
│   └── postrm
├── luasrc                  //   2、web界面相关
│   ├── controller
│   │   └── test.lua
│   ├── model
│   └── view
├── Makefile              //  3、编译相关
├── po
│   ├── en
│   │   └── test.po
│   └── zh_CN
│       └── test.po
├── root                   //  4、/etc/目录下相关文件
│   ├── config
│   │   └── test               
│   ├── init.d
│   │   └── test
│   └── uci-defaults
│       └── luci-dtest
└── src                    //  5、实现功能的主程序
    ├── test.c
    └── test.h

(3)除此之外,还需要修改  ./feeds/luci/contrib/package/luci 目录下的makefile,使其能够在 make menuconfig  中显示。

$(eval $(call application,dtest, test 1.0,\
       +PACKAGE_luci-app-test:libuci +libpthread +libubox +librt))

然后就可以在 make menuconfig中查找到test的选项了。

注意: 在执行命令"make menuconfig"之前,需要先清空 /tmp目录。

补充知识:

Categories(luci目录)

The LuCI modules are divided into several category directories, namely:

  • applications (Single applications or plugins for other modules or applications, 应用)
  • i18n (Translation files, 翻译文件)
  • libs (Independent libraries, 独立的库)
  • modules (Collections of applications, 应用集合)
  • themes (Frontend themes, 前端主题)

Each module goes into a subdirectory of any of this category-directories.

Module directory

The contents of a module directory are as follows:

Makefile

This is the module's makefile. If the module just contains Lua source code or resources then the following Makefile should suffice.

如果module中只有 lua 代码文件和资源文件,那么Makefile包含如下内容足以:

include ../../build/config.mk

include ../../build/module.mk

If you have C(++) code in your module your Makefile should at least contain the following things.

如果module中包含了 C 或 C++ 代码文件,则需要包含如下内容:

include ../../build/config.mk

include ../../build/gccconfig.mk

include ../../build/module.mk

compile:

# Commands to compile and link your C-code

# and to install them under the dist/ hierarchy

clean: luaclean

# Commands to clean your compiled objects

src

The src directory is reserved for C source code.

src 目录用来保存 C源码。

luasrc

luasrc contains all Lua source code files. These will automatically be stripped or compiled depending on the Make target and are installed in the LuCI installation directory.

Luasrc 目录用来保存所有的 lua 源代码。

lua

lua is equivalent to luasrc but containing Lua files will be installed in the Lua document root.

htdocs

All files under htdocs will be copied to the document root of the target webserver.

htdocs 目录将被拷贝到目标webserver下的文档根目录。

root

All directories and files under root will be copied to the installation target as they are.

拷贝到设备的根目录下。

dist

dist is reserved for the builder to create a working installation tree that will represent the file system on the target machine. DO NOT put any files there as they will get deleted.

ipkg

ipkg contains IPKG package control files, like preinst, posinst, prerm, postrm. conffiles. See IPKG documentation for details.

openwrt 添加 应用(luci-application)的更多相关文章

  1. struct2访问或添加request/session/application

    访问或添加request/session/application 1 通过ActionContext //这样放置 public String execute()  {     ActionConte ...

  2. Xcode7.2中如何添加一个Empty Application模板

    大熊猫猪·侯佩原创或翻译作品.欢迎转载,转载请注明出处. 如果觉得写的不好请多提意见,如果觉得不错请多多支持点赞.谢谢! hopy ;) Xcode 6.0正式版之后已经没有所谓的Empty Appl ...

  3. openwrt 添加luci选项

    刚刚下载的openwrt trunk版本,安装后没有luci选项,如下图 需要添加luci页面选项. 步骤如下: (1)修改配置文件 .config , 将 CONFIG_FEED_luci is n ...

  4. 开发OpenWrt路由器上LuCI的模块

    [题外话] 学校里最近改造了校园网,要求必须用iNode验证,万幸的是路由器能刷OpenWrt,并且OpenWrt上有好多iNode认证的开源项目,比如njit8021xclient(以下简称njit ...

  5. OpenWRT添加模块 Makefile和Config.in

    添加模块编译 在网上找了一下,很多关于编译Openwrt系统的资料,不过这些事情芯片厂商提供的开发包都已经办得妥妥了,但是没有找到系统介绍的资料,添加一个包的介绍有不多,其中有两个很有参考价值: ht ...

  6. OpenWrt路由器通过LuCI界面实现Guest SSID功能

    转自: http://blog.ltns.info/linux/guest_ssid_over_openwrt_router/ 之前尝试过 Tomato路由器设置VLAN实现Guest SSID功能, ...

  7. openwrt web管理luci界面修改

    转自:http://blog.csdn.net/user_920/article/details/8504979 以前都没听过openwrt和luci,只接触过简单的php语言.由于工作原因,要修改下 ...

  8. openwrt开源系统LUCI配置界面

    转自:http://www.right.com.cn/forum/thread-131035-1-1.html 本人菜鸟,最近在学习这方面的知识,在参考资料的基础上总结如下内容.这篇文章针对如何对op ...

  9. openWRT学习之LUCI之中的一个helloworld演示样例

    备注1:本文 讲述的是原生的openWRT环境下的LUCI 备注2:本文參考了诸多资料.感谢网友分享.參考资料: http://www.cnblogs.com/zmkeil/archive/2013/ ...

随机推荐

  1. Object-c学习之路三(@class与#import的区别)

    //@class只是为了声明B是一个类  当两个类相互包含的时候#import是做不到的 //一般在.h文件中用@class声明一个类成员 在..m文件中具体用到时才用#import应用 //二者区别 ...

  2. struts2讲义----建立一个struts2工程

    建立一个Struts2 工程 Ø 1在MyEclipse中新建web工程 Ø 2在struts-2.2.1.1-all\struts-2.2.1.1解压struts2-blank.war( 最基础的示 ...

  3. CSS样式基础知识

    CSS样式基础知识 CSS样式概述 CSS是Cascading Style Sheet 的缩写.译作“层叠样式表单”.是用于(增强)控制网页样式并允许将样式信息与网页内容分离的一种标记性语言. 引用位 ...

  4. .Net项目框架

    摘要:本文描述了在用VS.NET进行B/S开发时采用的框架结构,一般建立类库项目和Web项目,在Web基本aspx页面类中调用类库中方法,同时在aspx页面类中不需要写任何对数据库操作的SQL代码,便 ...

  5. 一种利用异常机制基于MVC过滤器的防止重复提交的机制分享

    防止重复提交验证机制 某些时候因为系统反应稍慢,急性子用户可能不耐烦会进行重复的提交,这个操作不仅可能造成系统负担,也可能产生垃圾数据. 出现这两种状况都是我们不希望的. 为此,在公司项目系统设计了以 ...

  6. bat编程基本知识

    1 声明变量 ::注意=前后不要留空格.随便说一下,在bat中,连续两个冒号表示注释 set var1=test 如果要引用这个变量的话,可以这样写:%var1% 2 echo off/on echo ...

  7. SVN-钩子祥解与配置

    钩子脚本的具体写法就是操作系统中shell脚本程序的写法,请根据自己SVN所在的操作系统和shell程序进行相应的写作 所谓钩子就是与一些版本库事件触发的程序,例如新修订版本的创建,或是未版本化属性的 ...

  8. 2013Esri全球用户大会之解读Web GIS

    1 什么是Web GIS,它跟我有什么关系? Web GIS是传递GIS功能的一种新方式,在Esri把GIS作为平台进行实现的战略方向中位于中心位置.Web GIS为用户随时随地访问和使用地理信息提供 ...

  9. 使用DBUnit实现对数据库的测试

    这是一个JavaProject,有关DBUnit用法详见本文测试用例 首先是用到的实体类User.java package com.jadyer.model; public class User { ...

  10. AS3中释放优化的几条常识

    as3中垃圾和堆弃物如不及时清理,会造成进程的速度方面授予限制,下面讲几点关于释放优化的几条内容. 被删除对象在外部的所有引用一定要被删除干净才能被系统当成垃圾回收处理掉: 父对象内部的子对象被外部其 ...