
linux
重庆openwrt
重庆openwrt :721879794
展开
-
mt7621 uboot编译报错
CHK include/config/uboot.release CHK include/generated/version_autogenerated.h UPD include/generated/version_autogenerated.h CHK include/generated/timestamp_autogenerated.h UPD include/generated/timestamp_autogenerated.h CHK ...原创 2020-11-25 17:37:58 · 978 阅读 · 0 评论 -
Linux C atoi() 字符串转整形
1.函数功能:把字符串转换成整型数.master->relation_buf = atoi(rd_buff);printf("relation_buf:%d\n", master->relation_buf);原创 2020-09-28 19:30:51 · 585 阅读 · 0 评论 -
openwrt wifi默认启动
/NXP/feiling/openwrt/package/kernel/mac80211/files/lib/wifi/mac80211.sh1改为 0原创 2020-09-16 17:21:09 · 1351 阅读 · 1 评论 -
OpenWrt OpenMPTCProuter feed
echo "src-git OpenMPTCProuter https://github.com/Ysurac/openmptcprouter-feeds.git" >> feeds.conf.default./scripts/feeds update -a./scripts/feeds install -amake menuconfig原创 2020-08-17 13:41:52 · 1986 阅读 · 2 评论 -
linux c 读写文件
#include <fcntl.h>#include <sys/types.h>#include <sys/stat.h>#include <stdio.h>#include <string.h>#include <unistd.h>void main(){int fd,size;char s[] = "hello !" ,buff[1024];fd = open("xx.txt",O...原创 2020-08-11 19:59:55 · 253 阅读 · 0 评论 -
Openwrt添加内核patch
Openwrt添加内核patch在openwrt根目录执行以下指令 切换到内核路径下 增加新的patch 编辑要修改的文件 查看修改内容 生成新的patch 更新patch(切换到openwrt根目录) 重新编译固件 编译后patch会存在以下目录(openwrt根目录查看) 环境说明:ubuntu16.04openwrt 18.06(Linux-4.9.120)在openwrt根目录执行以下指令make target/linux/{clean,p.转载 2020-08-10 18:56:39 · 1135 阅读 · 0 评论 -
Openwrt 19.07.03 NXP LS1046A
编译固件完后,制作镜像 cd /home/forlinx/work/openwrt/staging_dir/target-aarch64_generic_musl rm root-layerscape/lib/preinit/80_mount_root sudo make_ext4fs -s -T -I -l 7489978368 OpenWRT.img root-layerscape 注意:make_ext4fs 工具可以通过 apt-get install android-tools原创 2020-08-10 18:49:52 · 953 阅读 · 0 评论 -
linux c 如何判断 字符数组是否为空
1、学符数组str[];if(strlen(str)==0)则该字符数组为空2、判断:if (strcmp(buf,"")==0)strcmp在"string.h"中,buf是你要判断的字符串原创 2020-08-10 14:43:29 · 1581 阅读 · 0 评论 -
linux c char * char[]相互转换
1、char[]转char*可以直接赋值。char pp[20] = "helloworld";char* p = pp;2、char*转char[]主要有两种方法可以将char*转换为char[]类型,分别是:strcpy()、循环遍历。其中,strcpy()可能会报安全性错误,自行解决即可。2.1 strcpy()方法char arr[20];char* tmp = "helloworld";strcpy(arr, tmp);2.2 循环遍历char arr[20];c原创 2020-07-28 14:05:30 · 1236 阅读 · 0 评论 -
openwrt MT7623 刷机
http://wiki.banana-pi.org/%E5%BF%AB%E9%80%9F%E4%B8%8A%E6%89%8B_%E9%A6%99%E8%95%89%E6%B4%BE_BPI-R2根据上面步骤 。插上sd卡win32diskmanager,直接写入。插卡 一直按住PWR。直到有打印原创 2020-07-19 15:35:25 · 1341 阅读 · 0 评论 -
Linux OpenWRT查看CPU,RAM,Flash信息参数
查看RAM容量大小(可以理解为电脑的内存条)root@OpenWrt:/# cat /proc/meminfo |grep MemTotal #查看RAM大小MemTotal: 61348 kBroot@OpenWrt:/# free -h |grep Mem | awk -F ' ' '{print $2}' #查看RAM大小 (单位kB)61348root@OpenWrt:/# free -h |grep Mem | awk -F ' ' '{print $3}'...原创 2020-07-16 10:40:27 · 3018 阅读 · 0 评论 -
openwrt wifi PSK设置
Network*hostapd········· Mhostapd-basic*hostapd-common······*hostapd-utils··············原创 2020-07-16 10:24:31 · 395 阅读 · 0 评论 -
openwrt 插拔重新获取IP
while true; do status=`swconfig dev switch0 port 4 get link | awk '{print $2}' | cut -d":" -f2` #这个是获取当前网线的拔插状态,UP就是插着网线,down就是拔出网线 if [ "$status" = "up" ]; then ech...原创 2020-09-08 17:44:43 · 1384 阅读 · 0 评论 -
openwrt 获取网口MAC地址
static int get_mac(char* mac,char* brifc){ struct ifreq tmp; int sock_mac; char mac_addr[32]={0}; sock_mac = socket(AF_INET, SOCK_STREAM, 0); if( sock_mac == -1) { perror("create socket fail\n"); return -1; }...原创 2020-07-13 18:08:22 · 2126 阅读 · 0 评论 -
openwrt linux 设置ip
#include<stdio.h>#include<stdlib.h>#include<string.h>#include<sys/ioctl.h>#include<sys/socket.h>#include<arpa/inet.h>#include<netinet/in.h>#include<net/if.h>#include "setip.h"//设置IP地址/** 函数名称 : i.原创 2020-07-13 18:07:20 · 661 阅读 · 0 评论 -
openwrt 动态分配有规律IP地址
vi /etc/config/dhcpconfig dhcp 'lan' option interface 'lan' option start '1' option limit '100' option leasetime '12h' option dhcpv6 'server' option ra 'server'原创 2020-07-07 18:33:42 · 2407 阅读 · 0 评论 -
linux c ioctl ifconfig
ioctl(sock,SIOCGIFHWADDR,&ifr)函数中 SIOCGIFHWADDR 用来获取网卡硬件地址(MAC地址)原创 2020-07-04 17:14:23 · 541 阅读 · 0 评论 -
openwrt 19.07 resolv.conf 域名解析
search lannameserver 114.114.114.114nameserver 127.0.0.1nameserver 表明DNS服务器的IP地址。domain 声明主机的域名。很多程序用到它,如邮件系统;search 它的多个参数指明域名查询顺序。sortlist 允许将得到域名结果进行特定的排序。它的参数为网络/掩码对,允许任意的排列顺序。...原创 2020-07-03 15:39:42 · 872 阅读 · 0 评论 -
openwrt linux c 修改系统时间
#include <stdio.h>#include<sys/time.h>#include<unistd.h>#include <time.h>typedef struct _SettimeInfo_{ char settime[32]; //输入要修改的系统时间 %d-%d-%d %d:%d:%d}SETTIMEINFO;int SetSystemTime(SETTIMEINFO * SetTime){ stru...原创 2020-06-28 13:47:51 · 918 阅读 · 0 评论 -
openwrt log
vim/etc/config/systemconfig system... option log_ip <destination IP> option log_port <destination port> option log_proto <tcp or udp>原创 2020-06-05 18:49:35 · 464 阅读 · 0 评论 -
openwrt 报错小记
1. uboot烧录固件之后一直jffs2:jffs2_scan_eraseblock():Magicbitmask大概率是刷的时候没刷完原创 2020-06-03 14:40:05 · 747 阅读 · 0 评论 -
openwrt 19.07 恢复出厂设置
设置GPIO后7 cat /etc/rc.button/reset 8 #!/bin/sh 9 . /lib/functions.sh 10 OVERLAY="$( grep ' /overlay ' /proc/mounts )" 11 case "$ACTION" in 12 pressed) 13 [ -z "$OVERLAY" ] && return 0 14 return 5 15 ;; 16 timeo...原创 2020-05-30 10:55:18 · 2759 阅读 · 0 评论 -
OpenWRT 小记
查看openwrt内核版本:cat /proc/version原创 2020-05-21 18:39:02 · 581 阅读 · 1 评论 -
openwrt 使用memcpy
使用memcpy一定要注意内存偏移发生错误memcpy(,buffer,sizeof(buffer));一定不要越界!!!!原创 2020-04-03 11:54:54 · 136 阅读 · 0 评论 -
ESP8266 固件擦除
折腾了两天 真是醉了 首先确认安装 pythonpython2是否安装python2 --versionsudo apt- isntall python-pip安装pip和他的许多其他依赖 pip 9.0.1 from /usr/lib/python2.7/dist-packages (python 2.7)测试python3python3 -...原创 2019-05-16 14:24:54 · 7476 阅读 · 0 评论 -
VMware Workstation 该虚拟机似乎正在使用中。如果该虚拟机未在使用
在文件夹名后面加 .backup原创 2019-05-10 09:43:05 · 646 阅读 · 0 评论 -
OpenWrt 交叉编译环境变量设置
首先解压 tar zxvf OpenWrt-toolch ...... 然后 找到目录下 bin文件夹 PWD 接下来配置系统环境变量,把交叉编译工具链的路径添加到环境变量PATH中去 ,这样就可以在任何目录下使用这些工具。记下上一步中的安装路径,使用命令: vim /etc/profile 编辑profile文件,添加环境...原创 2018-03-05 15:12:26 · 1773 阅读 · 0 评论