愿星光伴随你左右


  • 首页

  • todo

  • 思考

  • life

  • food

  • OS

  • lua

  • redis

  • Golang

  • C

  • TCP/IP

  • ebpf

  • p4

  • OpenVPN

  • IPSec

  • L2TP

  • DNS

  • distributed

  • web

  • OpenWRT

  • 运维

  • Git

  • 鸟哥的私房菜

  • IT杂谈

  • 投资

  • About Me

  • 友情链接

  • FTP

  • 搜索
close

Luci实现框架

时间: 2022-10-24   |   分类: OpenWrt     |   阅读: 3945 字 ~8分钟

1.总述

上一篇总结了uhttpd的工作方式,openwrt中利用它作为web服务器,实现客户端web页面配置功能。对于request处理方式,采用的是cgi,而所用的cgi程序就是luci,工作框架如下图所示:

阅读全文 »

OpenWrt Luci页面如何配置底部按钮(返回、保存、复位)

时间: 2022-10-24   |   分类: OpenWrt     |   阅读: 822 字 ~2分钟

在OpenWrt开发过程中,会用到不同风格的页面,比如有的是配置页面,有的是状态页面 而状态页面是不需要保存按钮的

如何屏蔽保存按钮,增加返回按钮呢?

OpenWrt Luci框架已经做了很好的封装,只需要配置相关变量即可。

而luci的footer页面采用了模板,我们可以在controller中增加字段定义即可屏蔽底部按钮 底部按钮有以下几种

阅读全文 »

OpenWrt 系统UCI详解(Lua、C语言调用uci接口实例)

时间: 2022-10-24   |   分类: OpenWrt     |   阅读: 3840 字 ~8分钟

UCI简介

“uci"是"Unified Configuration Interface”(统一配置界面)的缩写,用于OpenWrt整个系统的配置集中化。

阅读全文 »

Git 清除历史记录

时间: 2022-10-24   |   分类: git     |   阅读: 166 字 ~1分钟

Git 清除所有历史记录

1. 进入仓库,拉一个分支比如名为 latest_branch
git checkout --orphan latest_branch
  • –orphan 创建一个无任何历史记录的孤儿分支
2. 添加所有文件到上述分支并提交一次
git add -A
git commit -am 'initial commit'
3. 删除 master 分支

登录后复制

阅读全文 »

How to fix ‘fatal: refusing to merge unrelated histories’ Git error

时间: 2022-10-24   |   分类: git     |   阅读: 967 字 ~2分钟

What is the ‘fatal: refusing to merge unrelated histories’ error?

The fatal: refusing to merge histories error is a fairly common Git error. It appears when a developer tries to merge two unrelated projects into a single branch.

This error appears when the branch has its commit histories and tags incompatible with the pull request or clone.

阅读全文 »

OpenWrt Luci流程分析

时间: 2022-10-21   |   分类: OpenWrt     |   阅读: 2545 字 ~6分钟

页面请求:

代码结构

在openwrt文件系统中,lua语言的代码不要编译,类似一种脚本语言被执行,还有一些uhttpd服务器的主目录,它们是:

/www/index.html
cgi-bin/luci
luci-static/xxx/xx.css、js、gif

/usr/lib/lua/nixio.so、uci.so
luci/http.lua、dispatcher.lua、core…
controller/xxx.lua
model/xxx.lua
view/xxx.lua

界面显示

网页请求格式基本都如下所示:,说明处理都在服务器的默认网站下的/cgi-bin/luci文件进行处理。

阅读全文 »

Openwrt 编译x86镜像

时间: 2022-10-21   |   分类: OpenWrt     |   阅读: 444 字 ~1分钟

有些同学可能想学习openwrt系统,但手头又没有嵌入式板子,是编译和运行系统,然后再增加自己的功能。下面介绍如何编译openwrt系统后再虚拟机下运行。


  1. 下载openwrt最新代码 在github上搜索openwrt,找到下载地址https://github.com/openwrt/openwrt.git
  2. 在ubuntu下执行命令克隆openwrt源码 git clone https://github.com/openwrt/openwrt.git 3. 执行以下命令更新包 ./scripts/feeds update -a ./scripts/feeds install -a 更新package,否则luci等package通过make menuconfig 不能显示 4.配置目标系统 make menuconfig 选择平台为X86 这里写图片描述

选择vmdk目标文件格式

阅读全文 »

Openwrt LuCI UCI(三)

时间: 2022-10-21   |   分类: OpenWrt     |   阅读: 4277 字 ~9分钟

UCI简介

  • UCI是Unified Configuration Interface的缩写,翻译成中文就是统一配置接口,用途就是为OpenWrt提供一个集中控制的接口。
  • 配置接口启动流程:
  • ① 启动脚本 /etc/init.d/xxx;
  • ② 启动脚本通过UCI分析库从 /etc/config/xxx 获得启动参数;
  • ③ 启动脚本完成正常启动。

在这里插入图片描述

阅读全文 »
24 25 26 27 28 29 30 31 32

日志
分类
标签
RSS 订阅
GitHub
© 2009 - 2025
粤ICP备2021068940号-1 粤公网安备44011302003059
0%